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

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

Inheritance diagram for SCR_CaptureArea:
[legend]

Public Member Functions

CaptureAreaEvent GetCharacterEnterInvoker ()
 Returns invoker that is invoked when a character enters this area.
 
CaptureAreaEvent GetCharacterExitInvoker ()
 Returns invoker that is invoked when a character exits this area.
 
CaptureAreaOwnershipEvent GetOwnershipChangedEvent ()
 Returns invoker that is invoked when a faction claims ownership of this area.
 
Faction GetOwningFaction ()
 Returns the faction that currently owns the area or null if none.
 
int GetOccupants (Faction faction, notnull array< SCR_ChimeraCharacter > outCharacters)
 Fills the provided [outCharacters] array with all occupants of provided [faction].
 
int GetOccupantsCount (Faction faction)
 Returns the number of occupants of provided [faction].
 
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

override void OnInit (IEntity owner)
 Initializes this area by initializing and preallocating required resources.
 
override bool RplLoad (ScriptBitReader reader)
 Called when Item is initialized from replication stream.
 
override bool RplSave (ScriptBitWriter writer)
 Called when Item is getting replicated from Master to Slave connection.
 
override bool ScriptedEntityFilterForQuery (IEntity ent)
 By default queries only for characters of SCR_ChimeraCharacter type.
 
override void OnActivate (IEntity ent)
 callback - activation - occurs when and entity which fulfills the filter definitions enters the Trigger
 
void OnCharacterEntered (Faction faction, SCR_ChimeraCharacter character)
 Occurs when a [character] of provided [faction] enters the area.
 
override void OnDeactivate (IEntity ent)
 callback - deactivation - occurs when and entity which was activated (OnActivate) leaves the Trigger
 
void OnCharacterExit (Faction faction, SCR_ChimeraCharacter character)
 Occurs when a [character] of provided [faction] leaves the area.
 
Faction EvaluateOwnerFaction ()
 Evaluate and return the faction that owns this point.
 
override void OnFrame (IEntity owner, float timeSlice)
 Updates the internal state of the area and reevaluates the owner.
 
void SetOwningFactionInternal (Faction previousFaction, Faction newFaction)
 Sets internal owner faction and raises corresponding callback.
 
void Rpc_SetOwningFaction_BC (int previousFactionIndex, int newFactionIndex)
 Notifies all clients of the owning faction change.
 
void OnOwningFactionChanged (Faction previousFaction, Faction newFaction)
 Occurs on change of faction ownership of the area.
 
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

ref map< Faction, ref array< SCR_ChimeraCharacter > > m_mOccupants = new map<Faction, ref array<SCR_ChimeraCharacter>>()
 Map of all occupants of this area.
 
ref CaptureAreaEvent m_pOnCharacterEnter = new CaptureAreaEvent()
 Callback raised when a character enters this area.
 
ref CaptureAreaEvent m_pOnCharacterExit = new CaptureAreaEvent()
 Callback raised when a character leaves this area.
 
ref CaptureAreaOwnershipEvent m_pOnOwnershipChanged = new CaptureAreaOwnershipEvent()
 Callback raised when a new faction claims ownership of this area.
 
Faction m_pOwnerFaction
 The faction that currently owns this area.
 
RplComponent m_pRplComponent
 Replication component of this entity.
 
- Protected Attributes inherited from BaseGameTriggerEntity
ref ScriptInvoker Event_OnQueryFinished = new ScriptInvoker()
 

Detailed Description

Capture area is a trigger entity that provides callback and API in regards to 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

◆ EvaluateOwnerFaction()

Faction SCR_CaptureArea.EvaluateOwnerFaction ( )
protected

Evaluate and return the faction that owns this point.

Can be overridden and implemented for custom logic.

Returns the faction with most players alive in the point.

◆ GetCharacterEnterInvoker()

CaptureAreaEvent SCR_CaptureArea.GetCharacterEnterInvoker ( )

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

◆ GetCharacterExitInvoker()

CaptureAreaEvent SCR_CaptureArea.GetCharacterExitInvoker ( )

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

◆ GetOccupants()

int SCR_CaptureArea.GetOccupants ( Faction  faction,
notnull array< SCR_ChimeraCharacter outCharacters 
)

Fills the provided [outCharacters] array with all occupants of provided [faction].

Parameters
factionFaction to filter for
outCharactersOutput array
Returns
Number of items output

