Arma Reforger Script API
|
Spawn point entity defines positions on which players can possibly spawn. More...
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_Position > | GetChildSpawnPoints () |
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_SpawnPoint > | GetSpawnPoints () |
static SCR_SpawnPoint | GetRandomSpawnPointDeathmatch () |
static SCR_SpawnPoint | GetRandomSpawnPoint (SCR_ChimeraCharacter character) |
static array< SCR_SpawnPoint > | GetSpawnPointsForPlayer (SCR_ChimeraCharacter character) |
static array< SCR_SpawnPoint > | GetSpawnPointsForFaction (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_Position > | m_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 |
Spawn point entity defines positions on which players can possibly spawn.
void SCR_SpawnPoint.SCR_SpawnPoint | ( | IEntitySource | src, |
IEntity | parent | ||
) |
void SCR_SpawnPoint.~SCR_SpawnPoint | ( | ) |
|
protected |
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.
requestComponent | Player request component |
data | Data received for this request |
entity | Spawned entity (to await) |
Implemented in SCR_PlayerSpawnPoint.
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.
playerId | PlayerId of player who wants to reserve this point | |
[out] | result | Reason why respawn is disabled. Note that if returns true the reason will always be OK |
Implemented in SCR_RestrictedDeployableSpawnPoint, SCR_PlayerSpawnPoint, and SCR_RadioVehicleSpawnPoint.
void SCR_SpawnPoint.ClearReservationFor_S | ( | int | playerId | ) |
Authority: Clears reservation for provided player.
playerId | PlayerId of player to check reservation for. |
|
static |
override void SCR_SpawnPoint.EOnInit | ( | IEntity | owner | ) |
Implemented in SCR_RadioVehicleSpawnPoint.
array< SCR_Position > SCR_SpawnPoint.GetChildSpawnPoints | ( | ) |
|
protected |
string SCR_SpawnPoint.GetFactionKey | ( | ) |
SCR_UIInfo SCR_SpawnPoint.GetInfo | ( | ) |
ScriptInvokerBool SCR_SpawnPoint.GetOnSpawnPointEnabled | ( | ) |
|
static |
void SCR_SpawnPoint.GetPositionAndRotation | ( | out vector | pos, |
out vector | rot | ||
) |
Implemented in SCR_PlayerSpawnPoint.
|
static |
|
static |
|
static |
float SCR_SpawnPoint.GetRespawnTime | ( | ) |
RplId SCR_SpawnPoint.GetRplId | ( | ) |
Returns RplId of this spawn point.
|
static |
Return spawn point or null if out of bounds.
|
static |
|
static |
Get count of spawn points belonging to given faction.
factionKey | Valid faction key |
|
static |
Return spawn point index or -1 if not existant.
string SCR_SpawnPoint.GetSpawnPointName | ( | ) |
Implemented in SCR_CampaignSpawnPointGroup, and SCR_PlayerSpawnPoint.
|
static |
|
static |
Get spawn points valid for given faction.
factionKey | Valid faction key |
|
static |
float SCR_SpawnPoint.GetSpawnPositionRange | ( | ) |
float SCR_SpawnPoint.GetSpawnRadius | ( | ) |
bool SCR_SpawnPoint.GetVisibleInDeployMapOnly | ( | ) |
|
protected |
Implemented in SCR_RadioVehicleSpawnPoint.
bool SCR_SpawnPoint.IsReservedFor_S | ( | int | playerId | ) |
Authority: Returns whether this point is currently reserved for provided player.
playerId | PlayerId of player to check reservation for. |
bool SCR_SpawnPoint.IsSpawnPointActive | ( | ) |
Implemented in SCR_PlayerSpawnPoint.
bool SCR_SpawnPoint.IsSpawnPointEnabled | ( | ) |
Implemented in SCR_RadioVehicleSpawnPoint.
bool SCR_SpawnPoint.IsSpawnPointVisibleForPlayer | ( | int | pid | ) |
Implemented in SCR_RestrictedDeployableSpawnPoint.
bool SCR_SpawnPoint.IsTimed | ( | ) |
void SCR_SpawnPoint.LinkInfo | ( | SCR_UIInfo | info | ) |
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.
|
protected |
|
protected |
bool SCR_SpawnPoint.PrepareSpawnedEntity_S | ( | SCR_SpawnRequestComponent | requestComponent, |
SCR_SpawnData | data, | ||
IEntity | entity | ||
) |
Implemented in SCR_PlayerSpawnPoint.
bool SCR_SpawnPoint.ReserveFor_S | ( | int | playerId | ) |
Authority: Returns whether this point is currently reserved for provided player.
playerId | PlayerId of player to check reservation for. |
|
protected |
override bool SCR_SpawnPoint.RplSave | ( | ScriptBitWriter | writer | ) |
override void SCR_SpawnPoint.SetColorAndText | ( | ) |
Implements SCR_Position.
void SCR_SpawnPoint.SetFaction | ( | Faction | faction | ) |
void SCR_SpawnPoint.SetFactionKey | ( | string | factionKey | ) |
void SCR_SpawnPoint.SetInfo | ( | SCR_UIInfo | info | ) |
void SCR_SpawnPoint.SetIsTimed | ( | bool | isTimed | ) |
void SCR_SpawnPoint.SetRespawnTime | ( | float | time | ) |
void SCR_SpawnPoint.SetSpawnPointEnabled_S | ( | bool | enabled | ) |
void SCR_SpawnPoint.SetSpawnPointName | ( | string | name | ) |
void SCR_SpawnPoint.SetSpawnPositionRange | ( | float | range | ) |
void SCR_SpawnPoint.SetSpawnRadius | ( | float | radius | ) |
void SCR_SpawnPoint.SetUseNearbySpawnPositions | ( | bool | use | ) |
void SCR_SpawnPoint.SetVisibleInDeployMapOnly | ( | bool | visible | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Authority: Set of all pending players that have a reservation for this spawn point.
|
protected |
|
protected |
|
protected |
|
static |
|
static |