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

This area awards score to the faction which controls the area periodically. More...

Inheritance diagram for SCR_CaptureAndHoldArea:
[legend]

Public Member Functions

Faction GetContestingFaction ()
 Returns the faction that currently owns the area or null if none.
 
bool IsContested ()
 Returns true if this area is being contested.
 
bool IsMajor ()
 Returns true if this area is marked as a major objective.
 
CaptureAreaTickEvent GetOnTickInvoker ()
 Returns invoker that is invoked when this area ticks (awards score).
 
int GetScorePerTick ()
 Returns score awarded per area tick.
 
LocalizedString GetAreaSymbol ()
 Returns the short "symbolic" one-character name of this area.
 
vector GetLocalObjectiveCenter ()
 Returns objective center in local space relative to the area.
 
vector GetWorldObjectiveCenter ()
 Returns objective center in world space.
 
bool IsCharacterInside (SCR_ChimeraCharacter character)
 Returns true if provided character is in this area.
 
- Public Member Functions inherited from SCR_CaptureArea
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.
 

Public Attributes

LocalizedString m_sAreaSymbol
 
vector m_vObjectiveCenter
 
float m_fTickRate
 
int m_iScorePerTick
 
int m_iScorePerTickContested
 
float m_fContestingRatio
 
bool m_bIsMajor
 
float m_fTickTime
 Elapsed time.
 

Protected Member Functions

override bool RplLoad (ScriptBitReader reader)
 Called when Item is initialized from replication stream. Carries the data from Master.
 
override bool RplSave (ScriptBitWriter writer)
 Called when Item is getting replicated from Master to Slave connection.
 
void SetContestingFactionInternal (Faction previousFaction, Faction newFaction)
 Sets internal owner faction and raises corresponding callback.
 
void Rpc_SetContestingFaction_BC (int previousFactionIndex, int newFactionIndex)
 Notifies all clients of the owning faction change.
 
SCR_BaseGameMode GetGameMode ()
 Utility method - returns current scripted game mode.
 
SCR_BaseScoringSystemComponent GetScoringSystemComponent ()
 Returns scoring system attached to current gamemode (if any) or null otherwise.
 
override void OnInit (IEntity owner)
 Initialize this area and register it to parent manager.
 
void InitializeMapDescriptor (SCR_MapDescriptorComponent target)
 Initializes objective map descriptor for this area.
 
void UpdateMapDescriptor (SCR_MapDescriptorComponent target)
 Updates objective map descriptor for this area with current state.
 
override void OnFrame (IEntity owner, float timeSlice)
 Updates the area and awards points if held.
 
void OnTick ()
 Called when point ticks, ie.
 
void DoSetContestingFaction (Faction previousFaction, Faction newFaction)
 Sets the Faction (or none) that currently contests this area.
 
override Faction EvaluateOwnerFaction ()
 Handles owning and contesting changes based on defined parameters.
 
void OnContestingFactionChanged (Faction previousFaction, Faction newFaction)
 Occurs on change of contesting faction of the area.
 
override void OnOwningFactionChanged (Faction previousFaction, Faction newFaction)
 Occurs on change of owning faction of the area.
 
void ~SCR_CaptureAndHoldArea ()
 Unregisters self from parent manager.
 
- Protected Member Functions inherited from SCR_CaptureArea
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 CaptureAreaTickEvent m_OnTickEvent = new CaptureAreaTickEvent()
 Callback for when a tick event is raised by this area.
 
SCR_MapDescriptorComponent m_MapDescriptor
 Attached map descriptor component used for visualization (if any) or null if none.
 
Faction m_ContestingFaction
 The faction that currently attacking/contesting this point in relation to the owner faction.
 
- Protected Attributes inherited from SCR_CaptureArea
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

This area awards score to the faction which controls the area periodically.

Area registers and unregisters from the SCR_CaptureAndHoldManager.

Constructor & Destructor Documentation

◆ ~SCR_CaptureAndHoldArea()

void SCR_CaptureAndHoldArea.~SCR_CaptureAndHoldArea ( )
protected

Unregisters self from parent manager.

Member Function Documentation

◆ DoSetContestingFaction()

void SCR_CaptureAndHoldArea.DoSetContestingFaction ( Faction  previousFaction,
Faction  newFaction 
)
protected

Sets the Faction (or none) that currently contests this area.

Authority only setter, replicated to clients.

◆ EvaluateOwnerFaction()

override Faction SCR_CaptureAndHoldArea.EvaluateOwnerFaction ( )
protected

Handles owning and contesting changes based on defined parameters.

Implements SCR_CaptureArea.

◆ GetAreaSymbol()

LocalizedString SCR_CaptureAndHoldArea.GetAreaSymbol ( )

Returns the short "symbolic" one-character name of this area.

◆ GetContestingFaction()

Faction SCR_CaptureAndHoldArea.GetContestingFaction ( )

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

◆ GetGameMode()

SCR_BaseGameMode SCR_CaptureAndHoldArea.GetGameMode ( )
protected

Utility method - returns current scripted game mode.

