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

Spawn point entity defines positions on which players can possibly spawn. More...

Inheritance diagram for SCR_SpawnPoint:
[legend]

Public Member Functions

bool IsSpawnPointVisibleForPlayer (int pid)
 
bool IsSpawnPointEnabled ()
 
void SetSpawnPointEnabled_S (bool enabled)
 
ScriptInvokerBool GetOnSpawnPointEnabled ()
 
float GetRespawnTime ()
 
void SetRespawnTime (float time)
 
bool CanReserveFor_S (int playerId, out SCR_ESpawnResult result=SCR_ESpawnResult.SPAWN_NOT_ALLOWED)
 Authority: Returns whether this point can be reserved for provided player.
 
bool IsReservedFor_S (int playerId)
 Authority: Returns whether this point is currently reserved for provided player.
 
bool ReserveFor_S (int playerId)
 Authority: Returns whether this point is currently reserved for provided player.
 
void ClearReservationFor_S (int playerId)
 Authority: Clears reservation for provided player.
 
float GetSpawnRadius ()
 
void SetSpawnRadius (float radius)
 
RplId GetRplId ()
 Returns RplId of this spawn point.
 
void SetUseNearbySpawnPositions (bool use)
 
void GetPositionAndRotation (out vector pos, out vector rot)
 
bool IsSpawnPointActive ()
 
bool GetVisibleInDeployMapOnly ()
 
void SetVisibleInDeployMapOnly (bool visible)
 
void SetFaction (Faction faction)
 
void SetFactionKey (string factionKey)
 
void SetSpawnPositionRange (float range)
 
float GetSpawnPositionRange ()
 
array< SCR_PositionGetChildSpawnPoints ()
 
string GetFactionKey ()
 
SCR_UIInfo GetInfo ()
 
void SetInfo (SCR_UIInfo info)
 
string GetSpawnPointName ()
 
void SetSpawnPointName (string name)
 
bool IsTimed ()
 
void SetIsTimed (bool isTimed)
 
void LinkInfo (SCR_UIInfo info)
 
override void SetColorAndText ()
 
bool PrepareSpawnedEntity_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data, IEntity entity)
 
bool CanFinalizeSpawn_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data, IEntity entity)
 Authority: The PrepareEntity_S step might start doing an operation which is not performed immediately, for such cases we can await the finalization by returning 'false', until spawned entity is in desired state.
 
void OnFinalizeSpawnDone_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data, IEntity entity)
 Authority: Callback for when finalization is done, e.g.
 
override void EOnInit (IEntity owner)
 
override bool RplSave (ScriptBitWriter writer)
 
void SCR_SpawnPoint (IEntitySource src, IEntity parent)
 
void ~SCR_SpawnPoint ()
 
- Public Member Functions inherited from SCR_Position
void SetColorAndText ()
 
override void _WB_AfterWorldUpdate (float timeSlice)
 
void SCR_Position (IEntitySource src, IEntity parent)
 

Static Public Member Functions

static SCR_SpawnPointFinalizeSpawn_Invoker GetOnSpawnPointFinalizeSpawn ()
 
static void ShowSpawnPointDescriptors (bool show, Faction faction)
 
static SCR_SpawnPoint GetSpawnPointByRplId (RplId id)
 
static SCR_SpawnPoint GetSpawnPointByIndex (int spawnPointIndex)
 Return spawn point or null if out of bounds.
 
static int GetSpawnPointIndex (SCR_SpawnPoint spawnPoint)
 Return spawn point index or -1 if not existant.
 
static int CountSpawnPoints ()
 
static array< SCR_SpawnPointGetSpawnPoints ()
 
static SCR_SpawnPoint GetRandomSpawnPointDeathmatch ()
 
static SCR_SpawnPoint GetRandomSpawnPoint (SCR_ChimeraCharacter character)
 
static array< SCR_SpawnPointGetSpawnPointsForPlayer (SCR_ChimeraCharacter character)
 
static array< SCR_SpawnPointGetSpawnPointsForFaction (string factionKey)
 Get spawn points valid for given faction.
 