◆ GetOccupantsCount()

int SCR_CaptureArea.GetOccupantsCount ( Faction  faction)

Returns the number of occupants of provided [faction].

Parameters
FactionThe faction to return the count for
Returns
Returns number of occupants

◆ GetOwnershipChangedEvent()

CaptureAreaOwnershipEvent SCR_CaptureArea.GetOwnershipChangedEvent ( )

Returns invoker that is invoked when a faction claims ownership of this area.

◆ GetOwningFaction()

Faction SCR_CaptureArea.GetOwningFaction ( )

Returns the faction that currently owns the area or null if none.

◆ OnActivate()

override void SCR_CaptureArea.OnActivate ( IEntity  ent)
protected

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

Implements BaseGameTriggerEntity.

◆ OnCharacterEntered()

void SCR_CaptureArea.OnCharacterEntered ( Faction  faction,
SCR_ChimeraCharacter  character 
)
protected

Occurs when a [character] of provided [faction] enters the area.

◆ OnCharacterExit()

void SCR_CaptureArea.OnCharacterExit ( Faction  faction,
SCR_ChimeraCharacter  character 
)
protected

Occurs when a [character] of provided [faction] leaves the area.

◆ OnDeactivate()

override void SCR_CaptureArea.OnDeactivate ( IEntity  ent)
protected

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

Implements BaseGameTriggerEntity.

◆ OnFrame()

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

Updates the internal state of the area and reevaluates the owner.

Implements ScriptedGameTriggerEntity.

◆ OnInit()

override void SCR_CaptureArea.OnInit ( IEntity  owner)
protected

Initializes this area by initializing and preallocating required resources.

Implements ScriptedGameTriggerEntity.

◆ OnOwningFactionChanged()

void SCR_CaptureArea.OnOwningFactionChanged ( Faction  previousFaction,
Faction  newFaction 
)
protected

Occurs on change of faction ownership of the area.

Parameters
previousFactionFaction which held the point prior to this change or null if none.
newFactionFaction that holds the point after this change or null if none.

◆ Rpc_SetOwningFaction_BC()

void SCR_CaptureArea.Rpc_SetOwningFaction_BC ( int  previousFactionIndex,
int  newFactionIndex 
)
protected

Notifies all clients of the owning faction change.

Index of faction is -1 if null.

◆ RplLoad()

override bool SCR_CaptureArea.RplLoad ( ScriptBitReader  reader)
protected

Called when Item is initialized from replication stream.

Carries the data from Master.

◆ RplSave()

override bool SCR_CaptureArea.RplSave ( ScriptBitWriter  writer)
protected

Called when Item is getting replicated from Master to Slave connection.

The data will be delivered to Slave using RplInit method.

◆ ScriptedEntityFilterForQuery()

override bool SCR_CaptureArea.ScriptedEntityFilterForQuery ( IEntity  ent)
protected

By default queries only for characters of SCR_ChimeraCharacter type.

Implements ScriptedGameTriggerEntity.

◆ SetOwningFactionInternal()

void SCR_CaptureArea.SetOwningFactionInternal ( Faction  previousFaction,
Faction  newFaction 
)
protected

Sets internal owner faction and raises corresponding callback.

Member Data Documentation

◆ m_mOccupants

ref map<Faction, ref array<SCR_ChimeraCharacter> > SCR_CaptureArea.m_mOccupants = new map<Faction, ref array<SCR_ChimeraCharacter>>()
protected

Map of all occupants of this area.

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

◆ m_pOnCharacterEnter

ref CaptureAreaEvent SCR_CaptureArea.m_pOnCharacterEnter = new CaptureAreaEvent()
protected

Callback raised when a character enters this area.

◆ m_pOnCharacterExit

ref CaptureAreaEvent SCR_CaptureArea.m_pOnCharacterExit = new CaptureAreaEvent()
protected

Callback raised when a character leaves this area.

◆ m_pOnOwnershipChanged

ref CaptureAreaOwnershipEvent SCR_CaptureArea.m_pOnOwnershipChanged = new CaptureAreaOwnershipEvent()
protected

Callback raised when a new faction claims ownership of this area.

◆ m_pOwnerFaction

Faction SCR_CaptureArea.m_pOwnerFaction
protected

The faction that currently owns this area.

◆ m_pRplComponent

RplComponent SCR_CaptureArea.m_pRplComponent
protected

Replication component of this entity.


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