Helper functions for AI
void Agent_SetStaticCollider(const tString &in asAgentName, bool abX)
Set if the agent will collide with the environment (objects and stuff will still collide with it!)
void Agent_SetSensesActive(const tString &in asAgentName, bool abX)
Set if the agent should have its senses (hearing/vision/etc) enabled. Usually implemented on a specific basis.
void Agent_RevealPlayerPosition(const tString &in asAgentName, bool bForceRedetect=false)
Reveals the player's current position to the agent.
void Agent_SetViewRangeMul(const tString &in asAgentName, float afRangeMul)
Sets the view range multiplier of the specified agent
void Agent_FaceEntity(const tString &in asAgentName, const tString &in asLookAtTarget)
Instantly sets the yaw of the agent to make it look at the specified entity.
void Agent_TeleportFeetToEntity(const tString &in asAgentName, const tString &in asTargetName)
Teleport the agent's foot position to a specific other entity.
void Agent_SetAutoDisableWhenOutOfSightActive(const tString &in asAgentName, bool abActive, float afMinDistance)
When active, the agent will be a disabled (SetActive(false)) when a certain distance away from the player and no longer seen.
void Agent_SetAutoDisableCallback(const tString &in asAgentName, const tString &in asCallbackFunc)
Sets the function that is called when the disabling made by Agent_SetAutoDisableWhenOutOfSightActive happens
bool Agent_PlayerDetected(const tString &in asAgentName)
Checks if the agent has dected the player
void CharMover_SetDirection(const tString &in asEntityName, eLuxCharMoveDirection aDir)
Sets the direction used by a character
void CharMover_TurnToEntity(const tString &in asEntityName, const tString &in asTurnToEntityName, const tString &in asTurnedToGoalCallbackFunc="")
Turns the character to a specifc entity. Broadcasts the entity message eLuxEntityMessage_TurningDone when done.
void CharMover_TurnInstantlyToEntity(const tString &in asEntityName, const tString &in asTurnToEntityName)
Turns the character directly to a specifc entity. Broadcasts the entity message eLuxEntityMessage_TurningDone when done.
void CharMover_MoveToEntity(const tString &in asEntityName, const tString &in asMoveToEntityName, const cVector3f &in avOffset=cVector3f(0))
Moves the character to a entity. Note that for non-flying characters, goal position should be the feet postion.
void CharMover_MoveToPos(const tString &in asEntityName, const cVector3f &in avPosition)
Moves the character to a position. Note that for non-flying characters, goal position should be the feet postion.
void CharMover_SetSpeedState(const tString &in asEntityName, int alIndex)
Sets the speed state of the character.
void CharMover_SetUseMoveStateAnimations(const tString &in asEntityName, bool abX)
If the charmover should change animations depending based on movement.
void CharMover_PlayAnimation(const tString &in asEntityName, const tString &in asAnimName, float afFadeTime=0.3f, bool abLoop=false, bool abPlayTransition=true, const tString &in asCallback="")
void CharMover_StopTurning(const tString &in asEntityName)
Stops any turning in the charmover
void CharMover_SetTurnRate(const tString &in asEntityName, float afMinBreakAngle, float afBreakAngleMul, float afTurnSpeedMul, float afTurnSpeedMax)
Sets the turning behavior of the charmover.
void CharMover_SetMaxForwardSpeed(const tString &in asEntityName, float afMaxSpeed)
Sets the max forward speed of the CharMover.
void CharMover_SetWallAvoidanceActive(const tString &in asEntityName, bool abX)
Enables or disables wall avoidance on the specified CharMover.
void Pathfinder_MoveTo(const tString &in asEntityName, const cVector3f &in avPos, const tString &in asCallbackFunc, float afUpdateFreq=0, bool abExactStopAtEnd=true, const tString &in asResultCallbackFunc="")
Moves an entity containing a Pathfinder component to a position. The entity message eLuxEntityMessage_EndOfPath is broadcasted when complete.
void Pathfinder_MoveToNode(const tString &in asEntityName, const tString &in asNodeName, const tString &in asCallbackFunc="", float afUpdateFreq=0, bool abExactStopAtEnd=true, const tString &in asResultCallbackFunc="")
Moves an entity containing a Pathfinder component to a node. The entity message eLuxEntityMessage_EndOfPath is broadcasted when complete.
void Pathfinder_MoveToEntity(const tString &in asPathfinderName, const tString &in asEntityName, const tString &in asCallbackFunc, float afUpdateFreq=0, bool abExactStopAtEnd=true, const cVector3f &in avGoalPosOffset=cVector3f(0), const tString &in asResultCallbackFunc="")
Moves an entity containing a Pathfinder component to a entity. The entity message eLuxEntityMessage_EndOfPath is broadcasted when complete.
void Pathfinder_Stop(const tString &in asEntityName)
Stops any movement.
void Pathfinder_SetEndCallback(const tString &in asEntityName, const tString &in asCallbackFunc)
Sets the callback for when the pathfinder has reached its goal.
bool Pathfinder_IsMoving(const tString &in asEntityName)
Checks if the pathfinder is currently moving.
void Pathfinder_Track_Clear(const tString &in asEntityName)
Clears all track nodes and stops track.
void Pathfinder_Track_Add(const tString &in asEntityName, const tString &in asNodeName, float afMinWaitTime=0, float afMaxWaitTime=-1, const tString &in asAnimName="", bool abLoopAnim=false)
Adds a track node to be followed.
void Pathfinder_Track_Start(const tString &in asEntityName, bool abLoop=false, float afUpdateFreq=1.0f, const tString &in asEndOfTrackCallback="")
Starts a track
void Pathfinder_Track_Stop(const tString &in asEntityName)
Stops the current track.
void BarkMachine_SetActive(const tString &in asEntityName, bool abActive)
Sets if the barkmachine is active (this will only affect random sounds)
void BarkMachine_PlayVoice(const tString &in asEntityName, const tString &in asSubject, int alPrio, float afMinDistance=-1, float afMaxDistance=-1, float afMaxPlayerListeningRange=-1)
Plays a voice subject as a bark
void HeadTracker_SetActive(const tString &in asEntityName, bool abX)
Turns on and off head tracking.
bool HeadTracker_IsActive(const tString &in asEntityName)
If head tracking is active or not
void HeadTracker_SetAngleOffset(const tString &in asEntityName, float afX)
Sets the offset of the headtracker angle useful if the character is not facing in the direction of the meshentity forward vector.
void HeadTracker_SetTargetEntity(const tString &in asEntityName, const tString &in asTargetEntityName)
Sets the target of the head tracking
void NPC_SetVoiceName(const tString &in asNpcName, const tString &in asVoiceName)
Sets the voice name for an NPC. This also automatically sets the source of the voice as the npc.
bool NPC_IsTalking(const tString &in asNpcName)
Checks if the NPC is being talked to.
void NPC_SetCanBeTalkedTo(const tString &in asNpcName, bool abX)
Sets if the NPC can be talked to (interacted with)
void NPC_SetMainAnimation(const tString &in asNpcName, const tString &in asAnim, bool abPlayTransition=true, const tString &in asCallbackFunc="", float afFadeTime=0.5, bool abGlobalSpace=false)
Sets and plays the main animation of the NPC. This will also turn off any movement animations.
void NPC_PlayExtraAnimation(const tString &in asNpcName, const tString &in asAnim, float afFadeTime=0.3, const tString &in asCallbackFunc="", bool abGlobalSpace=false)
Plays an extra animation for the NPC. Will return to main animation (see NPC_SetMainAnimation) when done.
void NPC_StopAllAnimations(const tString &in asNpcName, float afFadeTime=0.0f)
Stops all animations for the NPC.
void NPC_StopExtraAnimation(const tString &in asNpcName, float afFadeTime=0.0f)
Stops currently playing extra animation for the NPC.
void NPC_PlayEmotion(const tString &in asNpcName, const tString &in asEmotion, float afDuration, float afWeight=1.0f, float afFadeTime=0.25f)
Plays a face emotion for the duration
void NPC_MoveToNode(const tString &in asNpcName, const tString &in asNodeName, const tString &in asCallbackFunc)
Moves the NPC to a path node.
void Critter_SetGroupEntity(const tString &in asCritter, const tString &in asGroupEntity)
Sets the entity the critter should flock around
void Critter_AddExtraEscapeEntity(const tString &in asCritter, const tString &in asEscapeEntity)
Adds an entity that the critter should try to avoid the same way it does with the player. (Only implemented in FishSmall right now)