static int GetSpawnPointCountForFaction (string factionKey)
 Get count of spawn points belonging to given faction.
 
static SCR_SpawnPoint GetRandomSpawnPointForFaction (string factionKey)
 

Static Public Attributes

static ref ScriptInvoker Event_OnSpawnPointCountChanged = new ScriptInvoker()
 
static ref ScriptInvoker Event_SpawnPointFactionAssigned = new ScriptInvoker()
 
static ref SpawnPointInvoker Event_SpawnPointAdded = new SpawnPointInvoker()
 
static ref SpawnPointInvoker Event_SpawnPointRemoved = new SpawnPointInvoker()
 
static ref SCR_SpawnPointFinalizeSpawn_Invoker s_OnSpawnPointFinalizeSpawn
 
static ref SCR_SpawnPointNameChanged_Invoker OnSpawnPointNameChanged = new SCR_SpawnPointNameChanged_Invoker()
 

Protected Member Functions

void OnSetEnabled ()
 
bool GetEmptyPositionAndRotationInRange (out vector pos, out vector rot)
 
void ApplyFactionChange (FactionAffiliationComponent owner, Faction previousFaction, Faction newFaction)
 
void OnSetFactionKey ()
 
void InitFactionAffiliation (IEntity owner)
 
override bool RplLoad (ScriptBitReader reader)
 

Protected Attributes

RplComponent m_RplComponent
 
float m_fSpawnRadius
 
string m_sFaction
 
bool m_bShowInDeployMapOnly
 
bool m_bTimedSpawnPoint
 
SCR_UIInfo m_LinkedInfo
 
SCR_FactionAffiliationComponent m_FactionAffiliationComponent
 
ref SCR_UIInfo m_Info
 
bool m_bUseNearbySpawnPositions
 
float m_fSpawnPositionUsageRange
 
float m_fRespawnTime
 
string m_sSpawnPointName
 
ref array< SCR_Positionm_aChildren = {}
 
ref set< int > m_ReservationLocks = new set<int>()
 Authority: Set of all pending players that have a reservation for this spawn point.
 
ref ScriptInvokerBool m_OnSetSpawnPointEnabled
 
bool m_bSpawnPointEnabled
 
- Protected Attributes inherited from SCR_Position
int m_iColor = Color.WHITE
 
string m_sText = string.Empty
 

Detailed Description

Spawn point entity defines positions on which players can possibly spawn.

Constructor & Destructor Documentation

◆ SCR_SpawnPoint()

void SCR_SpawnPoint.SCR_SpawnPoint ( IEntitySource  src,
IEntity  parent 
)

◆ ~SCR_SpawnPoint()

void SCR_SpawnPoint.~SCR_SpawnPoint ( )

Member Function Documentation

◆ ApplyFactionChange()

void SCR_SpawnPoint.ApplyFactionChange ( FactionAffiliationComponent  owner,
Faction  previousFaction,
Faction  newFaction 
)
protected

◆ CanFinalizeSpawn_S()

bool SCR_SpawnPoint.CanFinalizeSpawn_S ( SCR_SpawnRequestComponent  requestComponent,
SCR_SpawnData  data,
IEntity  entity 
)

Authority: The PrepareEntity_S step might start doing an operation which is not performed immediately, for such cases we can await the finalization by returning 'false', until spawned entity is in desired state.

(E.g. upon seating a character we can await until character is properly seated)

Following a successful preparation is CanSpawnFinalize_S, and SpawnFinalize_S after which the process is sucessfully ended.

Parameters
requestComponentPlayer request component
dataData received for this request
entitySpawned entity (to await)
Returns
True if ready, false (to await a frame).

Implemented in SCR_PlayerSpawnPoint.

◆ CanReserveFor_S()

bool SCR_SpawnPoint.CanReserveFor_S ( int  playerId,
out SCR_ESpawnResult  result = SCR_ESpawnResult::SPAWN_NOT_ALLOWED 
)

Authority: Returns whether this point can be reserved for provided player.

Derived logic can e.g. check amount of pending locks versus available compartments for vehicle spawn points and similar.

