Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SCR_SpawnArea Interface Reference

Spawn area is a trigger entity that provides callback and API in regards to enemy characters entering and/or leaving the area. More...

Inheritance diagram for SCR_SpawnArea:
[legend]

Public Member Functions

SpawnAreaEvent GetCharacterEnterInvoker ()
 Returns invoker that is invoked when a character enters this area.
 
SpawnAreaEvent GetCharacterExitInvoker ()
 Returns invoker that is invoked when a character leaves this area.
 
SpawnAreaAlertEvent GetOnAlertInvoker ()
 Returns invoker that is invoked when area is occupied by at least one enemy character.
 
Faction GetAffiliatedFaction ()
 Returns the faction this area is affiliated with or null if none.
 
FactionKey GetAffiliatedFactionKey ()
 Returns the faction key of faction this area is affiliated with or empty if none.
 
bool IsInside (SCR_ChimeraCharacter character)
 Check whether provided character is in this trigger.
 
bool IsFriendly (notnull SCR_ChimeraCharacter character)
 Check whether provided faction is friendly in relation to this area trigger.
 
int GetFriendlyCharactersInside (out notnull array< SCR_ChimeraCharacter > outCharacters)
 Fills the provided array with characters of friendly faction present in this area and returns the amount of them.
 
int GetEnemyCharactersInside (out notnull array< SCR_ChimeraCharacter > outCharacters)
 Fills the provided array with characters of enemy faction present in this area and returns the amount of them.
 
int GetCharactersInside (out notnull array< SCR_ChimeraCharacter > outCharacters)
 Fills the provided array with characters present in this area and returns the amount of them.
 
override bool ScriptedEntityFilterForQuery (IEntity ent)
 Override this method in inherited class to define a new filter.
 
bool ScriptedEntityFilterForQuery (IEntity ent)
 Override this method in inherited class to define a new filter. This base filter will not be used unless overridden!
 
- Public Member Functions inherited from BaseGameTriggerEntity
ScriptInvoker GetOnQueryFinished ()
 
proto external bool QueryEntityInside (notnull IEntity ent)
 
proto external void QueryEntitiesInside ()
 
proto external bool DefaultEntityFilterForQuery (IEntity ent)
 
proto external int GetEntitiesInside (out notnull array< IEntity > outEntities)
 Get the entities inside the triggers.
 
proto external void SetSphereRadius (float radius)
 
proto external float GetSphereRadius ()
 
proto external void SetUpdateRate (float updateRate)
 
proto external float GetUpdateRate ()
 
proto external void EnablePeriodicQueries (bool enable)
 
proto external bool IsPeriodicQueriesEnabled ()
 
proto external void AddFilterName (string name)
 Add a name to the filter.
 
proto external bool RemoveFilterName (string name)
 Remove a name from the filter.
 
proto external void AddClassType (TypeName classType)
 Add a class type to the filter.
 
proto external bool RemoveClassType (TypeName classType)
 Remove a class type from the filter.
 
proto external void AddPrefabFilter (PrefabFilter prefabFilter)
 Add a prefab filter to the filters.
 
proto external bool RemovePrefabFilter (PrefabFilter prefabFilter)
 Remove a prefab filter from the filters.
 
proto external EQueryEntitiesFlags GetTraceMask ()
 Get flag(s) from the traces done by the the trigger.
 
proto external void SetTraceMask (EQueryEntitiesFlags flags)
 Sets trace mask.
 
proto external void ClearTraceMask (EQueryEntitiesFlags flags)
 Clears trace mask.
 

Protected Member Functions

bool IsLocalEntity (notnull IEntity ent)
 
override void OnActivate (IEntity ent)
 callback - activation - occurs when and entity which fulfills the filter definitions enters the Trigger
 
void OnCharacterEnter (IEntity character, bool isFriendly)
 
override void OnDeactivate (IEntity ent)
 callback - deactivation - occurs when and entity which was activated (OnActivate) leaves the Trigger
 
void OnCharacterExit (IEntity character, bool isFriendly)
 
override void OnInit (IEntity owner)
 Initializes this area by initializing and preallocating required resources.
 
override void OnFrame (IEntity owner, float timeSlice)
 
void OnAlert (array< IEntity > enemies)
 
void OnInit (IEntity owner)
 
void OnFrame (IEntity owner, float timeSlice)
 
- Protected Member Functions inherited from BaseGameTriggerEntity
void OnActivate (IEntity ent)
 callback - activation - occurs when and entity which fulfills the filter definitions enters the Trigger
 
void OnDeactivate (IEntity ent)
 callback - deactivation - occurs when and entity which was activated (OnActivate) leaves the Trigger
 
void OnQueryFinished (bool bIsEmpty)
 callback - query finished - occurs when the current query finished being processd and has updated results
 

Protected Attributes

FactionKey m_sFactionKey
 Key of faction this area belongs to.
 
ref set< SCR_ChimeraCharacterm_sOccupants = new set<SCR_ChimeraCharacter>()
 Map of all occupants of this area.
 
ref SpawnAreaEvent m_pOnCharacterEnter = new SpawnAreaEvent()
 Callback raised when a character enters this area.
 
ref array< IEntity > m_aEnemies = {}
 Buffer of all enemy entities for a single frame.
 
ref SpawnAreaEvent m_pOnCharacterExit = new SpawnAreaEvent()
 Callback raised when a character leaves this area.
 
ref SpawnAreaAlertEvent m_pOnAlert = new SpawnAreaAlertEvent()
 Callback raised when area is occupied by at least one enemy character.
 
- Protected Attributes inherited from BaseGameTriggerEntity
ref ScriptInvoker Event_OnQueryFinished = new ScriptInvoker()
 