◆ GetLocalObjectiveCenter()

vector SCR_CaptureAndHoldArea.GetLocalObjectiveCenter ( )

Returns objective center in local space relative to the area.

◆ GetOnTickInvoker()

CaptureAreaTickEvent SCR_CaptureAndHoldArea.GetOnTickInvoker ( )

Returns invoker that is invoked when this area ticks (awards score).

◆ GetScorePerTick()

int SCR_CaptureAndHoldArea.GetScorePerTick ( )

Returns score awarded per area tick.

◆ GetScoringSystemComponent()

SCR_BaseScoringSystemComponent SCR_CaptureAndHoldArea.GetScoringSystemComponent ( )
protected

Returns scoring system attached to current gamemode (if any) or null otherwise.

◆ GetWorldObjectiveCenter()

vector SCR_CaptureAndHoldArea.GetWorldObjectiveCenter ( )

Returns objective center in world space.

◆ InitializeMapDescriptor()

void SCR_CaptureAndHoldArea.InitializeMapDescriptor ( SCR_MapDescriptorComponent  target)
protected

Initializes objective map descriptor for this area.

Parameters
targetTarget map descriptor to initialize as this area

◆ IsCharacterInside()

bool SCR_CaptureAndHoldArea.IsCharacterInside ( SCR_ChimeraCharacter  character)

Returns true if provided character is in this area.

A character must have an affiliated faction using the FactionAffiliationComponent.

◆ IsContested()

bool SCR_CaptureAndHoldArea.IsContested ( )

Returns true if this area is being contested.

◆ IsMajor()

bool SCR_CaptureAndHoldArea.IsMajor ( )

Returns true if this area is marked as a major objective.

◆ OnContestingFactionChanged()

void SCR_CaptureAndHoldArea.OnContestingFactionChanged ( Faction  previousFaction,
Faction  newFaction 
)
protected

Occurs on change of contesting faction of the area.

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

◆ OnFrame()

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

Updates the area and awards points if held.

Implements SCR_CaptureArea.

◆ OnInit()

override void SCR_CaptureAndHoldArea.OnInit ( IEntity  owner)
protected

Initialize this area and register it to parent manager.

Implements SCR_CaptureArea.

◆ OnOwningFactionChanged()

override void SCR_CaptureAndHoldArea.OnOwningFactionChanged ( Faction  previousFaction,
Faction  newFaction 
)
protected

Occurs on change of owning faction 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.

Implements SCR_CaptureArea.

◆ OnTick()

void SCR_CaptureAndHoldArea.OnTick ( )
protected

Called when point ticks, ie.

when score should be awarded Authority only.

◆ Rpc_SetContestingFaction_BC()

void SCR_CaptureAndHoldArea.Rpc_SetContestingFaction_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_CaptureAndHoldArea.RplLoad ( ScriptBitReader  reader)
protected

Called when Item is initialized from replication stream. Carries the data from Master.

Implements SCR_CaptureArea.

◆ RplSave()

override bool SCR_CaptureAndHoldArea.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.

Implements SCR_CaptureArea.

◆ SetContestingFactionInternal()

void SCR_CaptureAndHoldArea.SetContestingFactionInternal ( Faction  previousFaction,
Faction  newFaction 
)
protected

Sets internal owner faction and raises corresponding callback.

◆ UpdateMapDescriptor()

void SCR_CaptureAndHoldArea.UpdateMapDescriptor ( SCR_MapDescriptorComponent  target)
protected

Updates objective map descriptor for this area with current state.

Parameters
targetTarget map descriptor to initialize as this area

Member Data Documentation

◆ m_bIsMajor

bool SCR_CaptureAndHoldArea.m_bIsMajor

◆ m_ContestingFaction

Faction SCR_CaptureAndHoldArea.m_ContestingFaction
protected

The faction that currently attacking/contesting this point in relation to the owner faction.

◆ m_fContestingRatio

float SCR_CaptureAndHoldArea.m_fContestingRatio

◆ m_fTickRate

float SCR_CaptureAndHoldArea.m_fTickRate

◆ m_fTickTime

float SCR_CaptureAndHoldArea.m_fTickTime

Elapsed time.

◆ m_iScorePerTick

int SCR_CaptureAndHoldArea.m_iScorePerTick

◆ m_iScorePerTickContested

int SCR_CaptureAndHoldArea.m_iScorePerTickContested

◆ m_MapDescriptor

SCR_MapDescriptorComponent SCR_CaptureAndHoldArea.m_MapDescriptor
protected

Attached map descriptor component used for visualization (if any) or null if none.

◆ m_OnTickEvent

ref CaptureAreaTickEvent SCR_CaptureAndHoldArea.m_OnTickEvent = new CaptureAreaTickEvent()
protected

Callback for when a tick event is raised by this area.

◆ m_sAreaSymbol

LocalizedString SCR_CaptureAndHoldArea.m_sAreaSymbol

◆ m_vObjectiveCenter

vector SCR_CaptureAndHoldArea.m_vObjectiveCenter

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