Parameters
playerIdPlayerId of player who wants to reserve this point
[out]resultReason why respawn is disabled. Note that if returns true the reason will always be OK
Returns
Return true if reservation can proceed, false otherwise.

Implemented in SCR_RestrictedDeployableSpawnPoint, SCR_PlayerSpawnPoint, and SCR_RadioVehicleSpawnPoint.

◆ ClearReservationFor_S()

void SCR_SpawnPoint.ClearReservationFor_S ( int  playerId)

Authority: Clears reservation for provided player.

Parameters
playerIdPlayerId of player to check reservation for.

◆ CountSpawnPoints()

static int SCR_SpawnPoint.CountSpawnPoints ( )
static
Returns
Number of spawn points in the world

◆ EOnInit()

override void SCR_SpawnPoint.EOnInit ( IEntity  owner)

Implemented in SCR_RadioVehicleSpawnPoint.

◆ GetChildSpawnPoints()

array< SCR_Position > SCR_SpawnPoint.GetChildSpawnPoints ( )

◆ GetEmptyPositionAndRotationInRange()

bool SCR_SpawnPoint.GetEmptyPositionAndRotationInRange ( out vector  pos,
out vector  rot 
)
protected

◆ GetFactionKey()

string SCR_SpawnPoint.GetFactionKey ( )
Returns
string name of the faction of the spawn point.

◆ GetInfo()

SCR_UIInfo SCR_SpawnPoint.GetInfo ( )

◆ GetOnSpawnPointEnabled()

ScriptInvokerBool SCR_SpawnPoint.GetOnSpawnPointEnabled ( )

◆ GetOnSpawnPointFinalizeSpawn()

static SCR_SpawnPointFinalizeSpawn_Invoker SCR_SpawnPoint.GetOnSpawnPointFinalizeSpawn ( )
static

◆ GetPositionAndRotation()

void SCR_SpawnPoint.GetPositionAndRotation ( out vector  pos,
out vector  rot 
)

Implemented in SCR_PlayerSpawnPoint.

◆ GetRandomSpawnPoint()

static SCR_SpawnPoint SCR_SpawnPoint.GetRandomSpawnPoint ( SCR_ChimeraCharacter  character)
static
Returns
random spawn point for a character.

◆ GetRandomSpawnPointDeathmatch()

static SCR_SpawnPoint SCR_SpawnPoint.GetRandomSpawnPointDeathmatch ( )
static
Returns
random spawn point without limitations.

◆ GetRandomSpawnPointForFaction()

static SCR_SpawnPoint SCR_SpawnPoint.GetRandomSpawnPointForFaction ( string  factionKey)
static
Returns
random spawn point valid for a specific faction.

◆ GetRespawnTime()

float SCR_SpawnPoint.GetRespawnTime ( )

◆ GetRplId()

RplId SCR_SpawnPoint.GetRplId ( )

Returns RplId of this spawn point.

◆ GetSpawnPointByIndex()

static SCR_SpawnPoint SCR_SpawnPoint.GetSpawnPointByIndex ( int  spawnPointIndex)
static

Return spawn point or null if out of bounds.

◆ GetSpawnPointByRplId()

static SCR_SpawnPoint SCR_SpawnPoint.GetSpawnPointByRplId ( RplId  id)
static

◆ GetSpawnPointCountForFaction()

static int SCR_SpawnPoint.GetSpawnPointCountForFaction ( string  factionKey)
static

Get count of spawn points belonging to given faction.

Parameters
factionKeyValid faction key
Returns
Number of spawn points

◆ GetSpawnPointIndex()

static int SCR_SpawnPoint.GetSpawnPointIndex ( SCR_SpawnPoint  spawnPoint)
static

Return spawn point index or -1 if not existant.

◆ GetSpawnPointName()

string SCR_SpawnPoint.GetSpawnPointName ( )

◆ GetSpawnPoints()

static array< SCR_SpawnPoint > SCR_SpawnPoint.GetSpawnPoints ( )
static
Returns
an array of all spawn point entities.

◆ GetSpawnPointsForFaction()

