Endstar LUA API Documentation
Loading...
Searching...
No Matches
Npc Class Reference

Contains methods to modify the npc during gameplay. More...

Public Member Functions

void Kill (Context instigator)
 Kills the NPC by reducing its health to zero.
 
void SetCombatMode (Context instigator, int combatMode)
 Sets the combat mode for the NPC.
 
void SetDamageMode (Context instigator, int damageMode)
 Sets the damage mode for the NPC.
 
void SetPhysicsMode (Context instigator, int physicsMode)
 Sets the physics mode for the NPC.
 
void SetCanFidget (Context instigator, bool canFidget)
 Configures whether the NPC can fidget.
 
void SetDestinationTolerance (Context instigator, float newTolerance)
 Configures the distance to a destination where the npc will stop moving.
 
void SetDestination (Context instigator)
 Sets the npcs destination to the position of an instruction node. This method is obsolete. Use SetDestinationToCell instead.
 
void SetDestinationToCell (Context instigator, CellReference cellReference, Context fallbackContextForPosition)
 Set the npcs destination to the position of the selected cell. If no cell is selected it will set the destination to the position of the fallback context.
 
void SetDestinationToPosition (Context instigator, Vector3 position)
 Sets the npcs destination to the position in world space.
 
void SetDestinationToPosition (Context instigator, Vector3Int position)
 Sets the npcs destination to the position in world space.
 
void ClearDestination (Context instigator)
 Clears the NPC's destination.
 
Vector3 GetNpcPosition (Context instigator)
 Gets the current position of the NPC.
 
void SetNewWanderPosition (Context instigator, float distance)
 Sets a new wander position for the NPC within a specified distance of its current location.
 
void SetNewRovePosition (Context instigator, float roveDistance, float distancePerMove)
 Sets a new rove position for the NPC within a certain distance of an instruction node.
 
int GetNumberOfInteractables ()
 Gets the number of interactables associated with the NPC.
 

Detailed Description

Contains methods to modify the npc during gameplay.

Member Function Documentation

◆ ClearDestination()

void ClearDestination ( Context instigator)

Clears the NPC's destination.

Parameters
instigatorThe source context triggering this change

◆ GetNpcPosition()

Vector3 GetNpcPosition ( Context instigator)

Gets the current position of the NPC.

Parameters
instigatorThe source context triggering this change
Returns
The current position of the NPC.

◆ GetNumberOfInteractables()

int GetNumberOfInteractables ( )

Gets the number of interactables associated with the NPC.

Returns
The number of interactables.

◆ Kill()

void Kill ( Context instigator)

Kills the NPC by reducing its health to zero.

Parameters
instigatorThe source context triggering this change

◆ SetCanFidget()

void SetCanFidget ( Context instigator,
bool canFidget )

Configures whether the NPC can fidget.

Parameters
instigatorThe source context triggering this change
canFidgetIf set to true, the NPC can fidget.

◆ SetCombatMode()

void SetCombatMode ( Context instigator,
int combatMode )

Sets the combat mode for the NPC.

Parameters
instigatorThe source context triggering this change
combatModeThe CombatMode to set.

◆ SetDamageMode()

void SetDamageMode ( Context instigator,
int damageMode )

Sets the damage mode for the NPC.

Parameters
instigatorThe source context triggering this change
damageModeThe DamageMode to set.

◆ SetDestination()

void SetDestination ( Context instigator)

Sets the npcs destination to the position of an instruction node. This method is obsolete. Use SetDestinationToCell instead.

Parameters
instigatorThe source context triggering this change

◆ SetDestinationToCell()

void SetDestinationToCell ( Context instigator,
CellReference cellReference,
Context fallbackContextForPosition )

Set the npcs destination to the position of the selected cell. If no cell is selected it will set the destination to the position of the fallback context.

Parameters
instigatorThe source context triggering this change
cellReferenceThe cell to direct the npc to move to
fallbackContextForPositionThe context of the fallback position object

◆ SetDestinationTolerance()

void SetDestinationTolerance ( Context instigator,
float newTolerance )

Configures the distance to a destination where the npc will stop moving.

Parameters
instigatorThe source context triggering this change
newToleranceThe new destination tolerance.

◆ SetDestinationToPosition() [1/2]

void SetDestinationToPosition ( Context instigator,
Vector3 position )

Sets the npcs destination to the position in world space.

Parameters
instigatorThe source context triggering this change
positionThe position to set as the destination

◆ SetDestinationToPosition() [2/2]

void SetDestinationToPosition ( Context instigator,
Vector3Int position )

Sets the npcs destination to the position in world space.

Parameters
instigatorThe source context triggering this change
positionThe position to set as the destination

◆ SetNewRovePosition()

void SetNewRovePosition ( Context instigator,
float roveDistance,
float distancePerMove )

Sets a new rove position for the NPC within a certain distance of an instruction node.

Parameters
instigatorThe source context triggering this change
roveDistanceThe maximum distance to rove.
distancePerMoveThe distance per move during roving.

◆ SetNewWanderPosition()

void SetNewWanderPosition ( Context instigator,
float distance )

Sets a new wander position for the NPC within a specified distance of its current location.

Parameters
instigatorThe source context triggering this change
distanceThe distance within which to find a wander position.

◆ SetPhysicsMode()

void SetPhysicsMode ( Context instigator,
int physicsMode )

Sets the physics mode for the NPC.

Parameters
instigatorThe source context triggering this change
physicsModeThe PhysicsMode to set.