gObjectPrototype Class Reference

List of all members.

Public Member Functions

mixed SetHull (mixed value, mixed delta)
mixed AddHull (mixed delta)
mixed RepairHull (mixed rep)
mixed DamageHull (mixed dmg)
mixed Damage (mixed dmg, mixed hx, mixed hy, mixed hz, mixed attacker)
 server only
mixed SetShield (mixed value, mixed delta)
mixed DamageShield (mixed dmg)
 returns damage done to the shield
mixed SetEnergy (mixed value, mixed delta)
mixed ReduceEnergy (mixed dmg)
 returns reduction done to the energy
mixed GlobalToLocal (mixed x, mixed y, mixed z)
mixed LocalToGlobal (mixed x, mixed y, mixed z)
 returns x,y,z : transforms a local-object position to global coords
mixed CalcRotationTo (mixed x, mixed y, mixed z)
 returns qw,qx,qy,qz : calculates the relative rotation to a position in global coords
mixed GetDistToPos (mixed x, mixed y, mixed z)
mixed GetDistToObject (mixed other)
mixed GetVectorToObject (mixed other)
mixed SetName (mixed sName)
 ##### ##### ##### ##### ##### common
mixed GetName (mixed sName)
mixed ServerSendProps (mixed con)
 transmit all current properties to a newly joined player
mixed GetProp (mixed proptype_or_name_or_id)
mixed SetProp (mixed proptype_or_name_or_id, mixed value, mixed delta, mixed fMin, mixed fMax, mixed fRate)
 overloaded function supporting different parameter sets for convenience
mixed SetProp_Dynamic_Number (mixed proptype_or_name_or_id, mixed value, mixed delta, mixed fMin, mixed fMax, mixed fRate)
 ##### ##### ##### ##### ##### SetProp_Dynamic_Number
mixed SetProp_Static_Number (mixed proptype_or_name_or_id, mixed value, mixed delta)
 ##### ##### ##### ##### ##### SetProp_Static_Number
mixed SetProp_Static_String (mixed proptype_or_name_or_id, mixed value)
 ##### ##### ##### ##### ##### SetProp_Static_String
mixed GetCargo (mixed objecttype_or_name_or_id)
mixed SetCargo (mixed objecttype_or_name_or_id, mixed amount)
 does not check cargo capacity, see AddCargoUntilFull for that
mixed TransferCargo (mixed dest_obj, mixed cargotype_name_or_id, mixed amount_delta)
mixed AddCargo (mixed cargotype_name_or_id, mixed amount_delta)
mixed AddCargoUntilFull (mixed cargotype_name_or_id, mixed amount)
 returns the amount that did not fit, e.g. 0 if all fit, amount if there was no space left
mixed RemoveCargoUntilEmpty (mixed cargotype_name_or_id, mixed amount)
 returns the amount that was taken
mixed CargoDivList (mixed objtypelist)
mixed CargoAddList (mixed objtypelist, mixed times)
mixed AddToDestroyList (mixed something)
mixed RemoveFromDestroyList (mixed something)
mixed AddToDestroyNotifyList (mixed callback)
mixed RemoveFromDestroyNotifyList (mixed callback)
mixed SetTeamID (mixed iTeamID)
mixed ServerSendSpawn (mixed con)
 sends kNetMessage_SpawnObject : iifffffffi : (objtypeid,locationid,vPos,qRot,objid)
mixed SetParentLocation (mixed location_or_id, mixed bNoBroadCast)
 bNoBroadCast : do not broadcast message to clients, only for initial setparentloc during objectspawn
mixed SetVisible (mixed bVisible)
mixed GetRandomPositionAtDist (mixed dist)
 returns x,y,z
mixed ManualThrustStep (mixed x, mixed y, mixed z)
 x,y,z are in absolute coordinates, must be in [-1,1]
mixed GetInteriorStuffAtPos (mixed x, mixed y, mixed z)
 see also lib.object.hangar.lua
mixed RayPick (mixed rx, mixed ry, mixed rz, mixed rvx, mixed rvy, mixed rvz)
 returns hitdist (relative to raylen) or nil if not hit
mixed GetActiveEquipmentSum (mixed objtype_name_or_id, mixed filterfun)
mixed GetFreeEquipmentSlot (mixed slottype_or_name)
mixed CanEquip (mixed objtype_name_or_id)
 does not check if there is a free slot, use gObjectPrototype:GetFreeEquipmentSlot for that