static array< SCR_SpawnPoint > SCR_SpawnPoint.GetSpawnPointsForFaction ( string  factionKey)
static

Get spawn points valid for given faction.

Parameters
factionKeyValid faction key

◆ GetSpawnPointsForPlayer()

static array< SCR_SpawnPoint > SCR_SpawnPoint.GetSpawnPointsForPlayer ( SCR_ChimeraCharacter  character)
static
Returns
spawn points valid for for local player.

◆ GetSpawnPositionRange()

float SCR_SpawnPoint.GetSpawnPositionRange ( )

◆ GetSpawnRadius()

float SCR_SpawnPoint.GetSpawnRadius ( )
Returns
Radius in which players can be spawned on empty position.

◆ GetVisibleInDeployMapOnly()

bool SCR_SpawnPoint.GetVisibleInDeployMapOnly ( )

◆ InitFactionAffiliation()

void SCR_SpawnPoint.InitFactionAffiliation ( IEntity  owner)
protected

Implemented in SCR_RadioVehicleSpawnPoint.

◆ IsReservedFor_S()

bool SCR_SpawnPoint.IsReservedFor_S ( int  playerId)

Authority: Returns whether this point is currently reserved for provided player.

Parameters
playerIdPlayerId of player to check reservation for.
Returns
Return true if reservation can proceed, false otherwise.

◆ IsSpawnPointActive()

bool SCR_SpawnPoint.IsSpawnPointActive ( )

Implemented in SCR_PlayerSpawnPoint.

◆ IsSpawnPointEnabled()

bool SCR_SpawnPoint.IsSpawnPointEnabled ( )

Implemented in SCR_RadioVehicleSpawnPoint.

◆ IsSpawnPointVisibleForPlayer()

bool SCR_SpawnPoint.IsSpawnPointVisibleForPlayer ( int  pid)

◆ IsTimed()

bool SCR_SpawnPoint.IsTimed ( )

◆ LinkInfo()

void SCR_SpawnPoint.LinkInfo ( SCR_UIInfo  info)

◆ OnFinalizeSpawnDone_S()

void SCR_SpawnPoint.OnFinalizeSpawnDone_S ( SCR_SpawnRequestComponent  requestComponent,
SCR_SpawnData  data,
IEntity  entity 
)

Authority: Callback for when finalization is done, e.g.

the ownership is passed to the client and the spawn process is deemed complete.

Implemented in SCR_DeployableSpawnPoint, SCR_RestrictedDeployableSpawnPoint, and SCR_PlayerSpawnPoint.

◆ OnSetEnabled()

void SCR_SpawnPoint.OnSetEnabled ( )
protected

◆ OnSetFactionKey()

void SCR_SpawnPoint.OnSetFactionKey ( )
protected

◆ PrepareSpawnedEntity_S()

bool SCR_SpawnPoint.PrepareSpawnedEntity_S ( SCR_SpawnRequestComponent  requestComponent,
SCR_SpawnData  data,
IEntity  entity 
)

Implemented in SCR_PlayerSpawnPoint.

◆ ReserveFor_S()

bool SCR_SpawnPoint.ReserveFor_S ( int  playerId)

Authority: Returns whether this point is currently reserved for provided player.

Parameters
playerIdPlayerId of player to check reservation for.
Returns
Return true if reservation can proceed, false otherwise.

◆ RplLoad()

override bool SCR_SpawnPoint.RplLoad ( ScriptBitReader  reader)
protected

◆ RplSave()

override bool SCR_SpawnPoint.RplSave ( ScriptBitWriter  writer)

◆ SetColorAndText()

override void SCR_SpawnPoint.SetColorAndText ( )

Implements SCR_Position.

◆ SetFaction()

void SCR_SpawnPoint.SetFaction ( Faction  faction)

◆ SetFactionKey()

void SCR_SpawnPoint.SetFactionKey ( string  factionKey)

◆ SetInfo()

void SCR_SpawnPoint.SetInfo ( SCR_UIInfo  info)

◆ SetIsTimed()

void SCR_SpawnPoint.SetIsTimed ( bool  isTimed)

◆ SetRespawnTime()

