Difference between revisions of "HPL3/SOMA/Scripting/Scripting Api/Entity"
(12 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{ScriptingStub}} | |
− | + | Have some helpful descriptions to add to this class? Edit this page and add your insight to the Wiki! | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | < | + | ==Summary== |
− | < | + | {{CodeDocSummaryTop}} |
+ | {{CodeDocSummaryItem|bool|[[#Entity_AddCollideCallback|Entity_AddCollideCallback]](const [[../../tString|tString]] &in asParentName, const [[../../tString|tString]] &in asChildName, const [[../../tString|tString]] &in asFunction)|Add a callback for when entities (objects, areas etc) collide and/or collides with the player}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_AddForce|Entity_AddForce]](const [[../../tString|tString]] &in asEntityName, const [[../../cVector3f|cVector3f]] &in avForce, bool abLocalSpace, bool abOnlyMainBody)|Adds force to the entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_AddForceFromEntity|Entity_AddForceFromEntity]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asForceEntityName, float afForce, bool abOnlyMainBody)|Adds force to the entity away from another entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_AddImpulse|Entity_AddImpulse]](const [[../../tString|tString]] &in asEntityName, const [[../../cVector3f|cVector3f]] &in avImpulse, bool abLocalSpace, bool abOnlyMainBody)|Adds an impulse to the entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_AddImpulseFromEntity|Entity_AddImpulseFromEntity]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asImpulseEntityName, float afImpulse, bool abOnlyMainBody)|Adds an impulse to the entity away from another entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_AddTorque|Entity_AddTorque]](const [[../../tString|tString]] &in asEntityName, const [[../../cVector3f|cVector3f]] &in avTorque, bool abLocalSpace, bool abOnlyMainBody)|Adds torque to an entity to provide some angular velocity}} | ||
+ | {{CodeDocSummaryItem|bool|[[#Entity_AttachToEntity|Entity_AttachToEntity]](const [[../../tString|tString]] &in asName, const [[../../tString|tString]] &in asParentName, const [[../../tString|tString]] &in asParentBodyName, bool abUseRotation, bool abSnapToParent <nowiki>=</nowiki> false, bool abLocked <nowiki>=</nowiki> false)|Attaches the entity to another entity}} | ||
+ | {{CodeDocSummaryItem|bool|[[#Entity_AttachToSocket|Entity_AttachToSocket]](const [[../../tString|tString]] &in asName, const [[../../tString|tString]] &in asParentName, const [[../../tString|tString]] &in asParentSocketName, bool abUseRotation, bool abSnapToParent <nowiki>=</nowiki> true)|Attaches the entity to another entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_CallEntityInteract|Entity_CallEntityInteract]](const [[../../tString|tString]] &in asName, const [[../../tString|tString]] &in asBodyName <nowiki>=</nowiki> "", const [[../../cVector3f|cVector3f]] &in avFocusBodyOffset <nowiki>=</nowiki> cVector3f_Zero, const [[../../tString|tString]] &in asData <nowiki>=</nowiki> "")|Calls OnInteract on the specified entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_Connect|Entity_Connect]](const [[../../tString|tString]] &in asName, const [[../../tString|tString]] &in asMainEntity, const [[../../tString|tString]] &in asConnectEntity, bool abInvertStateSent, int alStatesUsed)|Creates a connection between two entities}} | ||
+ | {{CodeDocSummaryItem|[[../../iLuxEntity|iLuxEntity]]|[[#Entity_CreateAtEntity|Entity_CreateAtEntity]](const [[../../tString|tString]] &in asNewEntityName, const [[../../tString|tString]] &in asEntityFile, const [[../../tString|tString]] &in asTargetEntityName, bool abFullGameSave)|Creates an entity at another entity}} | ||
+ | {{CodeDocSummaryItem|[[../../iLuxEntity|iLuxEntity]]|[[#Entity_CreateAtEntityExt|Entity_CreateAtEntityExt]](const [[../../tString|tString]] &in asNewEntityName, const [[../../tString|tString]] &in asEntityFile, const [[../../tString|tString]] &in asTargetEntityName, bool abFullGameSave, const [[../../cVector3f|cVector3f]] &in avScale, const [[../../cVector3f|cVector3f]] &in avOffsetPosition, const [[../../cVector3f|cVector3f]] &in avOffsetRotation, bool abLocalOffset)|Creates an entity at another entity with extra options}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_Destroy|Entity_Destroy]](const [[../../tString|tString]] &in asName)|Destroys an entity of a given name}} | ||
+ | {{CodeDocSummaryItem|bool|[[#Entity_EntityIsInFront|Entity_EntityIsInFront]](const [[../../tString|tString]] &in asTargetEntity, const [[../../tString|tString]] &in asForwardEntity)|Returns true if the specified entity is in front of the other entity}} | ||
+ | {{CodeDocSummaryItem|bool|[[#Entity_Exists|Entity_Exists]](const [[../../tString|tString]] &in asName)|Check if an entity exists in the level}} | ||
+ | {{CodeDocSummaryItem|bool|[[#Entity_Exists|Entity_Exists]]([[../../tID|tID]] aID)|Check if an entity exists in the level}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_FadeEffectBaseColor|Entity_FadeEffectBaseColor]](const [[../../tString|tString]] &in asEntityName, const [[../../cColor|cColor]] &in aColor, float afTime)|Fades the base color of the effects}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_FadeProcAnimationSpeed|Entity_FadeProcAnimationSpeed]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asAnimationName, float afSpeed, float afTime)|Fade the speed of a proc animation}} | ||
+ | {{CodeDocSummaryItem|bool|[[#Entity_GetAutoSleep|Entity_GetAutoSleep]](const [[../../tString|tString]] &in asName)|Get if an entity automatically falls asleep when it isnt active}} | ||
+ | {{CodeDocSummaryItem|[[../../cVector3f|cVector3f]]|[[#Entity_GetBodyOffset|Entity_GetBodyOffset]](const [[../../tString|tString]] &in asEntityName)|Returns the offset from centre specified in the }} | ||
+ | {{CodeDocSummaryItem|bool|[[#Entity_GetCollide|Entity_GetCollide]](const [[../../tString|tString]] &in asEntityA, const [[../../tString|tString]] &in asEntityB)|Checks for collision between two specific entities}} | ||
+ | {{CodeDocSummaryItem|[[../../cVector3f|cVector3f]]|[[#Entity_GetDeltaToEntity|Entity_GetDeltaToEntity]](const [[../../tString|tString]] &in asEntityA, const [[../../tString|tString]] &in asEntityB)|Gets the direction and distance between two entities}} | ||
+ | {{CodeDocSummaryItem|bool|[[#Entity_GetVarBool|Entity_GetVarBool]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName)|Get value of an entity boolean variable}} | ||
+ | {{CodeDocSummaryItem|[[../../cColor|cColor]]|[[#Entity_GetVarColor|Entity_GetVarColor]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName)|Get value of an entity color variable}} | ||
+ | {{CodeDocSummaryItem|float|[[#Entity_GetVarFloat|Entity_GetVarFloat]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName)|Get value of an entity float variable}} | ||
+ | {{CodeDocSummaryItem|int|[[#Entity_GetVarInt|Entity_GetVarInt]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName)|Get value of an entity integer variable}} | ||
+ | {{CodeDocSummaryItem|[[../../tString|tString]]|[[#Entity_GetVarString|Entity_GetVarString]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName)|Get value of an entity string variable}} | ||
+ | {{CodeDocSummaryItem|[[../../cVector2f|cVector2f]]|[[#Entity_GetVarVector2f|Entity_GetVarVector2f]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName)|Get value of an entity vector2f variable}} | ||
+ | {{CodeDocSummaryItem|[[../../cVector3f|cVector3f]]|[[#Entity_GetVarVector3f|Entity_GetVarVector3f]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName)|Get value of an entity vector3f variable}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_IncVarFloat|Entity_IncVarFloat]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName, float afX)|Add a value to the current value of an entity float variable}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_IncVarInt|Entity_IncVarInt]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName, int alX)|Add a value to the current value of an entity integer variable}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_IncVarVector2f|Entity_IncVarVector2f]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName, const [[../../cVector2f|cVector2f]] &in avX)|Add a value to the current value of an entity vector2f variable}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_IncVarVector3f|Entity_IncVarVector3f]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName, const [[../../cVector3f|cVector3f]] &in avX)|Add a value to the current value of an entity vector3f variable}} | ||
+ | {{CodeDocSummaryItem|bool|[[#Entity_IsActive|Entity_IsActive]](const [[../../tString|tString]] &in asName)|Get if an entity is active (visible and functioning) or not}} | ||
+ | {{CodeDocSummaryItem|bool|[[#Entity_IsInPlayerFOV|Entity_IsInPlayerFOV]](const [[../../tString|tString]] &in asEntity)|Returns true if the object is within the player's field of view}} | ||
+ | {{CodeDocSummaryItem|bool|[[#Entity_IsInteractedWith|Entity_IsInteractedWith]](const [[../../tString|tString]] &in asName)|Checks if the entity is being interacted with}} | ||
+ | {{CodeDocSummaryItem|bool|[[#Entity_IsOccluder|Entity_IsOccluder]](const [[../../tString|tString]] &in asName)|Get if an entity is an occluder}} | ||
+ | {{CodeDocSummaryItem|bool|[[#Entity_IsSleeping|Entity_IsSleeping]](const [[../../tString|tString]] &in asName)|Check if an entity is asleep}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_PlaceAtEntity|Entity_PlaceAtEntity]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asTargetEntity, const [[../../cVector3f|cVector3f]] &in avOffset <nowiki>=</nowiki> cVector3f_Zero, bool abAlignRotation <nowiki>=</nowiki> false, bool abUseEntFileCenter <nowiki>=</nowiki> false)|Places the specified entity at another entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_PlayAnimation|Entity_PlayAnimation]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asAnimation, float afFadeTime <nowiki>=</nowiki> 0.1f, bool abLoop <nowiki>=</nowiki> false, bool abPlayTransition <nowiki>=</nowiki> true, const [[../../tString|tString]] &in asCallback <nowiki>=</nowiki> "")|Plays an animation on the entity}} | ||
+ | {{CodeDocSummaryItem|bool|[[#Entity_PlayerIsInFront|Entity_PlayerIsInFront]](const [[../../tString|tString]] &in asName)|Returns true if the player is in front of the specified entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_PlayProcAnimation|Entity_PlayProcAnimation]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asAnimation, float afLength, bool abLoop <nowiki>=</nowiki> false, float afAmountFadeTime <nowiki>=</nowiki> 0.1, float afSpeedFadeTime <nowiki>=</nowiki> -1.0f)|Plays a procedural animation on the entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_Preload|Entity_Preload]](const [[../../tString|tString]] &in asEntityFile)|Preloads an entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_RemoveAllConnections|Entity_RemoveAllConnections]](const [[../../tString|tString]] &in asMainEntity)|Removes all connections on an entity}} | ||
+ | {{CodeDocSummaryItem|bool|[[#Entity_RemoveCollideCallback|Entity_RemoveCollideCallback]](const [[../../tString|tString]] &in asParentName, const [[../../tString|tString]] &in asChildName)|Remove a callback for when entities (objects, areas etc) collide and/or collide with the player}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_RemoveConnection|Entity_RemoveConnection]](const [[../../tString|tString]] &in asName, const [[../../tString|tString]] &in asMainEntity)|Removes a specific connection on an entity}} | ||
+ | {{CodeDocSummaryItem|bool|[[#Entity_RemoveEntityAttachment|Entity_RemoveEntityAttachment]](const [[../../tString|tString]] &in asName)|Removes an attachment to another entity if the entity(ies) has one}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetActive|Entity_SetActive]](const [[../../tString|tString]] &in asName, bool abActive)|Set if entity is active (visible and functioning) or not}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetAnimationMessageEventCallback|Entity_SetAnimationMessageEventCallback]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asCallbackFunc, bool abAutoRemove)|Sets a callback for the message events in the currently playing animation}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetAnimationPaused|Entity_SetAnimationPaused]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asAnimationName, bool abPaused <nowiki>=</nowiki> true)|Pause or unpause an animation on the specified entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetAnimationRelativeTimePosition|Entity_SetAnimationRelativeTimePosition]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asAnimationName, float afTimePos)|Sets the relative time position of a specific animation}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetAutoSleep|Entity_SetAutoSleep]](const [[../../tString|tString]] &in asName, bool abX)|Sets if the entity should sleep automatically when it need no updating}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetCollide|Entity_SetCollide]](const [[../../tString|tString]] &in asEntityName, bool abActive)|Turn off or on collision for all the bodies in the given entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetCollideCharacter|Entity_SetCollideCharacter]](const [[../../tString|tString]] &in asEntityName, bool abActive)|Turn off or on character collision for all the bodies in the given entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetColorMul|Entity_SetColorMul]](const [[../../tString|tString]] &in asEntityName, const [[../../cColor|cColor]] &in aColor)|Set the color mul of the entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetConnectionStateChangeCallback|Entity_SetConnectionStateChangeCallback]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asCallback)|Sets the callback for when the connection state changes on an entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetEffectBaseColor|Entity_SetEffectBaseColor]](const [[../../tString|tString]] &in asEntityName, const [[../../cColor|cColor]] &in aColor)|Sets the base color of the effects}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetEffectsActive|Entity_SetEffectsActive]](const [[../../tString|tString]] &in asEntityName, bool abActive, bool abFadeAndPlaySounds)|Activates or deactivates the effects on a entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetInteractionDisabled|Entity_SetInteractionDisabled]](const [[../../tString|tString]] &in asEntityName, bool abX)|Sets if the player can interact with an entity or not}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetIsOccluder|Entity_SetIsOccluder]](const [[../../tString|tString]] &in asName, bool abOccluder)|Set if entity is an occluder}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetMaxInteractionDistance|Entity_SetMaxInteractionDistance]](const [[../../tString|tString]] &in asEntityName, float afDistance)|Change the max interaction distance of an entity from the default/entity configured distance}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetPlayerInteractCallback|Entity_SetPlayerInteractCallback]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asCallback, bool abRemoveWhenInteracted)|Sets the callback for when the player interacts with a specific entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetPlayerLookAtCallback|Entity_SetPlayerLookAtCallback]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asCallback, bool abRemoveWhenLookedAt <nowiki>=</nowiki> true, bool abCheckCenterOfScreen <nowiki>=</nowiki> true, bool abCheckRayIntersection <nowiki>=</nowiki> true, float afMaxDistance <nowiki>=</nowiki> -1, float afCallbackDelay <nowiki>=</nowiki> 0)|Sets the callback for when the player looks at or turns away from a specific entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetProcAnimationPaused|Entity_SetProcAnimationPaused]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asAnimationName, bool abPaused <nowiki>=</nowiki> true)|Pause or unpause a procedural animation on the specified entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetProcAnimationSpeed|Entity_SetProcAnimationSpeed]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asAnimationName, float afSpeed)|Sets the speed of a proc animation}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetReflectionVisibility|Entity_SetReflectionVisibility]](const [[../../tString|tString]] &in asEntityName, bool abVisibleInReflection, bool abVisibleInWorld)|Sets whether the entity is drawn in reflections or not, and the real world or not}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetVarBool|Entity_SetVarBool]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName, bool abX)|Sets the value of an entity boolean variable}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetVarColor|Entity_SetVarColor]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName, const [[../../cColor|cColor]] &in aX)|Sets the value of an entity color variable}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetVarFloat|Entity_SetVarFloat]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName, float afX)|Sets the value of an entity variable}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetVarInt|Entity_SetVarInt]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName, int alX)|Sets the value of an entity integer variable}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetVarString|Entity_SetVarString]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName, const [[../../tString|tString]] &in asX)|Sets the value of an entity string variable}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetVarVector2f|Entity_SetVarVector2f]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName, const [[../../cVector2f|cVector2f]] &in avX)|Sets the value of an entity vector2f variable}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_SetVarVector3f|Entity_SetVarVector3f]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asVarName, const [[../../cVector3f|cVector3f]] &in avX)|Sets the value of an entity vector3f variable}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_Sleep|Entity_Sleep]](const [[../../tString|tString]] &in asName)|Forces the entity to sleep (disabling Update/PostUpdate)}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_StopAnimation|Entity_StopAnimation]](const [[../../tString|tString]] &in asEntityName)|Stops any currently playing animation on the specified entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_StopProcAnimation|Entity_StopProcAnimation]](const [[../../tString|tString]] &in asEntityName, const [[../../tString|tString]] &in asAnimation, float afFadeTime <nowiki>=</nowiki> 0.1f)|Stops a procedural animation on the specified entity}} | ||
+ | {{CodeDocSummaryItem|void|[[#Entity_WakeUp|Entity_WakeUp]](const [[../../tString|tString]] &in asName)|Forces the entity to wake up (enabling Update/PostUpdate)}} | ||
+ | {{CodeDocSummaryBottom}} | ||
− | < | + | ==Function Detail== |
+ | {{CodeDocDetailTop|Entity_AddCollideCallback}} | ||
+ | <syntaxhighlight lang="c++">bool Entity_AddCollideCallback(const tString &in asParentName, | ||
+ | const tString &in asChildName, | ||
+ | const tString &in asFunction)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Add a callback for when entities (objects, areas etc) collide and/or collides with the player.<br/>Collision include "uncolliding" (objects just stopped colliding) as well.<br/>Wildcard(s) * can be used in names to check for collisions.<br/>Syntax for callback function: bool FunctionName(const tString &in asParent, const tString &in asChild, int alState).<br/>- asParent Name of the parent entity in the collision.<br/>- asChild Name of the child entity in the collision.<br/>- alState 1 <nowiki>=</nowiki> colliding, -1 <nowiki>=</nowiki> was colliding in previous frame, not anymore.<br/>Return false <nowiki>=</nowiki> callback is removed, true <nowiki>=</nowiki> callback can trigger again.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asParentName|[[../../tString|tString]]|always "player" for player collisions, else first entity name.}} | ||
+ | {{CodeDocDetailParam|asChildName|[[../../tString|tString]]|name of the entity or second entity to check for collision.}} | ||
+ | {{CodeDocDetailParam|asFunction|[[../../tString|tString]]|name of the callback function when something collides/uncollides.}} | ||
+ | {{CodeDocDetailReturn|bool|.}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_AddForce}} | ||
+ | <syntaxhighlight lang="c++">void Entity_AddForce(const tString &in asEntityName, | ||
+ | const cVector3f &in avForce, | ||
+ | bool abLocalSpace, | ||
+ | bool abOnlyMainBody)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Adds force to the entity.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|avForce|[[../../cVector3f|cVector3f]]|force to add.}} | ||
+ | {{CodeDocDetailParam|abLocalSpace|bool|true <nowiki>=</nowiki> force is added relative to the rotation of the entity - false <nowiki>=</nowiki> force is added in world space}} | ||
+ | {{CodeDocDetailParam|abOnlyMainBody|bool|true <nowiki>=</nowiki> force is added only to the main body of the entity - false <nowiki>=</nowiki> force is added to all bodies in the entity}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_AddForceFromEntity}} | ||
+ | <syntaxhighlight lang="c++">void Entity_AddForceFromEntity(const tString &in asEntityName, | ||
+ | const tString &in asForceEntityName, | ||
+ | float afForce, | ||
+ | bool abOnlyMainBody)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Adds force to the entity away from another entity.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity to add force to. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|asForceEntityName|[[../../tString|tString]]|name of the entity to push away from.}} | ||
+ | {{CodeDocDetailParam|afForce|float|force magnitude, negative attracts the entity to the force entity.}} | ||
+ | {{CodeDocDetailParam|abOnlyMainBody|bool|true <nowiki>=</nowiki> force is added only to the main body of the entity - false <nowiki>=</nowiki> force is added to all bodies in the entity}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_AddImpulse}} | ||
+ | <syntaxhighlight lang="c++">void Entity_AddImpulse(const tString &in asEntityName, | ||
+ | const cVector3f &in avImpulse, | ||
+ | bool abLocalSpace, | ||
+ | bool abOnlyMainBody)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Adds an impulse to the entity.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|avImpulse|[[../../cVector3f|cVector3f]]|impulse to add.}} | ||
+ | {{CodeDocDetailParam|abLocalSpace|bool|true <nowiki>=</nowiki> impulse is added relative to the rotation of the entity - false <nowiki>=</nowiki> impulse is added in world space}} | ||
+ | {{CodeDocDetailParam|abOnlyMainBody|bool|true <nowiki>=</nowiki> impulse is added only to the main body of the entity - false <nowiki>=</nowiki> impulse is added to all bodies in the entity}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_AddImpulseFromEntity}} | ||
+ | <syntaxhighlight lang="c++">void Entity_AddImpulseFromEntity(const tString &in asEntityName, | ||
+ | const tString &in asImpulseEntityName, | ||
+ | float afImpulse, | ||
+ | bool abOnlyMainBody)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Adds an impulse to the entity away from another entity.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity to add impulse to. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|asImpulseEntityName|[[../../tString|tString]]|name of the entity to push away from.}} | ||
+ | {{CodeDocDetailParam|afImpulse|float|impulse magnitude, negative attracts the entity to the impulse entity.}} | ||
+ | {{CodeDocDetailParam|abOnlyMainBody|bool|true <nowiki>=</nowiki> impulse is added only to the main body of the entity - false <nowiki>=</nowiki> impulse is added to all bodies in the entity}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_AddTorque}} | ||
+ | <syntaxhighlight lang="c++">void Entity_AddTorque(const tString &in asEntityName, | ||
+ | const cVector3f &in avTorque, | ||
+ | bool abLocalSpace, | ||
+ | bool abOnlyMainBody)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Adds torque to an entity to provide some angular velocity}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity to add impulse to. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|avTorque|[[../../cVector3f|cVector3f]]|provide a vector3 for the desired direction}} | ||
+ | {{CodeDocDetailParam|abLocalSpace|bool|use local space for the entity}} | ||
+ | {{CodeDocDetailParam|abOnlyMainBody|bool|true <nowiki>=</nowiki> impulse is added only to the main body of the entity - false <nowiki>=</nowiki> impulse is added to all bodies in the entity}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_AttachToEntity}} | ||
+ | <syntaxhighlight lang="c++">bool Entity_AttachToEntity(const tString &in asName, | ||
+ | const tString &in asParentName, | ||
+ | const tString &in asParentBodyName, | ||
+ | bool abUseRotation, | ||
+ | bool abSnapToParent = false, | ||
+ | bool abLocked = false)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Attaches the entity to another entity. If already attached, it will be removed before attaching to new}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|the name of the entity to be attached to another, Wildcard(s) * are supported}} | ||
+ | {{CodeDocDetailParam|asParentName|[[../../tString|tString]]|The entity to attach to.}} | ||
+ | {{CodeDocDetailParam|asParentBodyName|[[../../tString|tString]]|the local (as it is in ent file) of the body. Use for just using the main body.}} | ||
+ | {{CodeDocDetailParam|abUseRotation|bool|if the attached entity should be rotated along witht the parent.}} | ||
+ | {{CodeDocDetailParam|abSnapToParent|bool|if the attached entity should snap to the center of the body, or if it should use its relative world position as offset}} | ||
+ | {{CodeDocDetailParam|abLocked|bool|if the attached object should be locked to the parent - fixes precision issues}} | ||
+ | {{CodeDocDetailReturn|bool|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_AttachToSocket}} | ||
+ | <syntaxhighlight lang="c++">bool Entity_AttachToSocket(const tString &in asName, | ||
+ | const tString &in asParentName, | ||
+ | const tString &in asParentSocketName, | ||
+ | bool abUseRotation, | ||
+ | bool abSnapToParent = true)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Attaches the entity to another entity. If already attached, it will be removed before attaching to new}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|the name of the entity to be attached to another, Wildcard(s) * are supported}} | ||
+ | {{CodeDocDetailParam|asParentName|[[../../tString|tString]]|The entity to attach to.}} | ||
+ | {{CodeDocDetailParam|asParentSocketName|[[../../tString|tString]]|the socket setup in the mesh or model editor. this is attached to a bone in the skeleton}} | ||
+ | {{CodeDocDetailParam|abUseRotation|bool|if the attached entity should be rotated along witht the parent.}} | ||
+ | {{CodeDocDetailParam|abSnapToParent|bool|if the attached entity should snap to the center of the socket, or if it should use its relative world position as offset}} | ||
+ | {{CodeDocDetailReturn|bool|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_CallEntityInteract}} | ||
+ | <syntaxhighlight lang="c++">void Entity_CallEntityInteract(const tString &in asName, | ||
+ | const tString &in asBodyName = "", | ||
+ | const cVector3f &in avFocusBodyOffset = cVector3f_Zero, | ||
+ | const tString &in asData = "")</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Calls OnInteract on the specified entity.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asBodyName|[[../../tString|tString]]|name of the body to interact with if "" then it's the main body.}} | ||
+ | {{CodeDocDetailParam|avFocusBodyOffset|[[../../cVector3f|cVector3f]]|focus point on the body.}} | ||
+ | {{CodeDocDetailParam|asData|[[../../tString|tString]]|optional data needed for interaction.}} | ||
+ | {{CodeDocDetailReturn|void|true if the position is in front of the entity.}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_Connect}} | ||
+ | <syntaxhighlight lang="c++">void Entity_Connect(const tString &in asName, | ||
+ | const tString &in asMainEntity, | ||
+ | const tString &in asConnectEntity, | ||
+ | bool abInvertStateSent, | ||
+ | int alStatesUsed)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Creates a connection between two entities.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|name of the connection.}} | ||
+ | {{CodeDocDetailParam|asMainEntity|[[../../tString|tString]]|the entity to add the connection to. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|asConnectEntity|[[../../tString|tString]]|the entity to connect to the main entity.}} | ||
+ | {{CodeDocDetailParam|abInvertStateSent|bool|if the state changes should be sent inverted.}} | ||
+ | {{CodeDocDetailParam|alStatesUsed|int|states sent by main entity, 0 <nowiki>=</nowiki> all states, 1 <nowiki>=</nowiki> only max, -1 <nowiki>=</nowiki> only min.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_CreateAtEntity}} | ||
+ | <syntaxhighlight lang="c++">iLuxEntity@ Entity_CreateAtEntity(const tString &in asNewEntityName, | ||
+ | const tString &in asEntityFile, | ||
+ | const tString &in asTargetEntityName, | ||
+ | bool abFullGameSave)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Creates an entity at another entity.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asNewEntityName|[[../../tString|tString]]|the name of the entity to be created.}} | ||
+ | {{CodeDocDetailParam|asEntityFile|[[../../tString|tString]]|the .ent file of the entity to be created.}} | ||
+ | {{CodeDocDetailParam|asTargetEntityName|[[../../tString|tString]]|the target entity.}} | ||
+ | {{CodeDocDetailParam|abFullGameSave|bool|if ALL properties should be saved for the created entity.}} | ||
+ | {{CodeDocDetailReturn|iLuxEntity@|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_CreateAtEntityExt}} | ||
+ | <syntaxhighlight lang="c++">iLuxEntity@ Entity_CreateAtEntityExt(const tString &in asNewEntityName, | ||
+ | const tString &in asEntityFile, | ||
+ | const tString &in asTargetEntityName, | ||
+ | bool abFullGameSave, | ||
+ | const cVector3f &in avScale, | ||
+ | const cVector3f &in avOffsetPosition, | ||
+ | const cVector3f &in avOffsetRotation, | ||
+ | bool abLocalOffset)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Creates an entity at another entity with extra options.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asNewEntityName|[[../../tString|tString]]|the name of the entity to be created.}} | ||
+ | {{CodeDocDetailParam|asEntityFile|[[../../tString|tString]]|the .ent file of the entity to be created.}} | ||
+ | {{CodeDocDetailParam|asTargetEntityName|[[../../tString|tString]]|the target entity.}} | ||
+ | {{CodeDocDetailParam|abFullGameSave|bool|if ALL properties should be saved for the created entity.}} | ||
+ | {{CodeDocDetailParam|avScale|[[../../cVector3f|cVector3f]]|the scale of the created entity, where cVector3f(1, 1, 1) is the default size.}} | ||
+ | {{CodeDocDetailParam|avOffsetPosition|[[../../cVector3f|cVector3f]]|an offset from the target object's position.}} | ||
+ | {{CodeDocDetailParam|avOffsetRotation|[[../../cVector3f|cVector3f]]|an offset from the target object's rotation.}} | ||
+ | {{CodeDocDetailParam|abLocalOffset|bool|true <nowiki>=</nowiki> offset position and rotation are relative to the target object's rotation, false <nowiki>=</nowiki> offset position and rotation are relative to the world.}} | ||
+ | {{CodeDocDetailReturn|iLuxEntity@|new iLuxEntity object.}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_Destroy}} | ||
+ | <syntaxhighlight lang="c++">void Entity_Destroy(const tString &in asName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Destroys an entity of a given name.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|the name of the entity to be destroyed, can contain wildcards to destroy multiple entities.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_EntityIsInFront}} | ||
+ | <syntaxhighlight lang="c++">bool Entity_EntityIsInFront(const tString &in asTargetEntity, | ||
+ | const tString &in asForwardEntity)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Returns true if the specified entity is in front of the other entity.<br/>The function assumes the entity's z-axis points forward. Anything less than 90<br/>degrees offset from the forward vector counts as "in front".}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asTargetEntity|[[../../tString|tString]]|name of the entity to check if in front of the other.}} | ||
+ | {{CodeDocDetailParam|asForwardEntity|[[../../tString|tString]]|name of entity which forward vector and position will be checked against.}} | ||
+ | {{CodeDocDetailReturn|bool|bool true if the target entity is in front.}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_Exists}} | ||
+ | <syntaxhighlight lang="c++">bool Entity_Exists(const tString &in asName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Check if an entity exists in the level.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|the name of the entity to search for.}} | ||
+ | {{CodeDocDetailReturn|bool|if entity exists.}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_Exists}} | ||
+ | <syntaxhighlight lang="c++">bool Entity_Exists(tID aID)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Check if an entity exists in the level.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|aID|[[../../tID|tID]]|the id of the entity to search for.}} | ||
+ | {{CodeDocDetailReturn|bool|if entity exists.}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_FadeEffectBaseColor}} | ||
+ | <syntaxhighlight lang="c++">void Entity_FadeEffectBaseColor(const tString &in asEntityName, | ||
+ | const cColor &in aColor, | ||
+ | float afTime)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Fades the base color of the effects}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the prop. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|aColor|[[../../cColor|cColor]]|the color all effects will be faded to}} | ||
+ | {{CodeDocDetailParam|afTime|float|time the fade takes.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_FadeProcAnimationSpeed}} | ||
+ | <syntaxhighlight lang="c++">void Entity_FadeProcAnimationSpeed(const tString &in asEntityName, | ||
+ | const tString &in asAnimationName, | ||
+ | float afSpeed, | ||
+ | float afTime)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Fade the speed of a proc animation.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|asAnimationName|[[../../tString|tString]]|name of the animation.}} | ||
+ | {{CodeDocDetailParam|afSpeed|float|target speed (measured in full loops per second).}} | ||
+ | {{CodeDocDetailParam|afTime|float|time to fade over.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_GetAutoSleep}} | ||
<syntaxhighlight lang="c++">bool Entity_GetAutoSleep(const tString &in asName)</syntaxhighlight> | <syntaxhighlight lang="c++">bool Entity_GetAutoSleep(const tString &in asName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Get if an entity automatically falls asleep when it isnt active}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|Name of the entity.}} | ||
+ | {{CodeDocDetailReturn|bool|if sleeping or not.}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_GetBodyOffset}} | ||
+ | <syntaxhighlight lang="c++">cVector3f Entity_GetBodyOffset(const tString &in asEntityName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Returns the offset from centre specified in the .ent file. Only works for props.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailReturn|cVector3f|the offset}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_GetCollide}} | ||
+ | <syntaxhighlight lang="c++">bool Entity_GetCollide(const tString &in asEntityA, | ||
+ | const tString &in asEntityB)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Checks for collision between two specific entities. Wildcard(s) * are NOT supported!}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityA|[[../../tString|tString]]|first entity.}} | ||
+ | {{CodeDocDetailParam|asEntityB|[[../../tString|tString]]|second entity.}} | ||
+ | {{CodeDocDetailReturn|bool|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_GetDeltaToEntity}} | ||
+ | <syntaxhighlight lang="c++">cVector3f Entity_GetDeltaToEntity(const tString &in asEntityA, | ||
+ | const tString &in asEntityB)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Gets the direction and distance between two entities}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityA|[[../../tString|tString]]|entity to calculate delta from}} | ||
+ | {{CodeDocDetailParam|asEntityB|[[../../tString|tString]]|entity to caluclate delta to}} | ||
+ | {{CodeDocDetailReturn|cVector3f|delta between the entities, delta <nowiki>=</nowiki> direction * distance <nowiki>=</nowiki> entity_b_pos - entity_a_pos}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_GetVarBool}} | ||
+ | <syntaxhighlight lang="c++">bool Entity_GetVarBool(const tString &in asEntityName, | ||
+ | const tString &in asVarName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Get value of an entity boolean variable.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the boolean variable.}} | ||
+ | {{CodeDocDetailReturn|bool|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | Get | + | {{CodeDocDetailTop|Entity_GetVarColor}} |
+ | <syntaxhighlight lang="c++">cColor Entity_GetVarColor(const tString &in asEntityName, | ||
+ | const tString &in asVarName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Get value of an entity color variable.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the color variable.}} | ||
+ | {{CodeDocDetailReturn|cColor|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_GetVarFloat}} | |
+ | <syntaxhighlight lang="c++">float Entity_GetVarFloat(const tString &in asEntityName, | ||
+ | const tString &in asVarName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Get value of an entity float variable.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the float variable.}} | ||
+ | {{CodeDocDetailReturn|float|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_GetVarInt}} | |
+ | <syntaxhighlight lang="c++">int Entity_GetVarInt(const tString &in asEntityName, | ||
+ | const tString &in asVarName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Get value of an entity integer variable.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the vector3f variable.}} | ||
+ | {{CodeDocDetailReturn|int|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_GetVarString}} | |
+ | <syntaxhighlight lang="c++">tString Entity_GetVarString(const tString &in asEntityName, | ||
+ | const tString &in asVarName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Get value of an entity string variable.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the string variable.}} | ||
+ | {{CodeDocDetailReturn|tString|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_GetVarVector2f}} | |
− | + | <syntaxhighlight lang="c++">cVector2f Entity_GetVarVector2f(const tString &in asEntityName, | |
− | + | const tString &in asVarName)</syntaxhighlight> | |
+ | {{CodeDocDetailBody|Get value of an entity vector2f variable.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the vector2f variable.}} | ||
+ | {{CodeDocDetailReturn|cVector2f|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | < | + | {{CodeDocDetailTop|Entity_GetVarVector3f}} |
− | < | + | <syntaxhighlight lang="c++">cVector3f Entity_GetVarVector3f(const tString &in asEntityName, |
+ | const tString &in asVarName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Get value of an entity vector3f variable.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the vector3f variable.}} | ||
+ | {{CodeDocDetailReturn|cVector3f|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_IncVarFloat}} | |
− | <syntaxhighlight lang="c++">void | + | <syntaxhighlight lang="c++">void Entity_IncVarFloat(const tString &in asEntityName, |
− | + | const tString &in asVarName, | |
+ | float afX)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Add a value to the current value of an entity float variable. Wildcard(s) * are supported for EntityName.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the float variable.}} | ||
+ | {{CodeDocDetailParam|afX|float|value to be added to variable.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_IncVarInt}} | |
+ | <syntaxhighlight lang="c++">void Entity_IncVarInt(const tString &in asEntityName, | ||
+ | const tString &in asVarName, | ||
+ | int alX)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Add a value to the current value of an entity integer variable. Wildcard(s) * are supported for EntityName. *}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the integer variable.}} | ||
+ | {{CodeDocDetailParam|alX|int|value to be added to variable.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_IncVarVector2f}} | |
+ | <syntaxhighlight lang="c++">void Entity_IncVarVector2f(const tString &in asEntityName, | ||
+ | const tString &in asVarName, | ||
+ | const cVector2f &in avX)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Add a value to the current value of an entity vector2f variable. Wildcard(s) * are supported for EntityName.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the vector2f variable.}} | ||
+ | {{CodeDocDetailParam|avX|[[../../cVector2f|cVector2f]]|value to be added to variable.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_IncVarVector3f}} | |
− | + | <syntaxhighlight lang="c++">void Entity_IncVarVector3f(const tString &in asEntityName, | |
+ | const tString &in asVarName, | ||
+ | const cVector3f &in avX)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Add a value to the current value of an entity vector3f variable. Wildcard(s) * are supported for EntityName.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the vector3f variable.}} | ||
+ | {{CodeDocDetailParam|avX|[[../../cVector3f|cVector3f]]|value to be added to variable.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_IsActive}} | |
+ | <syntaxhighlight lang="c++">bool Entity_IsActive(const tString &in asName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Get if an entity is active (visible and functioning) or not.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|Name of the entity.}} | ||
+ | {{CodeDocDetailReturn|bool|if active or not.}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_IsInPlayerFOV}} | |
− | + | <syntaxhighlight lang="c++">bool Entity_IsInPlayerFOV(const tString &in asEntity)</syntaxhighlight> | |
− | + | {{CodeDocDetailBody|Returns true if the object is within the player's field of view. This does not take into account line of sight.}} | |
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntity|[[../../tString|tString]]|name of the entity to check.}} | ||
+ | {{CodeDocDetailReturn|bool|true if the entity is in the player's field of view.}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_IsInteractedWith}} | |
− | < | + | <syntaxhighlight lang="c++">bool Entity_IsInteractedWith(const tString &in asName)</syntaxhighlight> |
+ | {{CodeDocDetailBody|Checks if the entity is being interacted with.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailReturn|bool|if the entity is being interacted with}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_IsOccluder}} | |
<syntaxhighlight lang="c++">bool Entity_IsOccluder(const tString &in asName)</syntaxhighlight> | <syntaxhighlight lang="c++">bool Entity_IsOccluder(const tString &in asName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Get if an entity is an occluder}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|Name of the entity.}} | ||
+ | {{CodeDocDetailReturn|bool|if entity is an occluder}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_IsSleeping}} | |
+ | <syntaxhighlight lang="c++">bool Entity_IsSleeping(const tString &in asName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Check if an entity is asleep}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|Name of the entity.}} | ||
+ | {{CodeDocDetailReturn|bool|if sleeping or not.}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | ' | + | {{CodeDocDetailTop|Entity_PlaceAtEntity}} |
+ | <syntaxhighlight lang="c++">void Entity_PlaceAtEntity(const tString &in asEntityName, | ||
+ | const tString &in asTargetEntity, | ||
+ | const cVector3f &in avOffset = cVector3f_Zero, | ||
+ | bool abAlignRotation = false, | ||
+ | bool abUseEntFileCenter = false)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Places the specified entity at another entity. Optionally aligning its rotation with the target entity.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asTargetEntity|[[../../tString|tString]]|entity to place at.}} | ||
+ | {{CodeDocDetailParam|avOffset|[[../../cVector3f|cVector3f]]|world offset from the target entity to place at.}} | ||
+ | {{CodeDocDetailParam|abAlignRotation|bool|if true the entity will be given the same rotation as the target entity.}} | ||
+ | {{CodeDocDetailParam|abUseEntFileCenter|bool|if true the entity's center specified in the ent file will be used for placement (only works for props).}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_PlayAnimation}} | |
+ | <syntaxhighlight lang="c++">void Entity_PlayAnimation(const tString &in asEntityName, | ||
+ | const tString &in asAnimation, | ||
+ | float afFadeTime = 0.1f, | ||
+ | bool abLoop = false, | ||
+ | bool abPlayTransition = true, | ||
+ | const tString &in asCallback = "")</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Plays an animation on the entity<br/>Syntax for callback function: void Func(const tString &in asEntityName, const tString &in asAnimName)}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|asAnimation|[[../../tString|tString]]|name of the animation to play.}} | ||
+ | {{CodeDocDetailParam|afFadeTime|float|time to fade in animation.}} | ||
+ | {{CodeDocDetailParam|abLoop|bool|if the animation should loop.}} | ||
+ | {{CodeDocDetailParam|abPlayTransition|bool|If a transition animation (given such exist) should be be played before.}} | ||
+ | {{CodeDocDetailParam|asCallback|[[../../tString|tString]]|(optional) name of callback function.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_PlayerIsInFront}} | |
+ | <syntaxhighlight lang="c++">bool Entity_PlayerIsInFront(const tString &in asName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Returns true if the player is in front of the specified entity.<br/>The function assumes the entity's z-axis points forward. Anything less than 90<br/>degrees offset from the forward vector counts as "in front".}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|name of the entity to check if in front of the other.}} | ||
+ | {{CodeDocDetailReturn|bool|true if the target entity is in front.}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_PlayProcAnimation}} | |
− | + | <syntaxhighlight lang="c++">void Entity_PlayProcAnimation(const tString &in asEntityName, | |
− | + | const tString &in asAnimation, | |
+ | float afLength, | ||
+ | bool abLoop = false, | ||
+ | float afAmountFadeTime = 0.1, | ||
+ | float afSpeedFadeTime = -1.0f)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Plays a procedural animation on the entity}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|asAnimation|[[../../tString|tString]]|name of the animation to play.}} | ||
+ | {{CodeDocDetailParam|afLength|float|time it takes to play the animation (can be negative to play it in reverse!)}} | ||
+ | {{CodeDocDetailParam|abLoop|bool|if the animation should loop.}} | ||
+ | {{CodeDocDetailParam|afAmountFadeTime|float|time to fade in animation.}} | ||
+ | {{CodeDocDetailParam|afSpeedFadeTime|float|time to fade in the speed of the animation (use this for looping animations to avoid skipping).}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_Preload}} | |
− | < | + | <syntaxhighlight lang="c++">void Entity_Preload(const tString &in asEntityFile)</syntaxhighlight> |
+ | {{CodeDocDetailBody|Preloads an entity}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityFile|[[../../tString|tString]]|name of the entity file to preload}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | < | + | {{CodeDocDetailTop|Entity_RemoveAllConnections}} |
− | <syntaxhighlight lang="c++">bool | + | <syntaxhighlight lang="c++">void Entity_RemoveAllConnections(const tString &in asMainEntity)</syntaxhighlight> |
+ | {{CodeDocDetailBody|Removes all connections on an entity.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asMainEntity|[[../../tString|tString]]|the entity to remove all connections on. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_RemoveCollideCallback}} | ||
+ | <syntaxhighlight lang="c++">bool Entity_RemoveCollideCallback(const tString &in asParentName, | ||
+ | const tString &in asChildName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Remove a callback for when entities (objects, areas etc) collide and/or collide with the player.<br/>Wildcard(s) * can be used in names.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asParentName|[[../../tString|tString]]|always "player" for player callbacks, else first entity name.}} | ||
+ | {{CodeDocDetailParam|asChildName|[[../../tString|tString]]|name of the entity or second entity.}} | ||
+ | {{CodeDocDetailReturn|bool|.}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_RemoveConnection}} | ||
+ | <syntaxhighlight lang="c++">void Entity_RemoveConnection(const tString &in asName, | ||
+ | const tString &in asMainEntity)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Removes a specific connection on an entity.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|name of the connection to remove.}} | ||
+ | {{CodeDocDetailParam|asMainEntity|[[../../tString|tString]]|the entity to remove the connection from. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_RemoveEntityAttachment}} | ||
+ | <syntaxhighlight lang="c++">bool Entity_RemoveEntityAttachment(const tString &in asName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Removes an attachment to another entity if the entity(ies) has one.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|the name of the entity to be no longer attached to another, Wildcard(s) * are supported}} | ||
+ | {{CodeDocDetailReturn|bool|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetActive}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetActive(const tString &in asName, | ||
+ | bool abActive)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Set if entity is active (visible and functioning) or not.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|Name of the entity, Wildcard(s) * are supported}} | ||
+ | {{CodeDocDetailParam|abActive|bool|true <nowiki>=</nowiki> entity becomes active - false <nowiki>=</nowiki> entity becomes inactive}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetAnimationMessageEventCallback}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetAnimationMessageEventCallback(const tString &in asEntityName, | ||
+ | const tString &in asCallbackFunc, | ||
+ | bool abAutoRemove)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets a callback for the message events in the currently playing animation.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|asCallbackFunc|[[../../tString|tString]]|the callback function. Syntx void Func(const tString &in asEntityName, const tString &in asAnimName, int alMessageEventID) (last arg is for future usage)}} | ||
+ | {{CodeDocDetailParam|abAutoRemove|bool|If the callback is removed once triggered.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetAnimationPaused}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetAnimationPaused(const tString &in asEntityName, | ||
+ | const tString &in asAnimationName, | ||
+ | bool abPaused = true)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Pause or unpause an animation on the specified entity.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|asAnimationName|[[../../tString|tString]]|name of the animation.}} | ||
+ | {{CodeDocDetailParam|abPaused|bool|true to pause, false to resume}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetAnimationRelativeTimePosition}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetAnimationRelativeTimePosition(const tString &in asEntityName, | ||
+ | const tString &in asAnimationName, | ||
+ | float afTimePos)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets the relative time position of a specific animation.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|asAnimationName|[[../../tString|tString]]|name of the animation.}} | ||
+ | {{CodeDocDetailParam|afTimePos|float|a value between 0 and 1, where 0 is the start of the animation and 1 is the end.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetAutoSleep}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetAutoSleep(const tString &in asName, | ||
+ | bool abX)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets if the entity should sleep automatically when it need no updating}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|Name of the entity, Wildcard(s) * are supported}} | ||
+ | {{CodeDocDetailParam|abX|bool|true <nowiki>=</nowiki> Entity will sleep automatically - false <nowiki>=</nowiki> entity will not sleep automatically}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetCollide}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetCollide(const tString &in asEntityName, | ||
+ | bool abActive)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Turn off or on collision for all the bodies in the given entity.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|abActive|bool|true <nowiki>=</nowiki> collision on, false <nowiki>=</nowiki> collision off.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetCollideCharacter}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetCollideCharacter(const tString &in asEntityName, | ||
+ | bool abActive)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Turn off or on character collision for all the bodies in the given entity.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|abActive|bool|true <nowiki>=</nowiki> collision on, false <nowiki>=</nowiki> collision off.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetColorMul}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetColorMul(const tString &in asEntityName, | ||
+ | const cColor &in aColor)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Set the color mul of the entity}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|aColor|[[../../cColor|cColor]]|color to set color mul to}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetConnectionStateChangeCallback}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetConnectionStateChangeCallback(const tString &in asEntityName, | ||
+ | const tString &in asCallback)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets the callback for when the connection state changes on an entity<br/>Syntax for callback function: void FunctionName(string &in asEntityName, int alState).}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|the name of the entity to get the callback. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|asCallback|[[../../tString|tString]]|the name of the callback function.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetEffectBaseColor}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetEffectBaseColor(const tString &in asEntityName, | ||
+ | const cColor &in aColor)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets the base color of the effects}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the prop. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|aColor|[[../../cColor|cColor]]|the color all effects will be multiplied with}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetEffectsActive}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetEffectsActive(const tString &in asEntityName, | ||
+ | bool abActive, | ||
+ | bool abFadeAndPlaySounds)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Activates or deactivates the effects on a entity.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|abActive|bool|true <nowiki>=</nowiki> activates effects - false <nowiki>=</nowiki> deactivates effects.}} | ||
+ | {{CodeDocDetailParam|abFadeAndPlaySounds|bool|if effects should fade in/out and sounds play.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetInteractionDisabled}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetInteractionDisabled(const tString &in asEntityName, | ||
+ | bool abX)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets if the player can interact with an entity or not.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity, Wildcard(s) * are supported}} | ||
+ | {{CodeDocDetailParam|abX|bool|true <nowiki>=</nowiki> interaction disabled - false <nowiki>=</nowiki> interaction enabled.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetIsOccluder}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetIsOccluder(const tString &in asName, | ||
+ | bool abOccluder)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Set if entity is an occluder}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|Name of the entity, Wildcard(s) * are supported}} | ||
+ | {{CodeDocDetailParam|abOccluder|bool|true <nowiki>=</nowiki> object is occluder}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetMaxInteractionDistance}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetMaxInteractionDistance(const tString &in asEntityName, | ||
+ | float afDistance)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Change the max interaction distance of an entity from the default/entity configured distance.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity, Wildcard(s) * are supported}} | ||
+ | {{CodeDocDetailParam|afDistance|float|distance in meters that the entity can be interacted from.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetPlayerInteractCallback}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetPlayerInteractCallback(const tString &in asEntityName, | ||
+ | const tString &in asCallback, | ||
+ | bool abRemoveWhenInteracted)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets the callback for when the player interacts with a specific entity.<br/>Syntax for callback function: void FunctionName(string &in asEntityName).}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|the name of the entity to get the callback. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|asCallback|[[../../tString|tString]]|the name of the callback function.}} | ||
+ | {{CodeDocDetailParam|abRemoveWhenInteracted|bool|if the callback should be removed after it has been called.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetPlayerLookAtCallback}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetPlayerLookAtCallback(const tString &in asEntityName, | ||
+ | const tString &in asCallback, | ||
+ | bool abRemoveWhenLookedAt = true, | ||
+ | bool abCheckCenterOfScreen = true, | ||
+ | bool abCheckRayIntersection = true, | ||
+ | float afMaxDistance = -1, | ||
+ | float afCallbackDelay = 0)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets the callback for when the player looks at or turns away from a specific entity.<br/>Syntax for callback function: void FunctionName(const tString &in asEntityName, int alState). alState is 1 if the player looks at the entity and -1 if the player stops looking.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|the name of the entity to get the callback. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|asCallback|[[../../tString|tString]]|the name of the callback function. If set to will remove a previously set callback}} | ||
+ | {{CodeDocDetailParam|abRemoveWhenLookedAt|bool|if the callback should be removed after it has been called.}} | ||
+ | {{CodeDocDetailParam|abCheckCenterOfScreen|bool|if the entity counts as looked at only when at the center of the screen.}} | ||
+ | {{CodeDocDetailParam|abCheckRayIntersection|bool|if the entity counts as looked at only if there is a clear line of sight to it. Note that this can return false negatives, especially when not checking center of screen.}} | ||
+ | {{CodeDocDetailParam|afMaxDistance|float|max distance at which the entity must be for the callback to be triggered.}} | ||
+ | {{CodeDocDetailParam|afCallbackDelay|float|time the player needs to look at the entity for the entity to trigger (in seconds).}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetProcAnimationPaused}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetProcAnimationPaused(const tString &in asEntityName, | ||
+ | const tString &in asAnimationName, | ||
+ | bool abPaused = true)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Pause or unpause a procedural animation on the specified entity.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|asAnimationName|[[../../tString|tString]]|name of the animation.}} | ||
+ | {{CodeDocDetailParam|abPaused|bool|true to pause, false to resume}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_SetProcAnimationSpeed}} | |
+ | <syntaxhighlight lang="c++">void Entity_SetProcAnimationSpeed(const tString &in asEntityName, | ||
+ | const tString &in asAnimationName, | ||
+ | float afSpeed)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets the speed of a proc animation.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|asAnimationName|[[../../tString|tString]]|name of the animation.}} | ||
+ | {{CodeDocDetailParam|afSpeed|float|speed to set.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_SetReflectionVisibility}} | |
+ | <syntaxhighlight lang="c++">void Entity_SetReflectionVisibility(const tString &in asEntityName, | ||
+ | bool abVisibleInReflection, | ||
+ | bool abVisibleInWorld)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets whether the entity is drawn in reflections or not, and the real world or not.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the prop. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|abVisibleInReflection|bool|whether the entity is drawn in reflections}} | ||
+ | {{CodeDocDetailParam|abVisibleInWorld|bool|whether the entity is drawn in the real world}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_SetVarBool}} | |
+ | <syntaxhighlight lang="c++">void Entity_SetVarBool(const tString &in asEntityName, | ||
+ | const tString &in asVarName, | ||
+ | bool abX)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets the value of an entity boolean variable. Wildcard(s) * are supported for EntityName. *}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the boolean variable.}} | ||
+ | {{CodeDocDetailParam|abX|bool|new value for the variable.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_SetVarColor}} | |
+ | <syntaxhighlight lang="c++">void Entity_SetVarColor(const tString &in asEntityName, | ||
+ | const tString &in asVarName, | ||
+ | const cColor &in aX)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets the value of an entity color variable. Wildcard(s) * are supported for EntityName. *}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the color variable.}} | ||
+ | {{CodeDocDetailParam|aX|[[../../cColor|cColor]]|new value for the variable.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_SetVarFloat}} | |
− | + | <syntaxhighlight lang="c++">void Entity_SetVarFloat(const tString &in asEntityName, | |
− | + | const tString &in asVarName, | |
+ | float afX)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets the value of an entity variable. Wildcard(s) * are supported for EntityName. *}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the string variable.}} | ||
+ | {{CodeDocDetailParam|afX|float|new value for the variable.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | < | + | {{CodeDocDetailTop|Entity_SetVarInt}} |
− | < | + | <syntaxhighlight lang="c++">void Entity_SetVarInt(const tString &in asEntityName, |
+ | const tString &in asVarName, | ||
+ | int alX)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets the value of an entity integer variable. Wildcard(s) * are supported for EntityName. *}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the integer variable.}} | ||
+ | {{CodeDocDetailParam|alX|int|new value for the variable.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_SetVarString}} | |
<syntaxhighlight lang="c++">void Entity_SetVarString(const tString &in asEntityName, | <syntaxhighlight lang="c++">void Entity_SetVarString(const tString &in asEntityName, | ||
const tString &in asVarName, | const tString &in asVarName, | ||
const tString &in asX)</syntaxhighlight> | const tString &in asX)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets the value of an entity string variable. Wildcard(s) * are supported for EntityName. *}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the string variable.}} | ||
+ | {{CodeDocDetailParam|asX|[[../../tString|tString]]|new value for the variable.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
+ | |||
+ | {{CodeDocDetailTop|Entity_SetVarVector2f}} | ||
+ | <syntaxhighlight lang="c++">void Entity_SetVarVector2f(const tString &in asEntityName, | ||
+ | const tString &in asVarName, | ||
+ | const cVector2f &in avX)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets the value of an entity vector2f variable. Wildcard(s) * are supported for EntityName. *}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the vector2f variable.}} | ||
+ | {{CodeDocDetailParam|avX|[[../../cVector2f|cVector2f]]|new value for the variable.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | Sets the value of an entity | + | {{CodeDocDetailTop|Entity_SetVarVector3f}} |
+ | <syntaxhighlight lang="c++">void Entity_SetVarVector3f(const tString &in asEntityName, | ||
+ | const tString &in asVarName, | ||
+ | const cVector3f &in avX)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Sets the value of an entity vector3f variable. Wildcard(s) * are supported for EntityName. *}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity.}} | ||
+ | {{CodeDocDetailParam|asVarName|[[../../tString|tString]]|name of the vector3f variable.}} | ||
+ | {{CodeDocDetailParam|avX|[[../../cVector3f|cVector3f]]|new value for the variable.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_Sleep}} | |
+ | <syntaxhighlight lang="c++">void Entity_Sleep(const tString &in asName)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Forces the entity to sleep (disabling Update/PostUpdate). Has no effect if it is already sleeping}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|Name of the entity, Wildcard(s) * are supported}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_StopAnimation}} | |
− | + | <syntaxhighlight lang="c++">void Entity_StopAnimation(const tString &in asEntityName)</syntaxhighlight> | |
− | + | {{CodeDocDetailBody|Stops any currently playing animation on the specified entity.}} | |
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_StopProcAnimation}} | |
+ | <syntaxhighlight lang="c++">void Entity_StopProcAnimation(const tString &in asEntityName, | ||
+ | const tString &in asAnimation, | ||
+ | float afFadeTime = 0.1f)</syntaxhighlight> | ||
+ | {{CodeDocDetailBody|Stops a procedural animation on the specified entity.}} | ||
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asEntityName|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|asAnimation|[[../../tString|tString]]|name of the entity. Wildcard(s) * are supported.}} | ||
+ | {{CodeDocDetailParam|afFadeTime|float|the time it takes to fade out.}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} | ||
− | + | {{CodeDocDetailTop|Entity_WakeUp}} | |
− | + | <syntaxhighlight lang="c++">void Entity_WakeUp(const tString &in asName)</syntaxhighlight> | |
− | + | {{CodeDocDetailBody|Forces the entity to wake up (enabling Update/PostUpdate). Has no effect if it is already awake}} | |
+ | {{CodeDocDetailParamStart}} | ||
+ | {{CodeDocDetailParam|asName|[[../../tString|tString]]|Name of the entity, Wildcard(s) * are supported}} | ||
+ | {{CodeDocDetailReturn|void|}} | ||
+ | {{CodeDocDetailBottom}} |
Latest revision as of 21:40, 24 August 2020
This page has been automatically generated, but it needs descriptions added to the various fields/functions in order to be complete. |
Have some helpful descriptions to add to this class? Edit this page and add your insight to the Wiki!
Contents
- 1 Summary
- 2 Function Detail
- 2.1 Entity_AddCollideCallback
- 2.2 Entity_AddForce
- 2.3 Entity_AddForceFromEntity
- 2.4 Entity_AddImpulse
- 2.5 Entity_AddImpulseFromEntity
- 2.6 Entity_AddTorque
- 2.7 Entity_AttachToEntity
- 2.8 Entity_AttachToSocket
- 2.9 Entity_CallEntityInteract
- 2.10 Entity_Connect
- 2.11 Entity_CreateAtEntity
- 2.12 Entity_CreateAtEntityExt
- 2.13 Entity_Destroy
- 2.14 Entity_EntityIsInFront
- 2.15 Entity_Exists
- 2.16 Entity_Exists
- 2.17 Entity_FadeEffectBaseColor
- 2.18 Entity_FadeProcAnimationSpeed
- 2.19 Entity_GetAutoSleep
- 2.20 Entity_GetBodyOffset
- 2.21 Entity_GetCollide
- 2.22 Entity_GetDeltaToEntity
- 2.23 Entity_GetVarBool
- 2.24 Entity_GetVarColor
- 2.25 Entity_GetVarFloat
- 2.26 Entity_GetVarInt
- 2.27 Entity_GetVarString
- 2.28 Entity_GetVarVector2f
- 2.29 Entity_GetVarVector3f
- 2.30 Entity_IncVarFloat
- 2.31 Entity_IncVarInt
- 2.32 Entity_IncVarVector2f
- 2.33 Entity_IncVarVector3f
- 2.34 Entity_IsActive
- 2.35 Entity_IsInPlayerFOV
- 2.36 Entity_IsInteractedWith
- 2.37 Entity_IsOccluder
- 2.38 Entity_IsSleeping
- 2.39 Entity_PlaceAtEntity
- 2.40 Entity_PlayAnimation
- 2.41 Entity_PlayerIsInFront
- 2.42 Entity_PlayProcAnimation
- 2.43 Entity_Preload
- 2.44 Entity_RemoveAllConnections
- 2.45 Entity_RemoveCollideCallback
- 2.46 Entity_RemoveConnection
- 2.47 Entity_RemoveEntityAttachment
- 2.48 Entity_SetActive
- 2.49 Entity_SetAnimationMessageEventCallback
- 2.50 Entity_SetAnimationPaused
- 2.51 Entity_SetAnimationRelativeTimePosition
- 2.52 Entity_SetAutoSleep
- 2.53 Entity_SetCollide
- 2.54 Entity_SetCollideCharacter
- 2.55 Entity_SetColorMul
- 2.56 Entity_SetConnectionStateChangeCallback
- 2.57 Entity_SetEffectBaseColor
- 2.58 Entity_SetEffectsActive
- 2.59 Entity_SetInteractionDisabled
- 2.60 Entity_SetIsOccluder
- 2.61 Entity_SetMaxInteractionDistance
- 2.62 Entity_SetPlayerInteractCallback
- 2.63 Entity_SetPlayerLookAtCallback
- 2.64 Entity_SetProcAnimationPaused
- 2.65 Entity_SetProcAnimationSpeed
- 2.66 Entity_SetReflectionVisibility
- 2.67 Entity_SetVarBool
- 2.68 Entity_SetVarColor
- 2.69 Entity_SetVarFloat
- 2.70 Entity_SetVarInt
- 2.71 Entity_SetVarString
- 2.72 Entity_SetVarVector2f
- 2.73 Entity_SetVarVector3f
- 2.74 Entity_Sleep
- 2.75 Entity_StopAnimation
- 2.76 Entity_StopProcAnimation
- 2.77 Entity_WakeUp
Summary
Return Type | Function and Description |
---|---|
bool | Entity_AddCollideCallback(const tString &in asParentName, const tString &in asChildName, const tString &in asFunction) Add a callback for when entities (objects, areas etc) collide and/or collides with the player |
void | Entity_AddForce(const tString &in asEntityName, const cVector3f &in avForce, bool abLocalSpace, bool abOnlyMainBody) Adds force to the entity |
void | Entity_AddForceFromEntity(const tString &in asEntityName, const tString &in asForceEntityName, float afForce, bool abOnlyMainBody) Adds force to the entity away from another entity |
void | Entity_AddImpulse(const tString &in asEntityName, const cVector3f &in avImpulse, bool abLocalSpace, bool abOnlyMainBody) Adds an impulse to the entity |
void | Entity_AddImpulseFromEntity(const tString &in asEntityName, const tString &in asImpulseEntityName, float afImpulse, bool abOnlyMainBody) Adds an impulse to the entity away from another entity |
void | Entity_AddTorque(const tString &in asEntityName, const cVector3f &in avTorque, bool abLocalSpace, bool abOnlyMainBody) Adds torque to an entity to provide some angular velocity |
bool | Entity_AttachToEntity(const tString &in asName, const tString &in asParentName, const tString &in asParentBodyName, bool abUseRotation, bool abSnapToParent = false, bool abLocked = false) Attaches the entity to another entity |
bool | Entity_AttachToSocket(const tString &in asName, const tString &in asParentName, const tString &in asParentSocketName, bool abUseRotation, bool abSnapToParent = true) Attaches the entity to another entity |
void | Entity_CallEntityInteract(const tString &in asName, const tString &in asBodyName = "", const cVector3f &in avFocusBodyOffset = cVector3f_Zero, const tString &in asData = "") Calls OnInteract on the specified entity |
void | Entity_Connect(const tString &in asName, const tString &in asMainEntity, const tString &in asConnectEntity, bool abInvertStateSent, int alStatesUsed) Creates a connection between two entities |
iLuxEntity | Entity_CreateAtEntity(const tString &in asNewEntityName, const tString &in asEntityFile, const tString &in asTargetEntityName, bool abFullGameSave) Creates an entity at another entity |
iLuxEntity | Entity_CreateAtEntityExt(const tString &in asNewEntityName, const tString &in asEntityFile, const tString &in asTargetEntityName, bool abFullGameSave, const cVector3f &in avScale, const cVector3f &in avOffsetPosition, const cVector3f &in avOffsetRotation, bool abLocalOffset) Creates an entity at another entity with extra options |
void | Entity_Destroy(const tString &in asName) Destroys an entity of a given name |
bool | Entity_EntityIsInFront(const tString &in asTargetEntity, const tString &in asForwardEntity) Returns true if the specified entity is in front of the other entity |
bool | Entity_Exists(const tString &in asName) Check if an entity exists in the level |
bool | Entity_Exists(tID aID) Check if an entity exists in the level |
void | Entity_FadeEffectBaseColor(const tString &in asEntityName, const cColor &in aColor, float afTime) Fades the base color of the effects |
void | Entity_FadeProcAnimationSpeed(const tString &in asEntityName, const tString &in asAnimationName, float afSpeed, float afTime) Fade the speed of a proc animation |
bool | Entity_GetAutoSleep(const tString &in asName) Get if an entity automatically falls asleep when it isnt active |
cVector3f | Entity_GetBodyOffset(const tString &in asEntityName) Returns the offset from centre specified in the |
bool | Entity_GetCollide(const tString &in asEntityA, const tString &in asEntityB) Checks for collision between two specific entities |
cVector3f | Entity_GetDeltaToEntity(const tString &in asEntityA, const tString &in asEntityB) Gets the direction and distance between two entities |
bool | Entity_GetVarBool(const tString &in asEntityName, const tString &in asVarName) Get value of an entity boolean variable |
cColor | Entity_GetVarColor(const tString &in asEntityName, const tString &in asVarName) Get value of an entity color variable |
float | Entity_GetVarFloat(const tString &in asEntityName, const tString &in asVarName) Get value of an entity float variable |
int | Entity_GetVarInt(const tString &in asEntityName, const tString &in asVarName) Get value of an entity integer variable |
tString | Entity_GetVarString(const tString &in asEntityName, const tString &in asVarName) Get value of an entity string variable |
cVector2f | Entity_GetVarVector2f(const tString &in asEntityName, const tString &in asVarName) Get value of an entity vector2f variable |
cVector3f | Entity_GetVarVector3f(const tString &in asEntityName, const tString &in asVarName) Get value of an entity vector3f variable |
void | Entity_IncVarFloat(const tString &in asEntityName, const tString &in asVarName, float afX) Add a value to the current value of an entity float variable |
void | Entity_IncVarInt(const tString &in asEntityName, const tString &in asVarName, int alX) Add a value to the current value of an entity integer variable |
void | Entity_IncVarVector2f(const tString &in asEntityName, const tString &in asVarName, const cVector2f &in avX) Add a value to the current value of an entity vector2f variable |
void | Entity_IncVarVector3f(const tString &in asEntityName, const tString &in asVarName, const cVector3f &in avX) Add a value to the current value of an entity vector3f variable |
bool | Entity_IsActive(const tString &in asName) Get if an entity is active (visible and functioning) or not |
bool | Entity_IsInPlayerFOV(const tString &in asEntity) Returns true if the object is within the player's field of view |
bool | Entity_IsInteractedWith(const tString &in asName) Checks if the entity is being interacted with |
bool | Entity_IsOccluder(const tString &in asName) Get if an entity is an occluder |
bool | Entity_IsSleeping(const tString &in asName) Check if an entity is asleep |
void | Entity_PlaceAtEntity(const tString &in asEntityName, const tString &in asTargetEntity, const cVector3f &in avOffset = cVector3f_Zero, bool abAlignRotation = false, bool abUseEntFileCenter = false) Places the specified entity at another entity |
void | Entity_PlayAnimation(const tString &in asEntityName, const tString &in asAnimation, float afFadeTime = 0.1f, bool abLoop = false, bool abPlayTransition = true, const tString &in asCallback = "") Plays an animation on the entity |
bool | Entity_PlayerIsInFront(const tString &in asName) Returns true if the player is in front of the specified entity |
void | Entity_PlayProcAnimation(const tString &in asEntityName, const tString &in asAnimation, float afLength, bool abLoop = false, float afAmountFadeTime = 0.1, float afSpeedFadeTime = -1.0f) Plays a procedural animation on the entity |
void | Entity_Preload(const tString &in asEntityFile) Preloads an entity |
void | Entity_RemoveAllConnections(const tString &in asMainEntity) Removes all connections on an entity |
bool | Entity_RemoveCollideCallback(const tString &in asParentName, const tString &in asChildName) Remove a callback for when entities (objects, areas etc) collide and/or collide with the player |
void | Entity_RemoveConnection(const tString &in asName, const tString &in asMainEntity) Removes a specific connection on an entity |
bool | Entity_RemoveEntityAttachment(const tString &in asName) Removes an attachment to another entity if the entity(ies) has one |
void | Entity_SetActive(const tString &in asName, bool abActive) Set if entity is active (visible and functioning) or not |
void | Entity_SetAnimationMessageEventCallback(const tString &in asEntityName, const tString &in asCallbackFunc, bool abAutoRemove) Sets a callback for the message events in the currently playing animation |
void | Entity_SetAnimationPaused(const tString &in asEntityName, const tString &in asAnimationName, bool abPaused = true) Pause or unpause an animation on the specified entity |
void | Entity_SetAnimationRelativeTimePosition(const tString &in asEntityName, const tString &in asAnimationName, float afTimePos) Sets the relative time position of a specific animation |
void | Entity_SetAutoSleep(const tString &in asName, bool abX) Sets if the entity should sleep automatically when it need no updating |
void | Entity_SetCollide(const tString &in asEntityName, bool abActive) Turn off or on collision for all the bodies in the given entity |
void | Entity_SetCollideCharacter(const tString &in asEntityName, bool abActive) Turn off or on character collision for all the bodies in the given entity |
void | Entity_SetColorMul(const tString &in asEntityName, const cColor &in aColor) Set the color mul of the entity |
void | Entity_SetConnectionStateChangeCallback(const tString &in asEntityName, const tString &in asCallback) Sets the callback for when the connection state changes on an entity |
void | Entity_SetEffectBaseColor(const tString &in asEntityName, const cColor &in aColor) Sets the base color of the effects |
void | Entity_SetEffectsActive(const tString &in asEntityName, bool abActive, bool abFadeAndPlaySounds) Activates or deactivates the effects on a entity |
void | Entity_SetInteractionDisabled(const tString &in asEntityName, bool abX) Sets if the player can interact with an entity or not |
void | Entity_SetIsOccluder(const tString &in asName, bool abOccluder) Set if entity is an occluder |
void | Entity_SetMaxInteractionDistance(const tString &in asEntityName, float afDistance) Change the max interaction distance of an entity from the default/entity configured distance |
void | Entity_SetPlayerInteractCallback(const tString &in asEntityName, const tString &in asCallback, bool abRemoveWhenInteracted) Sets the callback for when the player interacts with a specific entity |
void | Entity_SetPlayerLookAtCallback(const tString &in asEntityName, const tString &in asCallback, bool abRemoveWhenLookedAt = true, bool abCheckCenterOfScreen = true, bool abCheckRayIntersection = true, float afMaxDistance = -1, float afCallbackDelay = 0) Sets the callback for when the player looks at or turns away from a specific entity |
void | Entity_SetProcAnimationPaused(const tString &in asEntityName, const tString &in asAnimationName, bool abPaused = true) Pause or unpause a procedural animation on the specified entity |
void | Entity_SetProcAnimationSpeed(const tString &in asEntityName, const tString &in asAnimationName, float afSpeed) Sets the speed of a proc animation |
void | Entity_SetReflectionVisibility(const tString &in asEntityName, bool abVisibleInReflection, bool abVisibleInWorld) Sets whether the entity is drawn in reflections or not, and the real world or not |
void | Entity_SetVarBool(const tString &in asEntityName, const tString &in asVarName, bool abX) Sets the value of an entity boolean variable |
void | Entity_SetVarColor(const tString &in asEntityName, const tString &in asVarName, const cColor &in aX) Sets the value of an entity color variable |
void | Entity_SetVarFloat(const tString &in asEntityName, const tString &in asVarName, float afX) Sets the value of an entity variable |
void | Entity_SetVarInt(const tString &in asEntityName, const tString &in asVarName, int alX) Sets the value of an entity integer variable |
void | Entity_SetVarString(const tString &in asEntityName, const tString &in asVarName, const tString &in asX) Sets the value of an entity string variable |
void | Entity_SetVarVector2f(const tString &in asEntityName, const tString &in asVarName, const cVector2f &in avX) Sets the value of an entity vector2f variable |
void | Entity_SetVarVector3f(const tString &in asEntityName, const tString &in asVarName, const cVector3f &in avX) Sets the value of an entity vector3f variable |
void | Entity_Sleep(const tString &in asName) Forces the entity to sleep (disabling Update/PostUpdate) |
void | Entity_StopAnimation(const tString &in asEntityName) Stops any currently playing animation on the specified entity |
void | Entity_StopProcAnimation(const tString &in asEntityName, const tString &in asAnimation, float afFadeTime = 0.1f) Stops a procedural animation on the specified entity |
void | Entity_WakeUp(const tString &in asName) Forces the entity to wake up (enabling Update/PostUpdate) |
Function Detail
Entity_AddCollideCallback
bool Entity_AddCollideCallback(const tString &in asParentName,
const tString &in asChildName,
const tString &in asFunction)
Add a callback for when entities (objects, areas etc) collide and/or collides with the player.
Collision include "uncolliding" (objects just stopped colliding) as well.
Wildcard(s) * can be used in names to check for collisions.
Syntax for callback function: bool FunctionName(const tString &in asParent, const tString &in asChild, int alState).
- asParent Name of the parent entity in the collision.
- asChild Name of the child entity in the collision.
- alState 1 = colliding, -1 = was colliding in previous frame, not anymore.
Return false = callback is removed, true = callback can trigger again.
Parameters
- asParentName (tString) — always "player" for player collisions, else first entity name.
- asChildName (tString) — name of the entity or second entity to check for collision.
- asFunction (tString) — name of the callback function when something collides/uncollides.
Returns:
- bool—.
Entity_AddForce
void Entity_AddForce(const tString &in asEntityName,
const cVector3f &in avForce,
bool abLocalSpace,
bool abOnlyMainBody)
Adds force to the entity.
Parameters
- asEntityName (tString) — name of the entity. Wildcard(s) * are supported.
- avForce (cVector3f) — force to add.
- abLocalSpace (bool) — true = force is added relative to the rotation of the entity - false = force is added in world space
- abOnlyMainBody (bool) — true = force is added only to the main body of the entity - false = force is added to all bodies in the entity
Returns:
- void
Entity_AddForceFromEntity
void Entity_AddForceFromEntity(const tString &in asEntityName,
const tString &in asForceEntityName,
float afForce,
bool abOnlyMainBody)
Adds force to the entity away from another entity.
Parameters
- asEntityName (tString) — name of the entity to add force to. Wildcard(s) * are supported.
- asForceEntityName (tString) — name of the entity to push away from.
- afForce (float) — force magnitude, negative attracts the entity to the force entity.
- abOnlyMainBody (bool) — true = force is added only to the main body of the entity - false = force is added to all bodies in the entity
Returns:
- void
Entity_AddImpulse
void Entity_AddImpulse(const tString &in asEntityName,
const cVector3f &in avImpulse,
bool abLocalSpace,
bool abOnlyMainBody)
Adds an impulse to the entity.
Parameters
- asEntityName (tString) — name of the entity. Wildcard(s) * are supported.
- avImpulse (cVector3f) — impulse to add.
- abLocalSpace (bool) — true = impulse is added relative to the rotation of the entity - false = impulse is added in world space
- abOnlyMainBody (bool) — true = impulse is added only to the main body of the entity - false = impulse is added to all bodies in the entity
Returns:
- void
Entity_AddImpulseFromEntity
void Entity_AddImpulseFromEntity(const tString &in asEntityName,
const tString &in asImpulseEntityName,
float afImpulse,
bool abOnlyMainBody)
Adds an impulse to the entity away from another entity.
Parameters
- asEntityName (tString) — name of the entity to add impulse to. Wildcard(s) * are supported.
- asImpulseEntityName (tString) — name of the entity to push away from.
- afImpulse (float) — impulse magnitude, negative attracts the entity to the impulse entity.
- abOnlyMainBody (bool) — true = impulse is added only to the main body of the entity - false = impulse is added to all bodies in the entity
Returns:
- void
Entity_AddTorque
void Entity_AddTorque(const tString &in asEntityName,
const cVector3f &in avTorque,
bool abLocalSpace,
bool abOnlyMainBody)
Adds torque to an entity to provide some angular velocity
Parameters
- asEntityName (tString) — name of the entity to add impulse to. Wildcard(s) * are supported.
- avTorque (cVector3f) — provide a vector3 for the desired direction
- abLocalSpace (bool) — use local space for the entity
- abOnlyMainBody (bool) — true = impulse is added only to the main body of the entity - false = impulse is added to all bodies in the entity
Returns:
- void
Entity_AttachToEntity
bool Entity_AttachToEntity(const tString &in asName,
const tString &in asParentName,
const tString &in asParentBodyName,
bool abUseRotation,
bool abSnapToParent = false,
bool abLocked = false)
Attaches the entity to another entity. If already attached, it will be removed before attaching to new
Parameters
- asName (tString) — the name of the entity to be attached to another, Wildcard(s) * are supported
- asParentName (tString) — The entity to attach to.
- asParentBodyName (tString) — the local (as it is in ent file) of the body. Use for just using the main body.
- abUseRotation (bool) — if the attached entity should be rotated along witht the parent.
- abSnapToParent (bool) — if the attached entity should snap to the center of the body, or if it should use its relative world position as offset
- abLocked (bool) — if the attached object should be locked to the parent - fixes precision issues
Returns:
- bool—
Entity_AttachToSocket
bool Entity_AttachToSocket(const tString &in asName,
const tString &in asParentName,
const tString &in asParentSocketName,
bool abUseRotation,
bool abSnapToParent = true)
Attaches the entity to another entity. If already attached, it will be removed before attaching to new
Parameters
- asName (tString) — the name of the entity to be attached to another, Wildcard(s) * are supported
- asParentName (tString) — The entity to attach to.
- asParentSocketName (tString) — the socket setup in the mesh or model editor. this is attached to a bone in the skeleton
- abUseRotation (bool) — if the attached entity should be rotated along witht the parent.
- abSnapToParent (bool) — if the attached entity should snap to the center of the socket, or if it should use its relative world position as offset
Returns:
- bool—
Entity_CallEntityInteract
void Entity_CallEntityInteract(const tString &in asName,
const tString &in asBodyName = "",
const cVector3f &in avFocusBodyOffset = cVector3f_Zero,
const tString &in asData = "")
Calls OnInteract on the specified entity.
Parameters
- asName (tString) — name of the entity.
- asBodyName (tString) — name of the body to interact with if "" then it's the main body.
- avFocusBodyOffset (cVector3f) — focus point on the body.
- asData (tString) — optional data needed for interaction.
Returns:
- voidtrue if the position is in front of the entity.
Entity_Connect
void Entity_Connect(const tString &in asName,
const tString &in asMainEntity,
const tString &in asConnectEntity,
bool abInvertStateSent,
int alStatesUsed)
Creates a connection between two entities.
Parameters
- asName (tString) — name of the connection.
- asMainEntity (tString) — the entity to add the connection to. Wildcard(s) * are supported.
- asConnectEntity (tString) — the entity to connect to the main entity.
- abInvertStateSent (bool) — if the state changes should be sent inverted.
- alStatesUsed (int) — states sent by main entity, 0 = all states, 1 = only max, -1 = only min.
Returns:
- void
Entity_CreateAtEntity
iLuxEntity@ Entity_CreateAtEntity(const tString &in asNewEntityName,
const tString &in asEntityFile,
const tString &in asTargetEntityName,
bool abFullGameSave)
Creates an entity at another entity.
Parameters
- asNewEntityName (tString) — the name of the entity to be created.
- asEntityFile (tString) — the .ent file of the entity to be created.
- asTargetEntityName (tString) — the target entity.
- abFullGameSave (bool) — if ALL properties should be saved for the created entity.
Returns:
- iLuxEntity@—
Entity_CreateAtEntityExt
iLuxEntity@ Entity_CreateAtEntityExt(const tString &in asNewEntityName,
const tString &in asEntityFile,
const tString &in asTargetEntityName,
bool abFullGameSave,
const cVector3f &in avScale,
const cVector3f &in avOffsetPosition,
const cVector3f &in avOffsetRotation,
bool abLocalOffset)
Creates an entity at another entity with extra options.
Parameters
- asNewEntityName (tString) — the name of the entity to be created.
- asEntityFile (tString) — the .ent file of the entity to be created.
- asTargetEntityName (tString) — the target entity.
- abFullGameSave (bool) — if ALL properties should be saved for the created entity.
- avScale (cVector3f) — the scale of the created entity, where cVector3f(1, 1, 1) is the default size.
- avOffsetPosition (cVector3f) — an offset from the target object's position.
- avOffsetRotation (cVector3f) — an offset from the target object's rotation.
- abLocalOffset (bool) — true = offset position and rotation are relative to the target object's rotation, false = offset position and rotation are relative to the world.
Returns:
- iLuxEntity@—new iLuxEntity object.
Entity_Destroy
void Entity_Destroy(const tString &in asName)
Destroys an entity of a given name.
Parameters
- asName (tString) — the name of the entity to be destroyed, can contain wildcards to destroy multiple entities.
Returns:
- void
Entity_EntityIsInFront
bool Entity_EntityIsInFront(const tString &in asTargetEntity,
const tString &in asForwardEntity)
Returns true if the specified entity is in front of the other entity.
The function assumes the entity's z-axis points forward. Anything less than 90
degrees offset from the forward vector counts as "in front".
Parameters
- asTargetEntity (tString) — name of the entity to check if in front of the other.
- asForwardEntity (tString) — name of entity which forward vector and position will be checked against.
Returns:
- bool—bool true if the target entity is in front.
Entity_Exists
bool Entity_Exists(const tString &in asName)
Check if an entity exists in the level.
Parameters
- asName (tString) — the name of the entity to search for.
Returns:
- bool—if entity exists.
Entity_Exists
bool Entity_Exists(tID aID)
Check if an entity exists in the level.
Parameters
- aID (tID) — the id of the entity to search for.
Returns:
- bool—if entity exists.
Entity_FadeEffectBaseColor
void Entity_FadeEffectBaseColor(const tString &in asEntityName,
const cColor &in aColor,
float afTime)
Fades the base color of the effects
Parameters
- asEntityName (tString) — name of the prop. Wildcard(s) * are supported.
- aColor (cColor) — the color all effects will be faded to
- afTime (float) — time the fade takes.
Returns:
- void
Entity_FadeProcAnimationSpeed
void Entity_FadeProcAnimationSpeed(const tString &in asEntityName,
const tString &in asAnimationName,
float afSpeed,
float afTime)
Fade the speed of a proc animation.
Parameters
- asEntityName (tString) — name of the entity. Wildcard(s) * are supported.
- asAnimationName (tString) — name of the animation.
- afSpeed (float) — target speed (measured in full loops per second).
- afTime (float) — time to fade over.
Returns:
- void
Entity_GetAutoSleep
bool Entity_GetAutoSleep(const tString &in asName)
Get if an entity automatically falls asleep when it isnt active
Parameters
- asName (tString) — Name of the entity.
Returns:
- bool—if sleeping or not.
Entity_GetBodyOffset
cVector3f Entity_GetBodyOffset(const tString &in asEntityName)
Returns the offset from centre specified in the .ent file. Only works for props.
Parameters
- asEntityName (tString) — name of the entity.
Returns:
- cVector3f—the offset
Entity_GetCollide
Entity_GetDeltaToEntity
cVector3f Entity_GetDeltaToEntity(const tString &in asEntityA,
const tString &in asEntityB)
Gets the direction and distance between two entities
Parameters
- asEntityA (tString) — entity to calculate delta from
- asEntityB (tString) — entity to caluclate delta to
Returns:
- cVector3f—delta between the entities, delta = direction * distance = entity_b_pos - entity_a_pos
Entity_GetVarBool
Entity_GetVarColor
Entity_GetVarFloat
Entity_GetVarInt
Entity_GetVarString
Entity_GetVarVector2f
Entity_GetVarVector3f
Entity_IncVarFloat
void Entity_IncVarFloat(const tString &in asEntityName,
const tString &in asVarName,
float afX)
Add a value to the current value of an entity float variable. Wildcard(s) * are supported for EntityName.
Parameters
- asEntityName (tString) — name of the entity.
- asVarName (tString) — name of the float variable.
- afX (float) — value to be added to variable.
Returns:
- void
Entity_IncVarInt
void Entity_IncVarInt(const tString &in asEntityName,
const tString &in asVarName,
int alX)
Add a value to the current value of an entity integer variable. Wildcard(s) * are supported for EntityName. *
Parameters
- asEntityName (tString) — name of the entity.
- asVarName (tString) — name of the integer variable.
- alX (int) — value to be added to variable.
Returns:
- void
Entity_IncVarVector2f
void Entity_IncVarVector2f(const tString &in asEntityName,
const tString &in asVarName,
const cVector2f &in avX)
Add a value to the current value of an entity vector2f variable. Wildcard(s) * are supported for EntityName.
Parameters
- asEntityName (tString) — name of the entity.
- asVarName (tString) — name of the vector2f variable.
- avX (cVector2f) — value to be added to variable.
Returns:
- void
Entity_IncVarVector3f
void Entity_IncVarVector3f(const tString &in asEntityName,
const tString &in asVarName,
const cVector3f &in avX)
Add a value to the current value of an entity vector3f variable. Wildcard(s) * are supported for EntityName.
Parameters
- asEntityName (tString) — name of the entity.
- asVarName (tString) — name of the vector3f variable.
- avX (cVector3f) — value to be added to variable.
Returns:
- void
Entity_IsActive
bool Entity_IsActive(const tString &in asName)
Get if an entity is active (visible and functioning) or not.
Parameters
- asName (tString) — Name of the entity.
Returns:
- bool—if active or not.
Entity_IsInPlayerFOV
bool Entity_IsInPlayerFOV(const tString &in asEntity)
Returns true if the object is within the player's field of view. This does not take into account line of sight.
Parameters
- asEntity (tString) — name of the entity to check.
Returns:
- bool—true if the entity is in the player's field of view.
Entity_IsInteractedWith
bool Entity_IsInteractedWith(const tString &in asName)
Checks if the entity is being interacted with.
Parameters
- asName (tString) — name of the entity.
Returns:
- bool—if the entity is being interacted with
Entity_IsOccluder
bool Entity_IsOccluder(const tString &in asName)
Get if an entity is an occluder
Parameters
- asName (tString) — Name of the entity.
Returns:
- bool—if entity is an occluder
Entity_IsSleeping
bool Entity_IsSleeping(const tString &in asName)
Check if an entity is asleep
Parameters
- asName (tString) — Name of the entity.
Returns:
- bool—if sleeping or not.
Entity_PlaceAtEntity
void Entity_PlaceAtEntity(const tString &in asEntityName,
const tString &in asTargetEntity,
const cVector3f &in avOffset = cVector3f_Zero,
bool abAlignRotation = false,
bool abUseEntFileCenter = false)
Places the specified entity at another entity. Optionally aligning its rotation with the target entity.
Parameters
- asEntityName (tString) — name of the entity.
- asTargetEntity (tString) — entity to place at.
- avOffset (cVector3f) — world offset from the target entity to place at.
- abAlignRotation (bool) — if true the entity will be given the same rotation as the target entity.
- abUseEntFileCenter (bool) — if true the entity's center specified in the ent file will be used for placement (only works for props).
Returns:
- void
Entity_PlayAnimation
void Entity_PlayAnimation(const tString &in asEntityName,
const tString &in asAnimation,
float afFadeTime = 0.1f,
bool abLoop = false,
bool abPlayTransition = true,
const tString &in asCallback = "")
Plays an animation on the entity
Syntax for callback function: void Func(const tString &in asEntityName, const tString &in asAnimName)
Parameters
- asEntityName (tString) — name of the entity. Wildcard(s) * are supported.
- asAnimation (tString) — name of the animation to play.
- afFadeTime (float) — time to fade in animation.
- abLoop (bool) — if the animation should loop.
- abPlayTransition (bool) — If a transition animation (given such exist) should be be played before.
- asCallback (tString) — (optional) name of callback function.
Returns:
- void
Entity_PlayerIsInFront
bool Entity_PlayerIsInFront(const tString &in asName)
Returns true if the player is in front of the specified entity.
The function assumes the entity's z-axis points forward. Anything less than 90
degrees offset from the forward vector counts as "in front".
Parameters
- asName (tString) — name of the entity to check if in front of the other.
Returns:
- bool—true if the target entity is in front.
Entity_PlayProcAnimation
void Entity_PlayProcAnimation(const tString &in asEntityName,
const tString &in asAnimation,
float afLength,
bool abLoop = false,
float afAmountFadeTime = 0.1,
float afSpeedFadeTime = -1.0f)
Plays a procedural animation on the entity
Parameters
- asEntityName (tString) — name of the entity. Wildcard(s) * are supported.
- asAnimation (tString) — name of the animation to play.
- afLength (float) — time it takes to play the animation (can be negative to play it in reverse!)
- abLoop (bool) — if the animation should loop.
- afAmountFadeTime (float) — time to fade in animation.
- afSpeedFadeTime (float) — time to fade in the speed of the animation (use this for looping animations to avoid skipping).
Returns:
- void
Entity_Preload
void Entity_Preload(const tString &in asEntityFile)
Preloads an entity
Parameters
- asEntityFile (tString) — name of the entity file to preload
Returns:
- void
Entity_RemoveAllConnections
void Entity_RemoveAllConnections(const tString &in asMainEntity)
Removes all connections on an entity.
Parameters
- asMainEntity (tString) — the entity to remove all connections on. Wildcard(s) * are supported.
Returns:
- void
Entity_RemoveCollideCallback
bool Entity_RemoveCollideCallback(const tString &in asParentName,
const tString &in asChildName)
Remove a callback for when entities (objects, areas etc) collide and/or collide with the player.
Wildcard(s) * can be used in names.
Parameters
- asParentName (tString) — always "player" for player callbacks, else first entity name.
- asChildName (tString) — name of the entity or second entity.
Returns:
- bool—.
Entity_RemoveConnection
void Entity_RemoveConnection(const tString &in asName,
const tString &in asMainEntity)
Removes a specific connection on an entity.
Parameters
- asName (tString) — name of the connection to remove.
- asMainEntity (tString) — the entity to remove the connection from. Wildcard(s) * are supported.
Returns:
- void
Entity_RemoveEntityAttachment
bool Entity_RemoveEntityAttachment(const tString &in asName)
Removes an attachment to another entity if the entity(ies) has one.
Parameters
- asName (tString) — the name of the entity to be no longer attached to another, Wildcard(s) * are supported
Returns:
- bool—
Entity_SetActive
void Entity_SetActive(const tString &in asName,
bool abActive)
Set if entity is active (visible and functioning) or not.
Parameters
- asName (tString) — Name of the entity, Wildcard(s) * are supported
- abActive (bool) — true = entity becomes active - false = entity becomes inactive
Returns:
- void
Entity_SetAnimationMessageEventCallback
void Entity_SetAnimationMessageEventCallback(const tString &in asEntityName,
const tString &in asCallbackFunc,
bool abAutoRemove)
Sets a callback for the message events in the currently playing animation.
Parameters
- asEntityName (tString) — name of the entity. Wildcard(s) * are supported.
- asCallbackFunc (tString) — the callback function. Syntx void Func(const tString &in asEntityName, const tString &in asAnimName, int alMessageEventID) (last arg is for future usage)
- abAutoRemove (bool) — If the callback is removed once triggered.
Returns:
- void
Entity_SetAnimationPaused
void Entity_SetAnimationPaused(const tString &in asEntityName,
const tString &in asAnimationName,
bool abPaused = true)
Pause or unpause an animation on the specified entity.
Parameters
- asEntityName (tString) — name of the entity. Wildcard(s) * are supported.
- asAnimationName (tString) — name of the animation.
- abPaused (bool) — true to pause, false to resume
Returns:
- void
Entity_SetAnimationRelativeTimePosition
void Entity_SetAnimationRelativeTimePosition(const tString &in asEntityName,
const tString &in asAnimationName,
float afTimePos)
Sets the relative time position of a specific animation.
Parameters
- asEntityName (tString) — name of the entity. Wildcard(s) * are supported.
- asAnimationName (tString) — name of the animation.
- afTimePos (float) — a value between 0 and 1, where 0 is the start of the animation and 1 is the end.
Returns:
- void
Entity_SetAutoSleep
void Entity_SetAutoSleep(const tString &in asName,
bool abX)
Sets if the entity should sleep automatically when it need no updating
Parameters
- asName (tString) — Name of the entity, Wildcard(s) * are supported
- abX (bool) — true = Entity will sleep automatically - false = entity will not sleep automatically
Returns:
- void
Entity_SetCollide
void Entity_SetCollide(const tString &in asEntityName,
bool abActive)
Turn off or on collision for all the bodies in the given entity.
Parameters
- asEntityName (tString) — name of the entity. Wildcard(s) * are supported.
- abActive (bool) — true = collision on, false = collision off.
Returns:
- void
Entity_SetCollideCharacter
void Entity_SetCollideCharacter(const tString &in asEntityName,
bool abActive)
Turn off or on character collision for all the bodies in the given entity.
Parameters
- asEntityName (tString) — name of the entity. Wildcard(s) * are supported.
- abActive (bool) — true = collision on, false = collision off.
Returns:
- void
Entity_SetColorMul
Entity_SetConnectionStateChangeCallback
void Entity_SetConnectionStateChangeCallback(const tString &in asEntityName,
const tString &in asCallback)
Sets the callback for when the connection state changes on an entity
Syntax for callback function: void FunctionName(string &in asEntityName, int alState).
Parameters
- asEntityName (tString) — the name of the entity to get the callback. Wildcard(s) * are supported.
- asCallback (tString) — the name of the callback function.
Returns:
- void
Entity_SetEffectBaseColor
Entity_SetEffectsActive
void Entity_SetEffectsActive(const tString &in asEntityName,
bool abActive,
bool abFadeAndPlaySounds)
Activates or deactivates the effects on a entity.
Parameters
- asEntityName (tString) — name of the entity. Wildcard(s) * are supported.
- abActive (bool) — true = activates effects - false = deactivates effects.
- abFadeAndPlaySounds (bool) — if effects should fade in/out and sounds play.
Returns:
- void
Entity_SetInteractionDisabled
void Entity_SetInteractionDisabled(const tString &in asEntityName,
bool abX)
Sets if the player can interact with an entity or not.
Parameters
- asEntityName (tString) — name of the entity, Wildcard(s) * are supported
- abX (bool) — true = interaction disabled - false = interaction enabled.
Returns:
- void
Entity_SetIsOccluder
void Entity_SetIsOccluder(const tString &in asName,
bool abOccluder)
Set if entity is an occluder
Parameters
- asName (tString) — Name of the entity, Wildcard(s) * are supported
- abOccluder (bool) — true = object is occluder
Returns:
- void
Entity_SetMaxInteractionDistance
void Entity_SetMaxInteractionDistance(const tString &in asEntityName,
float afDistance)
Change the max interaction distance of an entity from the default/entity configured distance.
Parameters
- asEntityName (tString) — name of the entity, Wildcard(s) * are supported
- afDistance (float) — distance in meters that the entity can be interacted from.
Returns:
- void
Entity_SetPlayerInteractCallback
void Entity_SetPlayerInteractCallback(const tString &in asEntityName,
const tString &in asCallback,
bool abRemoveWhenInteracted)
Sets the callback for when the player interacts with a specific entity.
Syntax for callback function: void FunctionName(string &in asEntityName).
Parameters
- asEntityName (tString) — the name of the entity to get the callback. Wildcard(s) * are supported.
- asCallback (tString) — the name of the callback function.
- abRemoveWhenInteracted (bool) — if the callback should be removed after it has been called.
Returns:
- void
Entity_SetPlayerLookAtCallback
void Entity_SetPlayerLookAtCallback(const tString &in asEntityName,
const tString &in asCallback,
bool abRemoveWhenLookedAt = true,
bool abCheckCenterOfScreen = true,
bool abCheckRayIntersection = true,
float afMaxDistance = -1,
float afCallbackDelay = 0)
Sets the callback for when the player looks at or turns away from a specific entity.
Syntax for callback function: void FunctionName(const tString &in asEntityName, int alState). alState is 1 if the player looks at the entity and -1 if the player stops looking.
Parameters
- asEntityName (tString) — the name of the entity to get the callback. Wildcard(s) * are supported.
- asCallback (tString) — the name of the callback function. If set to will remove a previously set callback
- abRemoveWhenLookedAt (bool) — if the callback should be removed after it has been called.
- abCheckCenterOfScreen (bool) — if the entity counts as looked at only when at the center of the screen.
- abCheckRayIntersection (bool) — if the entity counts as looked at only if there is a clear line of sight to it. Note that this can return false negatives, especially when not checking center of screen.
- afMaxDistance (float) — max distance at which the entity must be for the callback to be triggered.
- afCallbackDelay (float) — time the player needs to look at the entity for the entity to trigger (in seconds).
Returns:
- void
Entity_SetProcAnimationPaused
void Entity_SetProcAnimationPaused(const tString &in asEntityName,
const tString &in asAnimationName,
bool abPaused = true)
Pause or unpause a procedural animation on the specified entity.
Parameters
- asEntityName (tString) — name of the entity. Wildcard(s) * are supported.
- asAnimationName (tString) — name of the animation.
- abPaused (bool) — true to pause, false to resume
Returns:
- void
Entity_SetProcAnimationSpeed
void Entity_SetProcAnimationSpeed(const tString &in asEntityName,
const tString &in asAnimationName,
float afSpeed)
Sets the speed of a proc animation.
Parameters
- asEntityName (tString) — name of the entity. Wildcard(s) * are supported.
- asAnimationName (tString) — name of the animation.
- afSpeed (float) — speed to set.
Returns:
- void
Entity_SetReflectionVisibility
void Entity_SetReflectionVisibility(const tString &in asEntityName,
bool abVisibleInReflection,
bool abVisibleInWorld)
Sets whether the entity is drawn in reflections or not, and the real world or not.
Parameters
- asEntityName (tString) — name of the prop. Wildcard(s) * are supported.
- abVisibleInReflection (bool) — whether the entity is drawn in reflections
- abVisibleInWorld (bool) — whether the entity is drawn in the real world
Returns:
- void
Entity_SetVarBool
void Entity_SetVarBool(const tString &in asEntityName,
const tString &in asVarName,
bool abX)
Sets the value of an entity boolean variable. Wildcard(s) * are supported for EntityName. *
Parameters
- asEntityName (tString) — name of the entity.
- asVarName (tString) — name of the boolean variable.
- abX (bool) — new value for the variable.
Returns:
- void
Entity_SetVarColor
void Entity_SetVarColor(const tString &in asEntityName,
const tString &in asVarName,
const cColor &in aX)
Sets the value of an entity color variable. Wildcard(s) * are supported for EntityName. *
Parameters
- asEntityName (tString) — name of the entity.
- asVarName (tString) — name of the color variable.
- aX (cColor) — new value for the variable.
Returns:
- void
Entity_SetVarFloat
void Entity_SetVarFloat(const tString &in asEntityName,
const tString &in asVarName,
float afX)
Sets the value of an entity variable. Wildcard(s) * are supported for EntityName. *
Parameters
- asEntityName (tString) — name of the entity.
- asVarName (tString) — name of the string variable.
- afX (float) — new value for the variable.
Returns:
- void
Entity_SetVarInt
void Entity_SetVarInt(const tString &in asEntityName,
const tString &in asVarName,
int alX)
Sets the value of an entity integer variable. Wildcard(s) * are supported for EntityName. *
Parameters
- asEntityName (tString) — name of the entity.
- asVarName (tString) — name of the integer variable.
- alX (int) — new value for the variable.
Returns:
- void
Entity_SetVarString
void Entity_SetVarString(const tString &in asEntityName,
const tString &in asVarName,
const tString &in asX)
Sets the value of an entity string variable. Wildcard(s) * are supported for EntityName. *
Parameters
- asEntityName (tString) — name of the entity.
- asVarName (tString) — name of the string variable.
- asX (tString) — new value for the variable.
Returns:
- void
Entity_SetVarVector2f
void Entity_SetVarVector2f(const tString &in asEntityName,
const tString &in asVarName,
const cVector2f &in avX)
Sets the value of an entity vector2f variable. Wildcard(s) * are supported for EntityName. *
Parameters
- asEntityName (tString) — name of the entity.
- asVarName (tString) — name of the vector2f variable.
- avX (cVector2f) — new value for the variable.
Returns:
- void
Entity_SetVarVector3f
void Entity_SetVarVector3f(const tString &in asEntityName,
const tString &in asVarName,
const cVector3f &in avX)
Sets the value of an entity vector3f variable. Wildcard(s) * are supported for EntityName. *
Parameters
- asEntityName (tString) — name of the entity.
- asVarName (tString) — name of the vector3f variable.
- avX (cVector3f) — new value for the variable.
Returns:
- void
Entity_Sleep
void Entity_Sleep(const tString &in asName)
Forces the entity to sleep (disabling Update/PostUpdate). Has no effect if it is already sleeping
Parameters
- asName (tString) — Name of the entity, Wildcard(s) * are supported
Returns:
- void
Entity_StopAnimation
void Entity_StopAnimation(const tString &in asEntityName)
Stops any currently playing animation on the specified entity.
Parameters
- asEntityName (tString) — name of the entity. Wildcard(s) * are supported.
Returns:
- void
Entity_StopProcAnimation
void Entity_StopProcAnimation(const tString &in asEntityName,
const tString &in asAnimation,
float afFadeTime = 0.1f)
Stops a procedural animation on the specified entity.
Parameters
- asEntityName (tString) — name of the entity. Wildcard(s) * are supported.
- asAnimation (tString) — name of the entity. Wildcard(s) * are supported.
- afFadeTime (float) — the time it takes to fade out.
Returns:
- void
Entity_WakeUp
void Entity_WakeUp(const tString &in asName)
Forces the entity to wake up (enabling Update/PostUpdate). Has no effect if it is already awake
Parameters
- asName (tString) — Name of the entity, Wildcard(s) * are supported
Returns:
- void