Repository navigation
Scripting Entities
-
RTenum - Possible render types of entities:RT.ILLEGALRT.NONE-
RT.MODEL- Model entities (e.g.CModelHolder2, all the vanilla enemies). -
RT.BRUSH- World geometry (e.g.CWorldBase). -
RT.EDITORMODEL- Model entities only visible in the editor (e.g.CTrigger). -
RT.VOID- Gameplay entity with no visual representation (e.g.CPlayerWeapons). -
RT.FIELDBRUSH- Brushes only visible in the editor (e.g.CTouchField). -
RT.SKAMODEL- Models with skeletal animations. -
RT.SKAEDITORMODEL- Models with skeletal animations only visible in the editor. -
RT.TERRAIN- 1.07+ terrains.
-
SPFenum - Spawn flags for entities:SPF.EASYSPF.NORMALSPF.HARDSPF.EXTREMESPF.TOURIST-
SPF.MASK_DIFFICULTY- Mask containing difficulty flags above. SPF.SINGLEPLAYERSPF.DEATHMATCHSPF.COOPERATIVESPF.FLYOVER-
SPF.MASK_GAMEMODE- Mask containing gamemode flags above.
-
ENFenum - Generic flags of entities:ENF.SELECTEDENF.ZONINGENF.DELETEDENF.ALIVEENF.INRENDERINGENF.VALIDSHADINGINFOENF.SEETHROUGHENF.FOUNDINGRIDSEARCHENF.CLUSTERSHADOWSENF.BACKGROUNDENF.ANCHOREDENF.HASPARTICLESENF.INVISIBLEENF.DYNAMICSHADOWSENF.NOTIFYLEVELCHANGEENF.CROSSESLEVELSENF.PREDICTABLEENF.PREDICTORENF.PREDICTEDENF.WILLBEPREDICTEDENF.TEMPPREDICTORENF.HIDDENENF.NOSHADINGINFO
-
EPFenum - Physics flags of entities:EPF.ORIENTEDBYGRAVITYEPF.TRANSLATEDBYGRAVITYEPF.PUSHABLEEPF.STICKYFEETEPF.RT_SYNCHRONIZEDEPF.ABSOLUTETRANSLATEEPF.NOACCELERATIONEPF.HASLUNGSEPF.HASGILLSEPF.MOVABLEEPF.NOIMPACTEPF.NOIMPACTTHISTICKEPF.CANFADESPINNINGEPF.ONSTEEPSLOPEEPF.ORIENTINGTOGRAVITYEPF.FLOATINGEPF.FORCEADDED-
EPF.ONBLOCK_MASK- Mask for only one of the "on block" type values below. EPF.ONBLOCK_STOPEPF.ONBLOCK_SLIDEEPF.ONBLOCK_CLIMBORSLIDEEPF.ONBLOCK_BOUNCEEPF.ONBLOCK_PUSHEPF.ONBLOCK_STOPEXACT
-
ECBenum - Collision bits for the collision mask:ECB.COUNTECB.ISECB.TESTECB.PASS
-
ECFenum - Collision flags of entities:ECF.MASKECF.ISMASKECF.TESTMASKECF.PASSMASKECF.IGNOREBRUSHESECF.IGNOREMODELS
-
EPTenum - Types of entity properties:-
EPT.ENUM- Same asEPT.INDEXbut for specifying a value from a specific enum list. -
EPT.BOOL- Boolean value that is eithertrueorfalse. -
EPT.FLOAT- Number with a fraction (single-precision floating point). -
EPT.COLOR- Color in the 32-bit RGBA format. -
EPT.STRING- String property. -
EPT.RANGE- Same asEPT.FLOATbut for specifying radius. -
EPT.ENTITYPTR- Pointer to another entity. -
EPT.FILENAME- Path to a specific file. -
EPT.INDEX- Signed 32-bit integer value. -
EPT.ANIMATION- Same asEPT.INDEXbut for specifying an animation index of some model. -
EPT.ILLUMINATIONTYPE- Same asEPT.INDEXbut for specifying illumination type for a light source. -
EPT.FLOATAABBOX3D- Box areas. -
EPT.ANGLE- Same asEPT.FLOATbut for specifying rotation angles. -
EPT.FLOAT3D- Vector value for specifying a position in 3D space. -
EPT.ANGLE3D- Same asEPT.FLOAT3Dbut for specifying Euler angles for rotation in 3D space. -
EPT.FLOATplane3D- Plane normal definition. -
EPT.MODELOBJECT- Vertex models. -
EPT.PLACEMENT3D- Position and rotation in 3D space. -
EPT.ANIMOBJECT- Generic animatable object. -
EPT.FILENAMENODEP- Same asEPT.STRINGbut for specifying paths to files without explicit dependencies on them. -
EPT.SOUNDOBJECT- Object for playing sounds in 3D space from that entity. -
EPT.STRINGTRANS- Same asEPT.STRINGbut for translateable strings. -
EPT.FLOATQUAT3D- Quaternion rotation. -
EPT.FLOATMATRIX3D- Rotation matrix. -
EPT.FLAGS- Same asEPT.INDEXbut for specifying a bit mask of flags. -
EPT.MODELINSTANCE- SKA models. Only starting with The Second Encounter v1.07.
-
-
EVENTCODEenum - Available entity events forCEntityEventclass setup:-
EVENTCODE.EInternal- Internal entity event from the engine. -
EVENTCODE.EVoid- Default dummy entity event. -
EVENTCODE.EReturn- Internal entity event from the engine. -
EVENTCODE.EBegin- Internal entity event from the engine. -
EVENTCODE.ETimer- Internal entity event from the engine. -
EVENTCODE.ETouch- Internal entity event from the engine; usually sent whenCMovableEntitytouches another entity in its way. -
EVENTCODE.EPass- Internal entity event from the engine; usually sent whenCMovableEntitypasses through another entity in its way. -
EVENTCODE.EBlock- Internal entity event from the engine; usually sent whenCMovableEntitymovement is blocked by some other entity in its way. -
EVENTCODE.EWouldFall- Internal entity event from the engine. -
EVENTCODE.ETeleport- Internal entity event from the engine. -
EVENTCODE.EPreLevelChange- Internal entity event from the engine; sent to entities that carry over from one world to another before changing levels. -
EVENTCODE.EPostLevelChange- Internal entity event from the engine; sent to entities that carry over from one world to another after changing levels. -
EVENTCODE.EFirstWorldBase- Internal entity event from the engine. -
EVENTCODE.EDamage- Internal entity event from the engine; usually sent whenCEntityreceives damage. -
EVENTCODE.EDeath- Internal entity event from the engine; usually sent whenCLiveEntitydies. -
EVENTCODE.ETakingBreath- Internal entity event from the engine; usually sent whenCMovableEntityenters a sector it can breathe in. -
EVENTCODE.EStop- Generic entity event sent byCTrigger. -
EVENTCODE.EStart- Generic entity event sent byCTrigger. -
EVENTCODE.EActivate- Generic entity event sent byCTrigger. -
EVENTCODE.EDeactivate- Generic entity event sent byCTrigger. -
EVENTCODE.EEnvironmentStart- Generic entity event sent byCTrigger. -
EVENTCODE.EEnvironmentStop- Generic entity event sent byCTrigger. -
EVENTCODE.EEnd- Internal entity event. -
EVENTCODE.ETrigger- Generic entity event sent byCTrigger. -
EVENTCODE.ETeleportMovingBrush- Generic entity event sent byCTrigger. -
EVENTCODE.EReminder- Internal entity event sent byCReminder. -
EVENTCODE.EStartAttack- Generic entity event sent byCTrigger. -
EVENTCODE.EStopAttack- Generic entity event sent byCTrigger. -
EVENTCODE.EStopBlindness- Generic entity event sent byCTrigger. -
EVENTCODE.EStopDeafness- Generic entity event sent byCTrigger. -
EVENTCODE.EReceiveScore- ForCPlayer. -
EVENTCODE.EKilledEnemy- ForCPlayer. -
EVENTCODE.ESecretFound- ForCPlayer. -
EVENTCODE.ESound- For entities derived fromCEnemyBase. -
EVENTCODE.EScroll- ForCPlayer. -
EVENTCODE.ETextFX- ForCPlayer. -
EVENTCODE.EHudPicFX- ForCPlayer. -
EVENTCODE.ECredits- ForCPlayer. -
EVENTCODE.ECenterMessage- ForCPlayer. -
EVENTCODE.EComputerMessage- ForCPlayer. -
EVENTCODE.EVoiceMessage- ForCPlayer. -
EVENTCODE.EHitBySpaceShipBeam- ForCPlayer. -
EVENTCODE.EAmmoItem- For receiving ammo by the player. -
EVENTCODE.EAmmoPackItem- For receiving ammo packs by the player. -
EVENTCODE.EArmor- For receiving armor by the player. -
EVENTCODE.EHealth- For receiving health by the player. -
EVENTCODE.EKey- For receiving keys by the player. -
EVENTCODE.EMessageItem- For receiving messages by the player. -
EVENTCODE.EPowerUp- For receiving powerups by the player. -
EVENTCODE.EWeaponItem- For receiving weapons by the player. -
EVENTCODE.ERestartAttack- For entities derived fromCEnemyBase. -
EVENTCODE.EReconsiderBehavior- For entities derived fromCEnemyBase. -
EVENTCODE.EForceWound- For entities derived fromCEnemyBase. -
EVENTCODE.ESelectWeapon- ForCPlayerWeapons. -
EVENTCODE.EBoringWeapon- ForCPlayerWeapons. -
EVENTCODE.EFireWeapon- ForCPlayerWeapons. -
EVENTCODE.EReleaseWeapon- ForCPlayerWeapons. -
EVENTCODE.EReloadWeapon- ForCPlayerWeapons. -
EVENTCODE.EWeaponChanged- ForCPlayerWeapons. -
EVENTCODE.EAirShockwave- For initializingCAirShockwaveentities. -
EVENTCODE.EAirWave- For initializingCAirWaveentities. -
EVENTCODE.ESpawnEffect- For initializingCBasicEffectentities. -
EVENTCODE.ESpawnSpray- For initializingCBloodSprayentities. -
EVENTCODE.EBulletInit- For initializingCBulletentities. -
EVENTCODE.ELaunchCannonBall- For initializingCCannonBallentities. -
EVENTCODE.ECyborgBike- For initializingCCyborgBikeentities. -
EVENTCODE.ESpawnDebris- For initializingCDebrisentities. -
EVENTCODE.EDevilProjectile- For initializingCDevilProjectileentities. -
EVENTCODE.ESpawnEffector- For initializingCEffectorentities. -
EVENTCODE.EFlame- For initializingCFlameentities. -
EVENTCODE.ELaunchLarvaOffspring- For initializingCLarvaOffspringentities. -
EVENTCODE.EAnimatorInit- For initializingCPlayerAnimatorentities. -
EVENTCODE.EViewInit- For initializingCPlayerViewentities. -
EVENTCODE.EWeaponsInit- For initializingCPlayerWeaponsentities. -
EVENTCODE.EWeaponEffectInit- For initializingCPlayerWeaponsEffectentities. -
EVENTCODE.ELaunchProjectile- For initializingCProjectileentities. -
EVENTCODE.EReminderInit- For initializingCReminderentities. -
EVENTCODE.ESeriousBomb- For initializingCSeriousBombentities. -
EVENTCODE.ESpawnerProjectile- For initializingCSpawnerProjectileentities. -
EVENTCODE.ESpinnerInit- For initializingCSpinnerentities. -
EVENTCODE.ETwister- For initializingCTwisterentities. -
EVENTCODE.EWatcherInit- For initializingCWatcherentities. -
EVENTCODE.EWater- For initializingCWaterentities.
-
-
DMTenum - Available damage types:DMT.EXPLOSIONDMT.PROJECTILEDMT.CLOSERANGEDMT.BULLETDMT.DROWNINGDMT.IMPACTDMT.BRUSHDMT.BURNINGDMT.ACIDDMT.TELEPORTDMT.FREEZINGDMT.CANNONBALLDMT.CANNONBALL_EXPLOSIONDMT.SPIKESTABDMT.ABYSSDMT.HEATDMT.DAMAGERDMT.CHAINSAWDMT.NONE
Class for holding a pointer to a specific entity in the world.
Constructs an entity pointer instance by copying a pointer from another entity pointer. If left unspecified, creates an instance that doesn't point to any specific entity (
null).
Arguments:
-
entity(optional) - AnotherCEntityPointerto copy the pointer from.
Returns entity instance formatted as
(%s : %u)where%sis the name of the entity class and%uis the entity ID in the current world. If the entity pointer isnull, it returns(none).
Return value: string
Compares this entity pointer with another entity pointer. A helper method for the lack of the
==operator overloading.
Arguments:
-
other- AnotherCEntityPointerto compare this one with (may benull).
Return value: bool
Returns unique ID of the entity in the world.
Return value: integer
Returns current render type of the entity from the
RTenum.
Return value: integer
Returns a mask of current entity flags using flags from the
ENFenum.
Return value: integer
Returns a mask of entity spawn flags using flags from the
SPFenum.
Return value: integer
Returns a mask of current entity physics flags using flags from the
EPFenum.
Return value: integer
Returns a mask of current entity collision flags using flags from the
ECFenum.
Return value: integer
Checks whether this entity is a predictor for another entity, i.e. a "shadow copy" of the original entity used for predicting entity movement and state while playing with prediction turned on.
This function is equal to checking for its respective flag:GetFlags() & ENF.PREDICTOR.
Return value: bool
Checks whether this entity is being predicted, i.e. an original entity that currently has a "shadow copy" used for predicting its movement and state while playing with prediction turned on.
This function is equal to checking for its respective flag:GetFlags() & ENF.PREDICTED.
Return value: bool
Checks whether this entity can be predicted, i.e. able to create a "shadow copy" of itself at any point for predicting entity movement and state.
This function is equal to checking for its respective flag:GetFlags() & ENF.PREDICTABLE.
Return value: bool
Get the "shadow copy" of this original entity that's used for predicting its movement and state while playing with prediction turned on.
Return value: CEntityPointer
Get the original entity of this "shadow copy" for retrieving actual entity data instead of the predicted temporary data.
Return value: CEntityPointer
Returns radius of a sphere that surrounds the spatial classification box around the entity.
Return value: float
Returns box area of the spatial classification around the entity.
Return value: FLOATaabbox3D
Returns index of the current collision box of the current model.
Return value: integer
Returns parameters of the specified collision box of the current model entity.
Arguments:
-
collision_index- Index of the collision box to get the parameters of.
Return value: array with two elements:
-
FLOATaabbox3Dwith the collision box area around the model -
integerwith the "equality" type of the collision box (0- height equals width;1- length equals width;2- length equals height)
Returns current bounding box around the entire entity at absolute world coordinates.
Return value: FLOATaabbox3D
Returns current size of the entity as a box that encompasses it relative to the entity position.
Return value: FLOATaabbox3D
Returns the nearest possible brush polygon to this entity.
Return value: array with four elements:
-
CBrushPolygonwith the nearest polygon (may be none) -
FLOAT3Dwith the nearest point on the polygon -
FLOATplane3Dwith the normal plane of the polygon -
floatwith the distance to the point on the polygon
Returns absolute position inside the entity based on the size ratio in each direction relative to it.
Arguments:
-
ratio_vector-FLOAT3Dwith the size ratios from0.0to1.0per dimension. -
lerped(optional) - Whether to return absolute position relative to the visual placement instead of the physical placement.
Return value: FLOAT3D
Returns absolute position inside the entity based on the fixed point relative to it.
Arguments:
-
fixed_point-FLOAT3Dwith the relative point inside the entity in meters.
Return value: FLOAT3D
Searches for other entities within a certain area around this entity.
Arguments:
-
area-FLOATaabbox3Dwith the absolute area around the entity to search for entities in. -
only_colliding- Whether to only search for entities in the area that are actively colliding with this entity.
Return value: array of CEntityPointer values with all found entities in the area (may be empty)
Returns current physical placement of the entity. Can be used for entity logic.
Return value: CPlacement3D
Returns current visual placement of the entity, which is typically lerped for the current frame between the last placement and the current placement between in-game ticks. Can be used for rendering logic.
Return value: CPlacement3D
Returns pre-calculated rotation matrix based on the rotation angle of the current physical placement.
Return value: FLOATmatrix3D
Returns the current absolute viewpoint of a player entity, i.e. the position of the eyes relative to the entity.
If used on an entity that isn't derived fromCPlayerEntityclass, it throws a runtime error.
Arguments:
-
lerped(optional) - Whether to return the lerped view placement used for rendering purposes instead of the physical view placement.
Return value: CPlacement3D
Returns current physical placement of this entity relative to its parent entity. If parent entity doesn't exist, the placement value may be invalid.
Return value: CPlacement3D
Returns current parent entity of this entity (may be none).
Return value: CEntityPointer
Returns the first occurrence of a child entity of a specific class (may be none).
Arguments:
-
class_name- Name of a specific entity class to find a child entity with.
Return value: CEntityPointer
Returns the current internal name of this entity that may be changed using a specific entity property associated with it. Depending on the entity, it may be an empty string.
Important
Not to be confused with GetClassName(), which is used for retrieving the common name of the entity class that cannot be changed.
Return value: string
Returns the internal description of this entity that may be changed using a specific entity property associated with it. Depending on the entity, it may be an empty string.
Return value: string
Returns primary target of this entity that may be changed using a specific entity property associated with it, if supported (may be none).
Return value: CEntityPointer
Returns additional stretch vector for the spatial classification box of the entity. If this method isn't redefined for an entity class, it always returns
FLOAT3D(1, 1, 1).
Return value: FLOAT3D
Returns current health of a living entity.
If used on an entity that isn't derived fromCLiveEntityclass, it throws a runtime error.
Return value: float
Returns cached last physical placement of a moving entity.
If used on an entity that isn't derived fromCMovableEntityclass, it throws a runtime error.
Return value: CPlacement3D
Returns brush polygon that the moving entity is currently standing on top of (may be none).
If used on an entity that isn't derived fromCMovableEntityclass, it throws a runtime error.
Return value: CBrushPolygon
Calculates relative heading angle based on the specified direction vector. An inverse function of
GetHeadingDirection().
If used on an entity that isn't derived fromCMovableEntityclass, it throws a runtime error.
Arguments:
-
direction-FLOAT3Dwith the absolute direction vector.
Return value: float
Calculates relative pitch angle based on the specified direction vector. An inverse function of
GetPitchDirection().
If used on an entity that isn't derived fromCMovableEntityclass, it throws a runtime error.
Arguments:
-
direction-FLOAT3Dwith the absolute direction vector.
Return value: float
Calculates absolute direction vector based on the specified heading angle relative to another direction vector.
If used on an entity that isn't derived fromCMovableEntityclass, it throws a runtime error.
Arguments:
-
reference_dir-FLOAT3Dwith the reference direction. -
angle- Heading angle relative to the current entity rotation.
Return value: FLOAT3D
Calculates absolute direction vector based on the specified heading angle. An inverse function of
GetRelativeHeading().
If used on an entity that isn't derived fromCMovableEntityclass, it throws a runtime error.
Arguments:
-
angle- Heading angle relative to the current entity rotation.
Return value: FLOAT3D
Calculates absolute direction vector based on the specified pitch angle. An inverse function of
GetRelativePitch().
If used on an entity that isn't derived fromCMovableEntityclass, it throws a runtime error.
Arguments:
-
angle- Pitch angle relative to the current entity rotation.
Return value: FLOAT3D
Returns currently acceptible entity for use as an inflictor for miscellaneous damage, such as fall, heat and impact damage.
If used on an entity that isn't derived fromCMovableEntityclass, it throws a runtime error.
Return value: CEntityPointer
Checks whether the entity is currently standing on the specified brush polygon.
If used on an entity that isn't derived fromCMovableEntityclass, it throws a runtime error.
Arguments:
-
polygon-CBrushPolygonwith the polygon to check for.
Return value: bool
Checks whether the specified brush polygon is below a specific absolute point.
If used on an entity that isn't derived fromCMovableEntityclass, it throws a runtime error.
Arguments:
-
polygon-CBrushPolygonwith the polygon to check for. -
point-FLOAT3Dwith the point to check for the polygon below. -
max_distance- Maximum distance to check for the polygon.
Return value: bool
Checks whether the moving entity would be falling on the next position.
If used on an entity that isn't derived fromCMovableEntityclass, it throws a runtime error.
Return value: bool
Returns path to the ECL file that was used for creating an instance of this entity.
Return value: string
Returns internal name of the entity class that was used for creating an instance of this entity. This same name can be used when looking up or checking entities based on their generic class name.
Important
Not to be confused with GetName(), which is used for retrieving the current name of this specific entity.
Return value: string
Returns unique ID of the entity class that was used for creating an instance of this entity. This same ID can be used when looking up or checking entities based on their generic class ID.
Return value: integer
Checks whether this entity is of a specific class by its associated internal name.
Arguments:
-
class_name- Name of a generic entity class to check this entity for.
Return value: bool
Checks whether this entity is of a specific class or has been derived from that class by its associated internal name.
Arguments:
-
class_name- Name of a generic entity class to check this entity for.
Return value: bool
Checks whether this entity is of a specific class by its associated internal ID.
Arguments:
-
class_id- ID of a generic entity class to check this entity for.
Return value: bool
Checks whether this entity is of a specific class or has been derived from that class by its associated internal ID.
Arguments:
-
class_id- ID of a generic entity class to check this entity for.
Return value: bool
Checks whether this entity has been derived from
CLiveEntityclass.
Return value: bool
Checks whether this entity has been derived from
CRationalEntityclass.
Return value: bool
Looks up an entity property inside this entity's generic class based on the desired property type, its internal ID and its byte offset.
Arguments:
-
type- Desired property type from theEPTenum. -
id- Internal ID of the desired property. -
offset(optional) - Byte offset of the desired property relative to the entity class as an optional fallback in case the internal ID doesn't match.
Return value: Entities.Property
Looks up an entity property inside this entity's generic class based on the desired property type and its display name.
Arguments:
-
type- Desired property type from theEPTenum. -
name- Display name of the desired property.
Return value: Entities.Property
Looks up an entity property inside this entity's generic class based on a variable inside a C++ class describing the vanilla entity class.
Arguments:
-
class_name- Name of the C++ class to search for the property in. -
variable_name- Name of the C++ field of the specified class that's supposed to be referenced by the desired property.
Return value: Entities.Property
Returns current value of the specified entity property from this entity. Throws a runtime error if cannot return any value from the entity.
Arguments:
-
property-Entities.Propertywith the property to get the value of.
Return value: Depending on the property type: integer, bool, float, string, CEntityPointer, FLOATaabbox3D, FLOAT3D, FLOATplane3D, CPlacement3D, FLOATmatrix3D
Returns value from an entity property inside this entity's generic class based on the desired property type, its internal ID and its byte offset.
Auxiliary method for directly retrieving entity property values instead of generic property info asEntities.Property. If the property cannot be found or it's of an unsupported type, the method returnsnullinstead of throwing a runtime error.
Note
This method may be slower than GetPropInfoByID() because it has to perform a lookup of the entity property every single time it needs to retrieve a value from it instead of using existing property info stored inside an Entities.Property instance.
Arguments:
-
type- Desired property type from theEPTenum. -
id- Internal ID of the desired property. -
offset(optional) - Byte offset of the desired property relative to the entity class as an optional fallback in case the internal ID doesn't match.
Return value: null on error, otherwise depending on the property type: integer, bool, float, string, CEntityPointer, FLOATaabbox3D, FLOAT3D, FLOATplane3D, CPlacement3D, FLOATmatrix3D
Returns value from an entity property inside this entity's generic class based on the desired property type and its display name.
Auxiliary method for directly retrieving entity property values instead of generic property info asEntities.Property. If the property cannot be found or it's of an unsupported type, the method returnsnullinstead of throwing a runtime error.
Note
This method may be slower than GetPropInfoByName() because it has to perform a lookup of the entity property every single time it needs to retrieve a value from it instead of using existing property info stored inside an Entities.Property instance.
Arguments:
-
type- Desired property type from theEPTenum. -
name- Display name of the desired property.
Return value: null on error, otherwise depending on the property type: integer, bool, float, string, CEntityPointer, FLOATaabbox3D, FLOAT3D, FLOATplane3D, CPlacement3D, FLOATmatrix3D
Returns value from an entity property inside this entity's generic class based on a variable inside a C++ class describing the vanilla entity class.
Auxiliary method for directly retrieving entity property values instead of generic property info asEntities.Property. If the property cannot be found or it's of an unsupported type, the method returnsnullinstead of throwing a runtime error.
Note
This method may be slower than GetPropInfoByVariable() because it has to perform a lookup of the entity property every single time it needs to retrieve a value from it instead of using existing property info stored inside an Entities.Property instance.
Arguments:
-
class_name- Name of the C++ class to search for the property in. -
variable_name- Name of the C++ field of the specified class that's supposed to be referenced by the desired property.
Return value: null on error, otherwise depending on the property type: integer, bool, float, string, CEntityPointer, FLOATaabbox3D, FLOAT3D, FLOATplane3D, CPlacement3D, FLOATmatrix3D
These properties can only be read from entities derived from the CMovableEntity class, otherwise resulting in the runtime error.
They exist for convenience instead of having to manually look up these properties by variable name or internal ID because they are exactly the same across any entity that's derived from this engine class.
| Variable | Type | Readable | Writeable |
|---|---|---|---|
en_vDesiredTranslationRelative |
FLOAT3D |
Yes | No |
en_aDesiredRotationRelative |
FLOAT3D |
Yes | No |
en_vCurrentTranslationAbsolute |
FLOAT3D |
Yes | No |
en_aCurrentRotationAbsolute |
FLOAT3D |
Yes | No |
en_penReference |
CEntityPointer |
Yes | No |
en_vReferencePlane |
FLOAT3D |
Yes | No |
en_iReferenceSurface |
integer |
Yes | No |
en_penLastValidReference |
CEntityPointer |
Yes | No |
en_tmLastSignificantVerticalMovement |
float |
Yes | No |
en_tmLastBreathed |
float |
Yes | No |
en_tmMaxHoldBreath |
float |
Yes | No |
en_fDensity |
float |
Yes | No |
en_tmLastSwimDamage |
float |
Yes | No |
en_iUpContent |
integer |
Yes | No |
en_iDnContent |
integer |
Yes | No |
en_fImmersionFactor |
float |
Yes | No |
en_vGravityDir |
FLOAT3D |
Yes | No |
en_fGravityA |
float |
Yes | No |
en_fGravityV |
float |
Yes | No |
en_vForceDir |
FLOAT3D |
Yes | No |
en_fForceA |
float |
Yes | No |
en_fForceV |
float |
Yes | No |
en_tmJumped |
float |
Yes | No |
en_tmMaxJumpControl |
float |
Yes | No |
en_fJumpControlMultiplier |
float |
Yes | No |
en_fAcceleration |
float |
Yes | No |
en_fDeceleration |
float |
Yes | No |
en_fStepUpHeight |
float |
Yes | No |
en_fStepDnHeight |
float |
Yes | No |
en_fBounceDampParallel |
float |
Yes | No |
en_fBounceDampNormal |
float |
Yes | No |
en_fCollisionSpeedLimit |
float |
Yes | No |
en_fCollisionDamageFactor |
float |
Yes | No |
Properties that can only be read from entities derived from the CPlayerEntity class, otherwise resulting in the runtime error.
They exist for convenience instead of having to manually look up these properties by variable name or internal ID because they are exactly the same across any entity that's derived from this engine class.
| Variable | Type | Readable | Writeable |
|---|---|---|---|
en_tmPing |
float |
Yes | No |
Class for representing a single property of some entity class.
Constructs an entity property instance by copying data from another entity property. If left unspecified, creates an instance that doesn't point to any specific property (
null).
Arguments:
-
property(optional) - AnotherEntities.Propertyto copy data from.
Compares this entity property with another entity property. A helper method for the lack of the
==operator overloading.
Arguments:
-
other- AnotherEntities.Propertyto compare this one with (may benull).
Return value: bool
Returns amount of enum values for a property of the
EPT.ENUMtype, otherwise throws a runtime error.
Return value: integer
Returns an array of all possible enum values for a property of the
EPT.ENUMtype, otherwise throws a runtime error.
Return value: array of other array values (e.g. [ [999, "Invalid type"], [1, "First type"], [2, "Second type"] ]):
-
integerwith the actual index of the enum value that can be used for setting new values to this property in some entity. -
stringwith the display name of the enum value for informational purposes (may be an empty string).
Returns current value of this property from the specified instance of some entity class in the world. Throws a runtime error if cannot return any value from the entity.
Arguments:
-
entity-CEntityPointerwith the entity to get the property value from.
Return value: Depending on the property type: integer, bool, float, string, CEntityPointer, FLOATaabbox3D, FLOAT3D, FLOATplane3D, CPlacement3D, FLOATmatrix3D
Specifies the property value type from the
EPTenum. Equivalent to the engine'sCEntityProperty::ep_eptType.
| Type | Readable | Writeable |
|---|---|---|
integer |
Yes | No |
Specifies the unique internal ID of the property that contains the ID of the associated entity class in the upper 24 bits (shifted by 8 bits to the left). Equivalent to the engine's
CEntityProperty::ep_ulID.
Warning
Any property that has been declared with an ID above 255 in the entity source file clashes with the class ID and increases its value. This may introduce unintentional property clashes where some base entity class has property IDs above 255 (e.g. 260) and another class type derived from the base type has property IDs close to 0 (e.g. 4) but its class ID (e.g. 513) is just one number above the base class ID (e.g. 512). This results in the derived class having a property under the same exact internal ID as one of the properties in the base class (e.g. 131332).
| Type | Readable | Writeable |
|---|---|---|
integer |
Yes | No |
Specifies the internal byte offset of the property relative to any instance of the same entity class or any derived class types. Equivalent to the engine's
CEntityProperty::ep_slOffset.
| Type | Readable | Writeable |
|---|---|---|
integer |
Yes | No |
Specifies the display name of the property, usually seen in Serious Editor. Internal/hidden properties always have an empty string for a name. Equivalent to the engine's
CEntityProperty::ep_strName.
| Type | Readable | Writeable |
|---|---|---|
string |
Yes | No |
Specifies internal property flags. Practically unused in vanilla Serious Engine 1. Equivalent to the engine's
CEntityProperty::ep_ulFlags.
| Type | Readable | Writeable |
|---|---|---|
integer |
Yes | No |
Specifies character code used as a shortcut for switching to this property in Serious Editor. When the property has no shortcut key, the value is
0. Equivalent to the engine'sCEntityProperty::ep_chShortcut.
| Type | Readable | Writeable |
|---|---|---|
integer |
Yes | No |
Specifies the property color for special rendering in Serious Editor, such as targeting arrows of entity pointer properties. Equivalent to the engine's
CEntityProperty::ep_colColor.
| Type | Readable | Writeable |
|---|---|---|
integer |
Yes | No |
Class for setting up event with specific data for sending signals to entities.
Constructs an empty entity event instance with the specified event code. If left unspecified, defaults to the
EVoidevent.
Arguments:
-
event(optional) - AnotherCEntityEventto copy data from or an event code of a specific event type from theEVENTCODEenum.
Takes a variable amount of arguments, the values of which are set in the event sequentially. Accepted value types:
null,integer,float,bool,string,FLOAT3D,CEntityPointer.
Warning
Each passed value must have an explicit type in order to set appropriate data to the event. For example, passing an integer where a float is expected will erroneously write the bytes of the number as a C++ int (SE1 INDEX), rather than a C++ float (SE1 FLOAT).
Arguments:
-
values...- A series of different values to set as event data.
Return value: null
Creates a new entity somewhere in the world based on the class file.
Arguments:
-
class- Path to the ECL file with the class to create. -
placement-CPlacement3Dwith the place to create the new entity at.
Return value: null
Deletes the specified entity or all entities of the same class type from the world.
Arguments:
-
entity- ID of the entity to delete. -
same_class- Whether to delete all instances of the same class type instead of only the specified entity.
Return value: null
Copies the specified entity a certain amount of times. Specifying
1copy creates one new entity. Specifying0copies creates no new entities.
Arguments:
-
entity- ID of the entity to copy. -
copies- Amount of copies to make at once from0to31.
Return value: null
Sends previously set up event to the specified entity, such as
EVENTCODE.ETrigger.
Arguments:
-
entity- ID of the entity to send the event to. -
event-CEntityEventto send.
Return value: null
Makes the specified entity receive a new item based on the set up event, such as
EVENTCODE.EWeaponItem.
Arguments:
-
entity- ID of the entity to give the item to. -
event-CEntityEventwith the item to receive.
Return value: null
Initializes a new entity after its initial creation or reinitializes it after it has already been initialized.
Warning
If you are creating an internal entity (i.e. an entity that cannot be normally placed in Serious Editor), you must pass a specific initialization event into the function that it requires (such as EVENTCODE.ESeriousBomb), otherwise initializing it with the wrong event (or an empty one - EVENTCODE.EVoid), it may crash the game!
Arguments:
-
entity- ID of the entity to (re)initialize. -
event(optional) -CEntityEventwith the initialization event to use, if needed.
Return value: null
Sets new entity position in the world regardless of its rotation.
Arguments:
-
entity- ID of the entity to set the position of. -
position-FLOAT3Dwith the new position to set. -
relative- Whether to offset the entity by the specified position instead of setting new absolute position.
Return value: null
Sets new entity rotation in the world regardless of its position.
Arguments:
-
entity- ID of the entity to set the rotation of. -
rotation-FLOAT3Dwith the new rotation to set. -
relative- Whether to rotate the entity by the specified rotation instead of setting new absolute rotation.
Return value: null
Sets new entity placement in the world, taking current position and rotation into account when setting relative placement.
Arguments:
-
entity- ID of the entity to teleport. -
placement-CPlacement3Dwith the new placement to set. -
relative- Whether to offset the entity by the specified placement instead of setting new absolute placement.
Return value: null
Parents the specified entity to another entity. Setting the parent entity ID to
-1or any other invalid ID, the specified entity becomes unparented.
Arguments:
-
entity- ID of the entity to parent. -
parent_entity- ID of the parent entity to attach the specified entity to.
Return value: null
Sets new value to the specified entity property either by its display name (like in Serious Editor, e.g.
"Type") or by its internal property index (e.g.(402 << 8) + 11for vanillaCPlayerWeapons::m_iAvailableWeapons).
Arguments:
-
entity- ID of the entity to set the property value to. -
property- Identifier of the entity property either as a display name (string) or as an internal property index (integer). -
value- New property value to set asinteger,float,boolorstring.
Return value: null
Sets new health to an entity derived from the internal
CLiveEntityclass. Using this function on a non-living entity does nothing.
Arguments:
-
entity- ID of the entity to set the health to. -
health- Amount of health to set.
Return value: null
Sets new entity flags to the specified entity. Instead of setting the entire flag mask at once, it either adds or removes bits of the specified mask using the current mask.
Arguments:
-
entity- ID of the entity to set the flags to. -
flags- Entity flags to set from theENFenum. -
remove- Whether to remove the specified flags from the entity instead of adding them.
Return value: null
Sets new entity physics flags to the specified entity. Instead of setting the entire flag mask at once, it either adds or removes bits of the specified mask using the current mask.
Arguments:
-
entity- ID of the entity to set the flags to. -
flags- Entity flags to set from theEPFenum. -
remove- Whether to remove the specified flags from the entity instead of adding them.
Return value: null
Sets new entity collision flags to the specified entity. Instead of setting the entire flag mask at once, it either adds or removes bits of the specified mask using the current mask.
Arguments:
-
entity- ID of the entity to set the flags to. -
flags- Entity flags to set from theECFenum. -
remove- Whether to remove the specified flags from the entity instead of adding them.
Return value: null
Sets new current movement speed to an entity derived from the internal
CMovableEntityclass. Using this function on a non-moving entity does nothing.
Arguments:
-
entity- ID of the entity to move. -
speed_vector-FLOAT3Dwith the movement speed to set to the movable entity.
Return value: null
Sets new current rotation speed to an entity derived from the internal
CMovableEntityclass. Using this function on a non-moving entity does nothing.
Arguments:
-
entity- ID of the entity to rotate. -
speed_vector-FLOAT3Dwith the rotation speed to set to the movable entity.
Return value: null
Kicks an entity derived from the internal
CMovableEntityclass in the specified direction. Using this function on a non-moving entity does nothing.
Arguments:
-
entity- ID of the entity to give impulse to. -
speed_vector-FLOAT3Dwith the direction and speed to launch the movable entity towards.
Return value: null
Inflicts damage to a specific entity towards the specified direction.
Arguments:
-
inflictor- ID of the entity that inflicts the damage. -
target- ID of the target entity to damage. -
damage_type- Damage type from theDMTenum. -
damage- Maximum amount of damage to deal. -
hit_point-FLOAT3Dwith the absolute position of where the damage has been dealt. -
hit_direction-FLOAT3Dwith the normalized vector of the direction of the damage (e.g. the direction of the bullet towards the target).
Return value: null
Inflicts damage to all entities within the specified fall-off radius with the damage intensity decreasing further away from the hot-spot radius.
Arguments:
-
inflictor- ID of the entity that inflicts the damage. -
damage_type- Damage type from theDMTenum. -
damage- Maximum amount of damage to deal. -
center-FLOAT3Dwith the center point of the damage. -
fall_off- Fall-off distance from the center point where the damage can still be dealt. -
hot_spot- Hot-spot distance from the center point where the damage value becomes maximum.
Return value: null
Inflicts damage to all entities within the specified box area.
Arguments:
-
inflictor- ID of the entity that inflicts the damage. -
damage_type- Damage type from theDMTenum. -
damage- Maximum amount of damage to deal. -
area-FLOATaabbox3Dwith the area to deal damage within.
Return value: null
Designed and developed by Dreamy Cecil since 2022