void SCR_SpawnPoint.SetRespawnTime ( float  time)

◆ SetSpawnPointEnabled_S()

void SCR_SpawnPoint.SetSpawnPointEnabled_S ( bool  enabled)

◆ SetSpawnPointName()

void SCR_SpawnPoint.SetSpawnPointName ( string  name)

◆ SetSpawnPositionRange()

void SCR_SpawnPoint.SetSpawnPositionRange ( float  range)

◆ SetSpawnRadius()

void SCR_SpawnPoint.SetSpawnRadius ( float  radius)

◆ SetUseNearbySpawnPositions()

void SCR_SpawnPoint.SetUseNearbySpawnPositions ( bool  use)

◆ SetVisibleInDeployMapOnly()

void SCR_SpawnPoint.SetVisibleInDeployMapOnly ( bool  visible)

◆ ShowSpawnPointDescriptors()

static void SCR_SpawnPoint.ShowSpawnPointDescriptors ( bool  show,
Faction  faction 
)
static

Member Data Documentation

◆ Event_OnSpawnPointCountChanged

ref ScriptInvoker SCR_SpawnPoint.Event_OnSpawnPointCountChanged = new ScriptInvoker()
static

◆ Event_SpawnPointAdded

ref SpawnPointInvoker SCR_SpawnPoint.Event_SpawnPointAdded = new SpawnPointInvoker()
static

◆ Event_SpawnPointFactionAssigned

ref ScriptInvoker SCR_SpawnPoint.Event_SpawnPointFactionAssigned = new ScriptInvoker()
static

◆ Event_SpawnPointRemoved

ref SpawnPointInvoker SCR_SpawnPoint.Event_SpawnPointRemoved = new SpawnPointInvoker()
static

◆ m_aChildren

ref array<SCR_Position> SCR_SpawnPoint.m_aChildren = {}
protected

◆ m_bShowInDeployMapOnly

bool SCR_SpawnPoint.m_bShowInDeployMapOnly
protected

◆ m_bSpawnPointEnabled

bool SCR_SpawnPoint.m_bSpawnPointEnabled
protected

◆ m_bTimedSpawnPoint

bool SCR_SpawnPoint.m_bTimedSpawnPoint
protected

◆ m_bUseNearbySpawnPositions

bool SCR_SpawnPoint.m_bUseNearbySpawnPositions
protected

◆ m_FactionAffiliationComponent

SCR_FactionAffiliationComponent SCR_SpawnPoint.m_FactionAffiliationComponent
protected

◆ m_fRespawnTime

float SCR_SpawnPoint.m_fRespawnTime
protected

◆ m_fSpawnPositionUsageRange

float SCR_SpawnPoint.m_fSpawnPositionUsageRange
protected

◆ m_fSpawnRadius

float SCR_SpawnPoint.m_fSpawnRadius
protected

◆ m_Info

ref SCR_UIInfo SCR_SpawnPoint.m_Info
protected

◆ m_LinkedInfo

SCR_UIInfo SCR_SpawnPoint.m_LinkedInfo
protected

◆ m_OnSetSpawnPointEnabled

ref ScriptInvokerBool SCR_SpawnPoint.m_OnSetSpawnPointEnabled
protected

◆ m_ReservationLocks

ref set<int> SCR_SpawnPoint.m_ReservationLocks = new set<int>()
protected

Authority: Set of all pending players that have a reservation for this spawn point.

◆ m_RplComponent

RplComponent SCR_SpawnPoint.m_RplComponent
protected

◆ m_sFaction

string SCR_SpawnPoint.m_sFaction
protected

◆ m_sSpawnPointName

string SCR_SpawnPoint.m_sSpawnPointName
protected

◆ OnSpawnPointNameChanged

ref SCR_SpawnPointNameChanged_Invoker SCR_SpawnPoint.OnSpawnPointNameChanged = new SCR_SpawnPointNameChanged_Invoker()
static

◆ s_OnSpawnPointFinalizeSpawn

ref SCR_SpawnPointFinalizeSpawn_Invoker SCR_SpawnPoint.s_OnSpawnPointFinalizeSpawn
static

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