mixed EquipOrAddToCargo (mixed objtype_name_or_id, mixed container_or_id)
mixed Equip (mixed objtype_name_or_id, mixed container_or_id)
mixed Unequip (mixed container_or_id, mixed objecttype_or_name_or_id)
mixed GetContainerByType (mixed containertype_or_name_or_id, mixed num)
mixed ListContainersWithType (mixed containertype_or_name_or_id)
mixed GetContainerSum (mixed typefieldname, mixed container_type_filter_fun)
 container_type_filter_fun can be nil to get all
mixed CanExitShip (mixed owner)
mixed CanEnterShip (mixed owner)


Detailed Description

Definition at line 139 of file lua_pseudo_code.cpp.


Member Function Documentation

mixed gObjectPrototype::SetHull ( mixed  value,
mixed  delta 
) [inline]

Definition at line 141 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::AddHull ( mixed  delta  )  [inline]

Definition at line 143 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::RepairHull ( mixed  rep  )  [inline]

Definition at line 145 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::DamageHull ( mixed  dmg  )  [inline]

Definition at line 147 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::Damage ( mixed  dmg,
mixed  hx,
mixed  hy,
mixed  hz,
mixed  attacker 
) [inline]

server only

Definition at line 150 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::SetShield ( mixed  value,
mixed  delta 
) [inline]

Definition at line 152 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::DamageShield ( mixed  dmg  )  [inline]

returns damage done to the shield

Definition at line 155 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::SetEnergy ( mixed  value,
mixed  delta 
) [inline]

Definition at line 157 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::ReduceEnergy ( mixed  dmg  )  [inline]

returns reduction done to the energy

Definition at line 160 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::GlobalToLocal ( mixed  x,
mixed  y,
mixed  z 
) [inline]

object methods related to object position and rotation also for coordinate system translation and distance measurement returns x,y,z : transforms a global position to a object-local coords

Definition at line 165 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::LocalToGlobal ( mixed  x,
mixed  y,
mixed  z 
) [inline]

returns x,y,z : transforms a local-object position to global coords

Definition at line 168 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::CalcRotationTo ( mixed  x,
mixed  y,
mixed  z 
) [inline]

returns qw,qx,qy,qz : calculates the relative rotation to a position in global coords

Definition at line 171 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::GetDistToPos ( mixed  x,
mixed  y,
mixed  z 
) [inline]

Definition at line 173 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::GetDistToObject ( mixed  other  )  [inline]

Definition at line 175 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::GetVectorToObject ( mixed  other  )  [inline]

Definition at line 177 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::SetName ( mixed  sName  )  [inline]

##### ##### ##### ##### ##### common

Definition at line 180 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::GetName ( mixed  sName  )  [inline]

Definition at line 182 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::ServerSendProps ( mixed  con  )  [inline]

transmit all current properties to a newly joined player

Definition at line 185 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::GetProp ( mixed  proptype_or_name_or_id  )  [inline]

Definition at line 187 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::SetProp ( mixed  proptype_or_name_or_id,
mixed  value,
mixed  delta,
mixed  fMin,
mixed  fMax,
mixed  fRate 
) [inline]

overloaded function supporting different parameter sets for convenience

Definition at line 190 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::SetProp_Dynamic_Number ( mixed  proptype_or_name_or_id,
mixed  value,
mixed  delta,
mixed  fMin,
mixed  fMax,
mixed  fRate 
) [inline]

##### ##### ##### ##### ##### SetProp_Dynamic_Number

Definition at line 193 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::SetProp_Static_Number ( mixed  proptype_or_name_or_id,
mixed  value,
mixed  delta 
) [inline]

##### ##### ##### ##### ##### SetProp_Static_Number

Definition at line 196 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::SetProp_Static_String ( mixed  proptype_or_name_or_id,
mixed  value 
) [inline]

##### ##### ##### ##### ##### SetProp_Static_String

Definition at line 199 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::GetCargo ( mixed  objecttype_or_name_or_id  )  [inline]

Definition at line 201 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::SetCargo ( mixed  objecttype_or_name_or_id,
mixed  amount 
) [inline]

does not check cargo capacity, see AddCargoUntilFull for that

Definition at line 204 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::TransferCargo ( mixed  dest_obj,
mixed  cargotype_name_or_id,
mixed  amount_delta 
) [inline]

does not check bounds amount_delta can be negative to substract cargo amount_delta gets transfered from self to dest_obj

Definition at line 209 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::AddCargo ( mixed  cargotype_name_or_id,
mixed  amount_delta 
) [inline]

does not check bounds, see AddCargoUntilFull for that amount_delta can be negative to substract cargo

Definition at line 213 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::AddCargoUntilFull ( mixed  cargotype_name_or_id,
mixed  amount 
) [inline]

