Arma Reforger Script API
|
Capture area is a trigger entity that provides callback and API in regards to characters entering and/or leaving the area. More...
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() |
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.
|
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.
CaptureAreaEvent SCR_CaptureArea.GetCharacterEnterInvoker | ( | ) |
Returns invoker that is invoked when a character enters this area.
CaptureAreaEvent SCR_CaptureArea.GetCharacterExitInvoker | ( | ) |
Returns invoker that is invoked when a character exits this area.
int SCR_CaptureArea.GetOccupants | ( | Faction | faction, |
notnull array< SCR_ChimeraCharacter > | outCharacters | ||
) |
Fills the provided [outCharacters] array with all occupants of provided [faction].
faction | Faction to filter for |
outCharacters | Output array |
int SCR_CaptureArea.GetOccupantsCount | ( | Faction | faction | ) |
Returns the number of occupants of provided [faction].
Faction | The faction to return the count for |
CaptureAreaOwnershipEvent SCR_CaptureArea.GetOwnershipChangedEvent | ( | ) |
Returns invoker that is invoked when a faction claims ownership of this area.
Faction SCR_CaptureArea.GetOwningFaction | ( | ) |
Returns the faction that currently owns the area or null if none.
|
protected |
callback - activation - occurs when and entity which fulfills the filter definitions enters the Trigger
Implements BaseGameTriggerEntity.
|
protected |
Occurs when a [character] of provided [faction] enters the area.
|
protected |
Occurs when a [character] of provided [faction] leaves the area.
|
protected |
callback - deactivation - occurs when and entity which was activated (OnActivate) leaves the Trigger
Implements BaseGameTriggerEntity.
|
protected |
Updates the internal state of the area and reevaluates the owner.
Implements ScriptedGameTriggerEntity.
|
protected |
Initializes this area by initializing and preallocating required resources.
Implements ScriptedGameTriggerEntity.
|
protected |
Notifies all clients of the owning faction change.
Index of faction is -1 if null.
|
protected |
Called when Item is initialized from replication stream.
Carries the data from Master.
|
protected |
Called when Item is getting replicated from Master to Slave connection.
The data will be delivered to Slave using RplInit method.
|
protected |
By default queries only for characters of SCR_ChimeraCharacter type.
Implements ScriptedGameTriggerEntity.
|
protected |
Sets internal owner faction and raises corresponding callback.
|
protected |
Map of all occupants of this area.
key: Faction value: Array of characters (must be alive)
|
protected |
Callback raised when a character enters this area.
|
protected |
Callback raised when a character leaves this area.
|
protected |
Callback raised when a new faction claims ownership of this area.
|
protected |
The faction that currently owns this area.
|
protected |
Replication component of this entity.