Detailed Description

Spawn area is a trigger entity that provides callback and API in regards to enemy characters entering and/or leaving the area.

Characters must be assigned to a faction to be recognized by this area. In addition, the area itself must have periodic update enabled, otherwise callbacks might not be raised.

Member Function Documentation

◆ GetAffiliatedFaction()

Faction SCR_SpawnArea.GetAffiliatedFaction ( )

Returns the faction this area is affiliated with or null if none.

◆ GetAffiliatedFactionKey()

FactionKey SCR_SpawnArea.GetAffiliatedFactionKey ( )

Returns the faction key of faction this area is affiliated with or empty if none.

◆ GetCharacterEnterInvoker()

SpawnAreaEvent SCR_SpawnArea.GetCharacterEnterInvoker ( )

Returns invoker that is invoked when a character enters this area.

◆ GetCharacterExitInvoker()

SpawnAreaEvent SCR_SpawnArea.GetCharacterExitInvoker ( )

Returns invoker that is invoked when a character leaves this area.

◆ GetCharactersInside()

int SCR_SpawnArea.GetCharactersInside ( out notnull array< SCR_ChimeraCharacter outCharacters)

Fills the provided array with characters present in this area and returns the amount of them.

Parameters
outCharactersThe array to clear and will with data.
Returns
Returns number of characters provided.

◆ GetEnemyCharactersInside()

int SCR_SpawnArea.GetEnemyCharactersInside ( out notnull array< SCR_ChimeraCharacter outCharacters)

Fills the provided array with characters of enemy faction present in this area and returns the amount of them.

Parameters
outCharactersThe array to clear and will with data.
Returns
Returns number of characters provided.

◆ GetFriendlyCharactersInside()

int SCR_SpawnArea.GetFriendlyCharactersInside ( out notnull array< SCR_ChimeraCharacter outCharacters)

Fills the provided array with characters of friendly faction present in this area and returns the amount of them.

Parameters
outCharactersThe array to clear and will with data.
Returns
Returns number of characters provided.

◆ GetOnAlertInvoker()

SpawnAreaAlertEvent SCR_SpawnArea.GetOnAlertInvoker ( )

Returns invoker that is invoked when area is occupied by at least one enemy character.

◆ IsFriendly()

bool SCR_SpawnArea.IsFriendly ( notnull SCR_ChimeraCharacter  character)

Check whether provided faction is friendly in relation to this area trigger.

Returns
Returns true in case faction is friendly, false otherwise.

◆ IsInside()

bool SCR_SpawnArea.IsInside ( SCR_ChimeraCharacter  character)

Check whether provided character is in this trigger.

Returns
Returns true if character is inside of this trigger, false otherwise.

◆ IsLocalEntity()

bool SCR_SpawnArea.IsLocalEntity ( notnull IEntity  ent)
protected

◆ OnActivate()

override void SCR_SpawnArea.OnActivate ( IEntity  ent)
protected

callback - activation - occurs when and entity which fulfills the filter definitions enters the Trigger

Implements BaseGameTriggerEntity.

◆ OnAlert()

void SCR_SpawnArea.OnAlert ( array< IEntity >  enemies)
protected

◆ OnCharacterEnter()

void SCR_SpawnArea.OnCharacterEnter ( IEntity  character,
bool  isFriendly 
)
protected

Implemented in SCR_CaptureAndHoldSpawnArea.

◆ OnCharacterExit()

void SCR_SpawnArea.OnCharacterExit ( IEntity  character,
bool  isFriendly 
)
protected

Implemented in SCR_CaptureAndHoldSpawnArea.

◆ OnDeactivate()

override void SCR_SpawnArea.OnDeactivate ( IEntity  ent)
protected

callback - deactivation - occurs when and entity which was activated (OnActivate) leaves the Trigger

Implements BaseGameTriggerEntity.

◆ OnFrame()

override void SCR_SpawnArea.OnFrame ( IEntity  owner,
float  timeSlice 
)
protected

◆ OnInit()

override void SCR_SpawnArea.OnInit ( IEntity  owner)
protected

Initializes this area by initializing and preallocating required resources.

Implements ScriptedGameTriggerEntity.

Implemented in SCR_CaptureAndHoldSpawnArea.

◆ ScriptedEntityFilterForQuery()

override bool SCR_SpawnArea.ScriptedEntityFilterForQuery ( IEntity  ent)

Override this method in inherited class to define a new filter.

Implements ScriptedGameTriggerEntity.

Member Data Documentation

◆ m_aEnemies

ref array<IEntity> SCR_SpawnArea.m_aEnemies = {}
protected

Buffer of all enemy entities for a single frame.

◆ m_pOnAlert

ref SpawnAreaAlertEvent SCR_SpawnArea.m_pOnAlert = new SpawnAreaAlertEvent()
protected

Callback raised when area is occupied by at least one enemy character.

◆ m_pOnCharacterEnter

ref SpawnAreaEvent SCR_SpawnArea.m_pOnCharacterEnter = new SpawnAreaEvent()
protected

Callback raised when a character enters this area.

◆ m_pOnCharacterExit

ref SpawnAreaEvent SCR_SpawnArea.m_pOnCharacterExit = new SpawnAreaEvent()
protected

Callback raised when a character leaves this area.

◆ m_sFactionKey

FactionKey SCR_SpawnArea.m_sFactionKey
protected

Key of faction this area belongs to.

◆ m_sOccupants

ref set<SCR_ChimeraCharacter> SCR_SpawnArea.m_sOccupants = new set<SCR_ChimeraCharacter>()
protected

Map of all occupants of this area.

key: Faction value: Array of characters (must be alive)


The documentation for this interface was generated from the following file: