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

This class is used to SpawnNpcs and access members of npc groups. More...

Public Member Functions

Context SpawnNpc (Context instigator, CellReference cellReference, NpcConfiguration config, Context fallbackContextForPosition)
 Attempts to spawn an npc near the given position.
 
Context GetNpcInGroupByIndex (int group, int index)
 Returns the context of the npc in the group by its index.
 
int GetNumNpcsByGroup (int group)
 Returns the number of npcs in a given group.
 
NpcConfiguration CreateNewConfiguration ()
 Creates a default configuration for an npc.
 
NpcConfiguration CopyNpcConfiguration (Context context)
 

Detailed Description

This class is used to SpawnNpcs and access members of npc groups.

Member Function Documentation

◆ CopyNpcConfiguration()

NpcConfiguration CopyNpcConfiguration ( Context context)

◆ CreateNewConfiguration()

NpcConfiguration CreateNewConfiguration ( )

Creates a default configuration for an npc.

Returns
A default npc configuration.

◆ GetNpcInGroupByIndex()

Context GetNpcInGroupByIndex ( int group,
int index )

Returns the context of the npc in the group by its index.

Parameters
groupThe group to select an npc from.
indexThe index of the npc in the group.
Returns
Context of the selected npc.

◆ GetNumNpcsByGroup()

int GetNumNpcsByGroup ( int group)

Returns the number of npcs in a given group.

Parameters
groupThe group to analyze.
Returns
The number of npcs in the group.

◆ SpawnNpc()

Context SpawnNpc ( Context instigator,
CellReference cellReference,
NpcConfiguration config,
Context fallbackContextForPosition )

Attempts to spawn an npc near the given position.

Parameters
instigatorThe context triggering the spawn.
cellReferenceThe position to spawn the npc.
configThe configuration of the npc to be spawned.
fallbackContextForPositionThe context of the prop that will be used for the fallback position.