User Tools

Site Tools


hpl3:game:scripting:id_handles

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
hpl3:game:scripting:id_handles [2013/07/19 12:55]
nebej
hpl3:game:scripting:id_handles [2013/07/19 13:05]
nebej
Line 14: Line 14:
 class cMyClass { class cMyClass {
   iPhysicsBody@ mpBody; // unsafe   iPhysicsBody@ mpBody; // unsafe
- 
   tID mBodyID; // safe   tID mBodyID; // safe
 } }
Line 68: Line 67:
 } }
 </​code>​ </​code>​
 +
 +
 +The retrieval functions perform safe cast. The ID for a Prop can be used to retrieve a Entity, but if you use it to try to retrieve a Area then it will return null.
  
  
Line 74: Line 76:
  
 The default value of the tID class is tID_Invalid. Calling any retrieval function with that value will cause the function to return null. When a handle is no longer in use it should have its value set to tID_Invalid. The default value of the tID class is tID_Invalid. Calling any retrieval function with that value will cause the function to return null. When a handle is no longer in use it should have its value set to tID_Invalid.
 +
 +
 +**Saving and loading** ​
 +
 +
 +A ID handle can be saved to the save file and it will retrieve the same object after load. The ID will also stay the same when working on the map which means that the save file will stay valid even after a patch on a map. This will also work with the realtime reload of the entity maptrack.
  
  
 ===== Functions ===== ===== Functions =====
 +
 +
 +<​file>​
 +iEntity3D@ cLux_IDEntity3D(tID aID);
 +cMeshEntity@ cLux_IDMeshEntity(tID aID);
 +cSubMeshEntity@ cLux_IDSubMeshEntity(tID aID);
 +iLight@ cLux_IDLight(tID aID);
 +cLightMaskBox@ cLux_IDLightMaskBox(tID aID);
 +cBillboard@ cLux_IDBillboard(tID aID);
 +cBillboardGroup@ cLux_IDBillboardGroup(tID aID);
 +cLensFlare@ cLux_IDLensFlare(tID aID);
 +cBeam@ cLux_IDBeam(tID aID);
 +cParticleSystem@ cLux_IDParticleSystem(tID aID);
 +cGuiSetEntity@ cLux_IDGuiSetEntity(tID aID);
 +iRopeEntity@ cLux_IDRopeEntity(tID aID);
 +cClothEntity@ cLux_IDClothEntity(tID aID);
 +cFogArea@ cLux_IDFogArea(tID aID);
 +cExposureArea@ cLux_IDExposureArea(tID aID);
 +cForceField@ cLux_IDForceField(tID aID);
 +cSoundEntity@ cLux_IDSoundEntity(tID aID);
 +
 +iPhysicsBody@ cLux_IDPhysicsBody(tID aID);
 +iPhysicsJoint@ cLux_IDPhysicsJoint(tID aID);
 +iCharacterBody@ cLux_IDCharacterBody(tID aID);
 +
 +iLuxEntity@ cLux_IDEntity(tID aID);
 +cLuxProp@ cLux_IDProp(tID aID);
 +cLuxArea@ cLux_IDArea(tID aID);
 +cLuxLiquidArea@ cLux_IDLiquidArea(tID aID);
 +cLuxReverbArea@ cLux_IDReverbArea(tID aID);
 +cLuxCritter@ cLux_IDCritter(tID aID);
 +cLuxAgent@ cLux_IDAgent(tID aID);
 +</​file>​
  
hpl3/game/scripting/id_handles.txt ยท Last modified: 2015/09/11 10:50 by ian.thomas