HPL3/Amnesia: Rebirth/Scripting/Scripting Api/Entity
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_GetEffectBaseColor
- 2.24 Entity_GetVarBool
- 2.25 Entity_GetVarColor
- 2.26 Entity_GetVarFloat
- 2.27 Entity_GetVarInt
- 2.28 Entity_GetVarString
- 2.29 Entity_GetVarVector2f
- 2.30 Entity_GetVarVector3f
- 2.31 Entity_IncVarFloat
- 2.32 Entity_IncVarInt
- 2.33 Entity_IncVarVector2f
- 2.34 Entity_IncVarVector3f
- 2.35 Entity_IsActive
- 2.36 Entity_IsInPlayerFOV
- 2.37 Entity_IsInteractedWith
- 2.38 Entity_IsOccluder
- 2.39 Entity_IsSleeping
- 2.40 Entity_PlaceAtEntity
- 2.41 Entity_PlayAnimation
- 2.42 Entity_PlayerIsInFront
- 2.43 Entity_PlayProcAnimation
- 2.44 Entity_Preload
- 2.45 Entity_RemoveAllConnections
- 2.46 Entity_RemoveCollideCallback
- 2.47 Entity_RemoveConnection
- 2.48 Entity_RemoveEntityAttachment
- 2.49 Entity_SetActive
- 2.50 Entity_SetAnimationMessageEventCallback
- 2.51 Entity_SetAnimationPaused
- 2.52 Entity_SetAnimationRelativeTimePosition
- 2.53 Entity_SetAutoSleep
- 2.54 Entity_SetCastShadows
- 2.55 Entity_SetCollide
- 2.56 Entity_SetCollideCharacter
- 2.57 Entity_SetColorMul
- 2.58 Entity_SetConnectionStateChangeCallback
- 2.59 Entity_SetEffectBaseColor
- 2.60 Entity_SetEffectsActive
- 2.61 Entity_SetEffectsActiveExt
- 2.62 Entity_SetInteractionDisabled
- 2.63 Entity_SetIsOccluder
- 2.64 Entity_SetMaxInteractionDistance
- 2.65 Entity_SetPlayerInteractCallback
- 2.66 Entity_SetPlayerLookAtCallback
- 2.67 Entity_SetProcAnimationPaused
- 2.68 Entity_SetProcAnimationSpeed
- 2.69 Entity_SetReflectionVisibility
- 2.70 Entity_SetVarBool
- 2.71 Entity_SetVarColor
- 2.72 Entity_SetVarFloat
- 2.73 Entity_SetVarInt
- 2.74 Entity_SetVarString
- 2.75 Entity_SetVarVector2f
- 2.76 Entity_SetVarVector3f
- 2.77 Entity_Sleep
- 2.78 Entity_StopAnimation
- 2.79 Entity_StopProcAnimation
- 2.80 Entity_StopSpecificAnimation
- 2.81 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 |
cColor | Entity_GetEffectBaseColor(const tString &in asEntityName) Returns the base color of the effects |
bool | Entity_GetVarBool(const tString &in asEntityName, const tString &in asVarName) Get value of an entity variable |
cColor | Entity_GetVarColor(const tString &in asEntityName, const tString &in asVarName) Get value of an entity variable |
float | Entity_GetVarFloat(const tString &in asEntityName, const tString &in asVarName) Get value of an entity variable |
int | Entity_GetVarInt(const tString &in asEntityName, const tString &in asVarName) Get value of an entity variable |
tString | Entity_GetVarString(const tString &in asEntityName, const tString &in asVarName) Get value of an entity variable |
cVector2f | Entity_GetVarVector2f(const tString &in asEntityName, const tString &in asVarName) Get value of an entity variable |
cVector3f | Entity_GetVarVector3f(const tString &in asEntityName, const tString &in asVarName) Get value of an entity variable |
void | Entity_IncVarFloat(const tString &in asEntityName, const tString &in asVarName, float afX) Add a value to the current value of an entity variable |
void | Entity_IncVarInt(const tString &in asEntityName, const tString &in asVarName, int alX) Add a value to the current value of an entity 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 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 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 = "", bool abGlobal = false, bool abApplyBoneRootMotion = false) 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_SetCastShadows(const tString &in asEntityName, bool abCast) Sets whether the entity casts shadows |
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_SetEffectsActiveExt(const tString &in asEntityName, bool abActive, bool abFadeAndPlaySounds, float afEffectsOnTime, float afEffectsOffTime) 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 variable |
void | Entity_SetVarColor(const tString &in asEntityName, const tString &in asVarName, const cColor &in aX) Sets the value of an entity 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 variable |
void | Entity_SetVarString(const tString &in asEntityName, const tString &in asVarName, const tString &in asX) Sets the value of an entity variable |
void | Entity_SetVarVector2f(const tString &in asEntityName, const tString &in asVarName, const cVector2f &in avX) Sets the value of an entity variable |
void | Entity_SetVarVector3f(const tString &in asEntityName, const tString &in asVarName, const cVector3f &in avX) Sets the value of an entity 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_StopSpecificAnimation(const tString &in asEntityName, const tString &in asAnimationName) Stop a specific animation currently playing 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 when "uncolliding" as well.
Wildcard(s) * can be used in names to check for collisions.
@callback syntax for callback function, FunctionName(const tString &in asParent, const tString &in asChild, int alState).
@abbreviation syntax for the callback function code snippet, clbCollide.
Parameters
Returns:
- bool—bool, false = callback is removed, true = callback can trigger again.
Entity_AddForce
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
Returns:
- void
Entity_AddImpulse
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) —
- asImpulseEntityName (tString) —
- afImpulse (float) —
- abOnlyMainBody (bool) —
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
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) —
- asParentName (tString) —
- asParentBodyName (tString) —
- abUseRotation (bool) —
- abSnapToParent (bool) —
- abLocked (bool) —
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) —
- asParentName (tString) —
- asParentSocketName (tString) —
- abUseRotation (bool) —
- abSnapToParent (bool) —
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
Returns:
- voidbool, true 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) —
- asMainEntity (tString) —
- asConnectEntity (tString) —
- abInvertStateSent (bool) —
- alStatesUsed (int) —
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) —
- asEntityFile (tString) —
- asTargetEntityName (tString) —
- abFullGameSave (bool) —
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) —
- asEntityFile (tString) —
- asTargetEntityName (tString) —
- abFullGameSave (bool) —
- avScale (cVector3f) —
- avOffsetPosition (cVector3f) —
- avOffsetRotation (cVector3f) —
- abLocalOffset (bool) —
Returns:
- iLuxEntity@—
Entity_Destroy
void Entity_Destroy(const tString &in asName)
Destroys an entity of a given name.
Parameters
- asName (tString) —
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
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) —
Returns:
- bool—bool, if entity exists.
Entity_Exists
bool Entity_Exists(tID aID)
Check if an entity exists in the level.
Parameters
- aID (tID) —
Returns:
- bool—bool, if entity exists.
Entity_FadeEffectBaseColor
Entity_FadeProcAnimationSpeed
Entity_GetAutoSleep
bool Entity_GetAutoSleep(const tString &in asName)
Get if an entity automatically falls asleep when it isnt active
Parameters
- asName (tString) —
Returns:
- bool—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) —
Returns:
- cVector3f—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
Returns:
- cVector3f—cVector3f, delta between the entities, delta = direction * distance = entity_b_pos - entity_a_pos
Entity_GetEffectBaseColor
cColor Entity_GetEffectBaseColor(const tString &in asEntityName)
Returns the base color of the effects
Parameters
- asEntityName (tString) —
Returns:
- cColor—
Entity_GetVarBool
Entity_GetVarColor
Entity_GetVarFloat
Entity_GetVarInt
Entity_GetVarString
Entity_GetVarVector2f
Entity_GetVarVector3f
Entity_IncVarFloat
Entity_IncVarInt
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 variable. Wildcard(s) * are supported for EntityName.
Parameters
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 variable. Wildcard(s) * are supported for EntityName.
Parameters
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) —
Returns:
- bool—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) —
Returns:
- bool—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) —
Returns:
- bool—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) —
Returns:
- bool—bool, if occluder
Entity_IsSleeping
bool Entity_IsSleeping(const tString &in asName)
Check if an entity is asleep
Parameters
- asName (tString) —
Returns:
- bool—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) —
- asTargetEntity (tString) —
- avOffset (cVector3f) —
- abAlignRotation (bool) —
- abUseEntFileCenter (bool) —
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 = "",
bool abGlobal = false,
bool abApplyBoneRootMotion = false)
Plays an animation on the entity
@callback syntax, MyFunc(string &in asProp)
Parameters
- asEntityName (tString) —
- asAnimation (tString) —
- afFadeTime (float) —
- abLoop (bool) —
- abPlayTransition (bool) —
- asCallback (tString) — (optional), name of callback function. Syntax void Func(const tString &in asEntityName, const tString &in asAnimName)
- abGlobal (bool) — (optional), if animation is played in global space
- abApplyBoneRootMotion (bool) —
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) —
Returns:
- bool—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) —
- asAnimation (tString) —
- afLength (float) —
- abLoop (bool) —
- afAmountFadeTime (float) —
- afSpeedFadeTime (float) —
Returns:
- void
Entity_Preload
void Entity_Preload(const tString &in asEntityFile)
Preloads an entity
Parameters
- asEntityFile (tString) —
Returns:
- void
Entity_RemoveAllConnections
void Entity_RemoveAllConnections(const tString &in asMainEntity)
Removes all connections on an entity.
Parameters
- asMainEntity (tString) —
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
Returns:
- bool—
Entity_RemoveConnection
Entity_RemoveEntityAttachment
bool Entity_RemoveEntityAttachment(const tString &in asName)
Removes an attachment to another entity if the entity(ies) has one.
Parameters
- asName (tString) —
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) —
- abActive (bool) —
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
Returns:
- void
Entity_SetAnimationPaused
Entity_SetAnimationRelativeTimePosition
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) —
- abX (bool) —
Returns:
- void
Entity_SetCastShadows
void Entity_SetCastShadows(const tString &in asEntityName,
bool abCast)
Sets whether the entity casts shadows.
Parameters
- asEntityName (tString) —
- abCast (bool) —
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) —
- abActive (bool) —
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) —
- abActive (bool) —
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
@callback callback syntax, FunctionName(string &in asEntityName, int alState).
Parameters
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) —
- abActive (bool) —
- abFadeAndPlaySounds (bool) —
Returns:
- void
Entity_SetEffectsActiveExt
void Entity_SetEffectsActiveExt(const tString &in asEntityName,
bool abActive,
bool abFadeAndPlaySounds,
float afEffectsOnTime,
float afEffectsOffTime)
Activates or deactivates the effects on a entity.
Parameters
- asEntityName (tString) —
- abActive (bool) —
- abFadeAndPlaySounds (bool) —
- afEffectsOnTime (float) —
- afEffectsOffTime (float) —
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) —
- abX (bool) —
Returns:
- void
Entity_SetIsOccluder
void Entity_SetIsOccluder(const tString &in asName,
bool abOccluder)
Set if entity is an occluder
Parameters
- asName (tString) —
- abOccluder (bool) —
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) —
- afDistance (float) —
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.
@callback callback syntax, FunctionName(string &in asEntityName).
Parameters
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.
@callback callback syntax, 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) —
- asCallback (tString) —
- abRemoveWhenLookedAt (bool) —
- abCheckCenterOfScreen (bool) —
- abCheckRayIntersection (bool) —
- afMaxDistance (float) —
- afCallbackDelay (float) —
Returns:
- void
Entity_SetProcAnimationPaused
Entity_SetProcAnimationSpeed
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) —
- abVisibleInReflection (bool) —
- abVisibleInWorld (bool) —
Returns:
- void
Entity_SetVarBool
Entity_SetVarColor
Entity_SetVarFloat
Entity_SetVarInt
Entity_SetVarString
Entity_SetVarVector2f
Entity_SetVarVector3f
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) —
Returns:
- void
Entity_StopAnimation
void Entity_StopAnimation(const tString &in asEntityName)
Stops any currently playing animation on the specified entity.
Parameters
- asEntityName (tString) —
Returns:
- void
Entity_StopProcAnimation
Entity_StopSpecificAnimation
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) —
Returns:
- void