returns the amount that did not fit, e.g. 0 if all fit, amount if there was no space left

Definition at line 216 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::RemoveCargoUntilEmpty ( mixed  cargotype_name_or_id,
mixed  amount 
) [inline]

returns the amount that was taken

Definition at line 219 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::CargoDivList ( mixed  objtypelist  )  [inline]

division by typelist : cost={["cargo/iron"]=50} used to determine how many times you can afford an offer

Definition at line 223 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::CargoAddList ( mixed  objtypelist,
mixed  times 
) [inline]

add/sub a typelist * times to cargo : cost={["cargo/iron"]=50} times can be negative for substraction, defaults to 1

Definition at line 227 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::AddToDestroyList ( mixed  something  )  [inline]

objects methods related to destruction for damaging see lib.object.hp.lua objects can register themselves here, then something:Destroy() will be called when the object is destroyed WARNING ! don't add anything to the list during destroy iteration !!!

Definition at line 233 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::RemoveFromDestroyList ( mixed  something  )  [inline]

Definition at line 235 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::AddToDestroyNotifyList ( mixed  callback  )  [inline]

callbacks can register themselves here, then callback(obj) will be called when the object is destroyed WARNING ! don't add anything to the list during destroy iteration !!!

Definition at line 239 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::RemoveFromDestroyNotifyList ( mixed  callback  )  [inline]

Definition at line 241 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::SetTeamID ( mixed  iTeamID  )  [inline]

Definition at line 243 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::ServerSendSpawn ( mixed  con  )  [inline]

sends kNetMessage_SpawnObject : iifffffffi : (objtypeid,locationid,vPos,qRot,objid)

Definition at line 246 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::SetParentLocation ( mixed  location_or_id,
mixed  bNoBroadCast 
) [inline]

bNoBroadCast : do not broadcast message to clients, only for initial setparentloc during objectspawn

Definition at line 249 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::SetVisible ( mixed  bVisible  )  [inline]

Definition at line 251 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::GetRandomPositionAtDist ( mixed  dist  )  [inline]

returns x,y,z

Definition at line 254 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::ManualThrustStep ( mixed  x,
mixed  y,
mixed  z 
) [inline]

x,y,z are in absolute coordinates, must be in [-1,1]

Definition at line 257 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::GetInteriorStuffAtPos ( mixed  x,
mixed  y,
mixed  z 
) [inline]

see also lib.object.hangar.lua

Definition at line 260 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::RayPick ( mixed  rx,
mixed  ry,
mixed  rz,
mixed  rvx,
mixed  rvy,
mixed  rvz 
) [inline]

returns hitdist (relative to raylen) or nil if not hit

Definition at line 263 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::GetActiveEquipmentSum ( mixed  objtype_name_or_id,
mixed  filterfun 
) [inline]

Definition at line 265 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::GetFreeEquipmentSlot ( mixed  slottype_or_name  )  [inline]

Definition at line 267 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::CanEquip ( mixed  objtype_name_or_id  )  [inline]

does not check if there is a free slot, use gObjectPrototype:GetFreeEquipmentSlot for that

Definition at line 270 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::EquipOrAddToCargo ( mixed  objtype_name_or_id,
mixed  container_or_id 
) [inline]

container_or_id can be nil -> autochoose adds the type to cargo if it cannot be equipped

Definition at line 274 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::Equip ( mixed  objtype_name_or_id,
mixed  container_or_id 
) [inline]

Definition at line 276 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::Unequip ( mixed  container_or_id,
mixed  objecttype_or_name_or_id 
) [inline]

Definition at line 278 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::GetContainerByType ( mixed  containertype_or_name_or_id,
mixed  num 
) [inline]

~ for objtype,amount in pairs(container.content) do ~ if (objtype.equipment_add_energyrate or 0) < 0 and amount>0 then ~ return container,objtype ~ end ~ end ##### ##### ##### ##### ##### rest use num=3 if you want the third container of a specified type, defaults to 1.

Definition at line 287 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::ListContainersWithType ( mixed  containertype_or_name_or_id  )  [inline]

Definition at line 289 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::GetContainerSum ( mixed  typefieldname,
mixed  container_type_filter_fun 
) [inline]

container_type_filter_fun can be nil to get all

Definition at line 292 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::CanExitShip ( mixed  owner  )  [inline]

Definition at line 294 of file lua_pseudo_code.cpp.

mixed gObjectPrototype::CanEnterShip ( mixed  owner  )  [inline]

Definition at line 296 of file lua_pseudo_code.cpp.


The documentation for this class was generated from the following file:

Generated on Wed Feb 8 06:00:25 2012 for lua by  doxygen 1.5.6