Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SCR_GameModeEditor Interface Reference
Inheritance diagram for SCR_GameModeEditor:
[legend]

Public Member Functions

EGameModeEditorTarget GetGameMasterTarget ()
 Get game master target which dictates how players obtain their GM rights.
 
override void OnPlayerKilled (int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
 Default player kill behaviour. Called when a player is killed (and HandlePlayerKilled returns true).
 
override void OnPlayerDeleted (int playerId, IEntity player)
 
override void OnGameStart ()
 Gets called after world is initialized but before first ticks.
 
override void OnGameEnd ()
 
void SCR_GameModeEditor (IEntitySource src, IEntity parent)
 
void ~SCR_GameModeEditor ()
 
- Public Member Functions inherited from SCR_BaseGameMode
bool IsResourceTypeEnabled (EResourceType resourceType=EResourceType.SUPPLIES)
 
int GetDisabledResourceTypes (inout notnull array< EResourceType > disabledResourceTypes)
 
void SetResourceTypeEnabled (bool enable, EResourceType resourceType=EResourceType.SUPPLIES, int playerID=-1)
 Change if supplies are enabled or not.
 
ScriptInvokerBase< SCR_BaseGameMode_OnResourceEnabledChanged > GetOnResourceTypeEnabledChanged ()
 
bool CanStartSpawnPreload ()
 
bool IsRunning ()
 Returns whether current game mode is running its game loop.
 
SCR_EGameModeState GetState ()
 Returns current game state.
 
sealed bool IsMaster ()
 Returns whether the owner of this instance is authority or not.
 
float GetElapsedTime ()
 Returns elapsed time from the start of this game in seconds.
 
float GetTimeLimit ()
 Returns the game duration from the start of game in seconds or 0 if none.
 
float GetRemainingTime ()
 Returns the remaining time of this game in seconds or -1 if none or undefined.
 
bool IsHosted ()
 
void CachePlayerSpawnPosition (int playerID, vector position)
 
SCR_RespawnSystemComponent GetRespawnSystemComponent ()
 Returns respawn system component attached to this gamemode.
 
SCR_GameModeHealthSettings GetGameModeHealthSettings ()
 
SCR_BaseScoringSystemComponent GetScoringSystemComponent ()
 Returns scoring system component attached to this game mode or null if none.
 
void StartGameMode ()
 Server-only call that starts current session.
 
void EndGameMode (SCR_GameModeEndData endData)
 Server-only call that marks current session as complete.
 
SCR_GameModeEndData GetEndGameData ()
 Get end game data will return null if game has not ended.
 
ScriptInvoker GetOnGameStart ()
 
ScriptInvoker GetOnGameEnd ()
 
ScriptInvokerBase< SCR_BaseGameMode_PlayerId > GetOnPlayerAuditSuccess ()
 
ScriptInvokerBase< SCR_BaseGameMode_PlayerId > GetOnPlayerAuditFail ()
 
ScriptInvokerBase< SCR_BaseGameMode_PlayerId > GetOnPlayerAuditTimeouted ()
 
ScriptInvokerBase< SCR_BaseGameMode_PlayerId > GetOnPlayerAuditRevived ()
 
ScriptInvokerBase< SCR_BaseGameMode_PlayerId > GetOnPlayerConnected ()
 
ScriptInvokerBase< SCR_BaseGameMode_PlayerId > GetOnPlayerRegistered ()
 
ScriptInvokerBase< SCR_BaseGameMode_OnPlayerDisconnected > GetOnPlayerDisconnected ()
 
ScriptInvokerBase< SCR_BaseGameMode_OnPlayerDisconnected > GetOnPostCompPlayerDisconnected ()
 Called on player disconnect and after Gamemode components are notified.
 
ScriptInvokerBase< SCR_BaseGameMode_PlayerIdAndEntity > GetOnPlayerSpawned ()
 
ScriptInvokerBase< SCR_BaseGameMode_OnPlayerKilled > GetOnPlayerKilled ()
 
ScriptInvokerBase< SCR_BaseGameMode_PlayerIdAndEntity > GetOnPlayerDeleted ()
 
ScriptInvokerBase< SCR_BaseGameMode_OnPlayerRoleChanged > GetOnPlayerRoleChange ()
 
ScriptInvoker GetOnWorldPostProcess ()
 
ScriptInvoker GetOnControllableSpawned ()
 
ScriptInvoker GetOnControllableDestroyed ()
 
ScriptInvoker GetOnControllableDeleted ()
 
ScriptInvoker GetOnGameModeEnd ()
 Get on game end script invoker called on every machine.
 
WorldTimestamp GetGameEndTimeStamp ()
 Returns local timestamp when endgame was called.
 
float GetAutoReloadDelay ()
 Returns delay of mission reload (if enabled) in seconds or else 0 if disabled.
 
void OnGameEnd ()
 
bool IsFactionChangeAllowed ()
 
override void OnPlayerAuditSuccess (int iPlayerID)
 
override void OnPlayerAuditFail (int iPlayerID)
 
override void OnPlayerAuditTimeouted (int iPlayerID)
 
override void OnPlayerAuditRevived (int iPlayerID)
 
override void OnPlayerConnected (int playerId)
 Called after a player is connected.
 
override void OnWorldPostProcess (World world)
 Called once loading of all entities of the world have been finished (still within the loading)
 
void OnSpawnPlayerEntityFailure_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, IEntity entity, SCR_SpawnData data, SCR_ESpawnResult reason)
 Authority: Callback raised when the spawn process failed.
 
void OnPlayerEntityChanged_S (int playerId, IEntity previousEntity, IEntity newEntity)
 Authority: Callback raised when the spawn system causes provided player's controlled entity to change.
 
bool PreparePlayerEntity_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, IEntity entity)
 Authority only: During the spawn process (after validation pass), the SCR_SpawnHandlerComponent can opt to prepare spawned entity.
 
void OnPlayerSpawnFinalize_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, IEntity entity)
 Authority only: Whenever a SCR_SpawnHandlerComponent processes a spawn request and finished the finalization stage (awaits finalization, passes control to client) this method is called.
 
void OnPlayerSpawnOnPoint_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, IEntity entity, SCR_SpawnPointSpawnData spawnPointData)
 Authority: Callback raised when the spawn system causes provided player to spawn with an entity at given spawn point.
 
void OnPlayerLoadoutSet_S (SCR_PlayerLoadoutComponent loadoutComponent, SCR_BasePlayerLoadout loadout)
 Authority: Callback raised when provided player (SCR_PlayerLoadoutComponent.GetPlayerController()) has their loadout set.
 
void OnPlayerFactionSet_S (SCR_PlayerFactionAffiliationComponent factionComponent, Faction faction)
 Authority: Callback raised when provided player (SCR_PlayerFactionAffiliationComponent.GetPlayerController()) has their faction set.
 
bool CanPlayerSpawn_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, out SCR_ESpawnResult result=SCR_ESpawnResult.SPAWN_NOT_ALLOWED)
 Authority: Override and implement logic for whether provided player can spawn.
 
int GetPlayerRemainingRespawnTime (int playerID)
 Returns remaining respawn time in seconds for given player.
 
override bool RplSave (ScriptBitWriter writer)
 
override bool RplLoad (ScriptBitReader reader)
 
void HandleOnTasksInitialized ()
 Called once tasks are initialized.
 
bool GetAllowControls ()
 
SCR_BaseGameModeStateComponent GetStateComponent (SCR_EGameModeState state)
 
override void EOnFrame (IEntity owner, float timeSlice)
 
override void EOnInit (IEntity owner)
 
OnPreloadFinishedInvoker GetOnPreloadFinished ()
 
void StartSpawnPreload (vector position)
 
void SCR_BaseGameMode (IEntitySource src, IEntity parent)
 
void ~SCR_BaseGameMode ()
 
void OnWorldPostProcess (World world)
 Event called once loading of all entities of the world have been finished. (still within the loading)
 

Protected Member Functions

void OnEditorManagerCreatedServer (SCR_EditorManagerEntity editorManager)
 
void OnEditorManagerDeletedServer (SCR_EditorManagerEntity editorManager)
 
void OnEditorManagerInitOwner (SCR_EditorManagerEntity editorManager)
 
void OnLimitedChanged (bool isLimited)
 
void OnPlayerTerminated (int playerId)
 
- Protected Member Functions inherited from SCR_BaseGameMode
void OnResourceTypeEnabledChanged ()
 \Called when Global Supplies is set to enabled or disabled (Server and client)
 
void OnGameStateChanged ()
 Called when game state changed, i.e.
 
bool CanStartGameMode ()
 Server-only logic that implements whether we can transition from pre-game (if enabled) to game loop.
 
void OnGameModeStart ()
 Called on every machine when game mode starts by OnGameStateChanged.
 
void OnGameModeEnd (SCR_GameModeEndData endData)
 Called on every machine when game mode ends by OnGameStateChanged.
 
void RestartSession ()
 Reloads current session (authority only).
 
override void OnGameStart ()
 Gets called after world is initialized but before first ticks.
 
override void OnPlayerDisconnected (int playerId, KickCauseCode cause, int timeout)
 Called after a player is disconnected.
 
override void OnPlayerRegistered (int playerId)
 Called on every machine after a player is registered (identity, name etc.).
 
override void OnPlayerSpawned (int playerId, IEntity controlledEntity)
 Called after a player is spawned.
 
override bool HandlePlayerKilled (int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
 Called after a player is killed, but before 'OnPlayerKilled'.
 
override void OnPlayerKilled (int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
 Default player kill behaviour. Called when a player is killed (and HandlePlayerKilled returns true).
 
void OnPlayerKilledHandled (int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
 Called after player kill behaviour is handled by a component overriding the generic logic.
 
void OnPlayerDeleted (int playerId, IEntity player)
 
override void OnPlayerRoleChange (int playerId, EPlayerRole roleFlags)
 Called when player role changes.
 
override void OnControllableSpawned (IEntity entity)
 When a controllable entity is spawned, this event is raised.
 
override void OnControllableDestroyed (IEntity entity, IEntity killerEntity, notnull Instigator instigator)
 
override void OnControllableDeleted (IEntity entity)
 
void ConsumeSuppliesOnPlayerSpawn_S (int playerID, IEntity spawnPoint, SCR_PlayerLoadoutComponent loadoutComp)
 
void SetLocalControls (bool enabled)
 Enable or disable controls for the local client.
 
bool GetAllowControlsTarget ()
 
void HandleSpawnPreload (float timeSlice)
 
void OnGameStart ()
 Gets called after world is initialized but before first ticks.
 
void OnPlayerAuditSuccess (int iPlayerID)
 
void OnPlayerAuditFail (int iPlayerID)
 
void OnPlayerAuditTimeouted (int iPlayerID)
 
void OnPlayerAuditRevived (int iPlayerID)
 
void OnPlayerConnected (int playerId)
 Called after a player is connected.
 
void OnPlayerRegistered (int playerId)
 Called on every machine after a player is registered (identity, name etc.).
 
void OnPlayerDisconnected (int playerId, KickCauseCode cause, int timeout)
 Called after a player is disconnected.
 
void OnPlayerSpawned (int playerId, IEntity controlledEntity)
 Called after a player is spawned.
 
bool HandlePlayerKilled (int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
 Called after a player is killed, but before 'OnPlayerKilled'.
 
void OnPlayerKilled (int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
 Called after a player gets killed (but only after 'SCR_HandlePlayerKilled' returns true).
 
void OnControllableSpawned (IEntity entity)
 When a controllable entity is spawned, this event is raised.
 
void OnControllableDestroyed (IEntity entity, IEntity killerEntity, notnull Instigator instigator)
 
void OnControllableDeleted (IEntity entity)
 
void OnPlayerRoleChange (int playerId, EPlayerRole roleFlags)
 Called when player role changes.
 

Protected Attributes

bool m_bAutoInitEditor
 
EGameModeEditorTarget m_GameMasterTarget
 
int m_iPersistentGameMasterPlayerID
 
SCR_EditorManagerCore m_Core
 
- Protected Attributes inherited from SCR_BaseGameMode
ref ScriptInvoker Event_OnGameStart = new ScriptInvoker()
 
ref ScriptInvoker m_OnGameEnd = new ScriptInvoker()
 
ref ScriptInvokerBase< SCR_BaseGameMode_PlayerId > m_OnPlayerAuditSuccess = new ScriptInvokerBase<SCR_BaseGameMode_PlayerId>()
 
ref ScriptInvokerBase< SCR_BaseGameMode_PlayerId > m_OnPlayerAuditFail = new ScriptInvokerBase<SCR_BaseGameMode_PlayerId>()
 
ref ScriptInvokerBase< SCR_BaseGameMode_PlayerId > m_OnPlayerAuditTimeouted = new ScriptInvokerBase<SCR_BaseGameMode_PlayerId>()
 
ref ScriptInvokerBase< SCR_BaseGameMode_PlayerId > m_OnPlayerAuditRevived = new ScriptInvokerBase<SCR_BaseGameMode_PlayerId>()
 
ref ScriptInvokerBase< SCR_BaseGameMode_PlayerId > m_OnPlayerConnected = new ScriptInvokerBase<SCR_BaseGameMode_PlayerId>()
 
ref ScriptInvokerBase< SCR_BaseGameMode_PlayerId > m_OnPlayerRegistered = new ScriptInvokerBase<SCR_BaseGameMode_PlayerId>()
 
ref ScriptInvokerBase< SCR_BaseGameMode_OnPlayerDisconnected > m_OnPlayerDisconnected = new ScriptInvokerBase<SCR_BaseGameMode_OnPlayerDisconnected>()
 
ref ScriptInvokerBase< SCR_BaseGameMode_OnPlayerDisconnected > m_OnPostCompPlayerDisconnected = new ScriptInvokerBase<SCR_BaseGameMode_OnPlayerDisconnected>()
 
ref ScriptInvokerBase< SCR_BaseGameMode_PlayerIdAndEntity > m_OnPlayerSpawned = new ScriptInvokerBase<SCR_BaseGameMode_PlayerIdAndEntity>()
 
ref ScriptInvokerBase< SCR_BaseGameMode_OnPlayerKilled > m_OnPlayerKilled = new ScriptInvokerBase<SCR_BaseGameMode_OnPlayerKilled>()
 
ref ScriptInvokerBase< SCR_BaseGameMode_PlayerIdAndEntity > m_OnPlayerDeleted = new ScriptInvokerBase<SCR_BaseGameMode_PlayerIdAndEntity>()
 
ref ScriptInvokerBase< SCR_BaseGameMode_OnPlayerRoleChanged > m_OnPlayerRoleChange = new ScriptInvokerBase<SCR_BaseGameMode_OnPlayerRoleChanged>()
 
ref ScriptInvoker m_OnWorldPostProcess = new ScriptInvoker()
 
ref ScriptInvoker m_OnControllableSpawned = new ScriptInvoker()
 
ref ScriptInvoker m_OnControllableDestroyed = new ScriptInvoker()
 
ref ScriptInvoker m_OnControllableDeleted = new ScriptInvoker()
 
ref ScriptInvoker m_OnGameModeEnd = new ScriptInvoker()
 
ref ScriptInvokerBase< SCR_BaseGameMode_OnResourceEnabledChanged > m_OnResourceTypeEnabledChanged
 
EGameFlags m_eTestGameFlags
 
bool m_bAutoPlayerRespawn
 
bool m_bAllowFactionChange
 
bool m_bAdvanceTimeRequiresPlayers
 
float m_fTimeElapsed
 Elapsed time from the beginning of the game mode in seconds.
 
bool m_bAllowControls = true
 If false, controls are disable for the time being.
 
float m_fTimeCorrectionInterval = 10.0
 Interval of time synchronization in seconds.
 
float m_fLastTimeCorrection
 Last timestamp of sent time correction for the server.
 
bool m_bIsHosted
 Is the session hosted by a player?
 
RplComponent m_RplComponent
 
SCR_GameModeHealthSettings m_pGameModeHealthSettings
 
SCR_RespawnSystemComponent m_pRespawnSystemComponent
 
SCR_BaseScoringSystemComponent m_ScoringSystemComponent
 
SCR_RespawnTimerComponent m_RespawnTimerComponent
 
ref array< SCR_BaseGameModeComponentm_aAdditionalGamemodeComponents = new array<SCR_BaseGameModeComponent>()
 Additional game mode components attached to this gamemode where we dispatch all our game mode related events to.
 
ref map< int, vector > m_mPlayerSpawnPosition = new map<int, vector>()
 Used on server to respawn player on their original position after reconnecting.
 
ref map< SCR_EGameModeState, SCR_BaseGameModeStateComponentm_mStateComponents = new map<SCR_EGameModeState, SCR_BaseGameModeStateComponent>()
 Map of components per state.
 
bool m_bUseSpawnPreload
 Spawn location preload.
 
ref SCR_SpawnPreload m_SpawnPreload
 
ref OnPreloadFinishedInvoker m_OnPreloadFinished
 
ref array< EResourceType > m_aDisabledResourceTypes
 
WorldTimestamp m_GameEndTimeStamp = null
 

Additional Inherited Members

- Static Public Attributes inherited from SCR_BaseGameMode
const static string WB_GAME_MODE_CATEGORY = "Game Mode"
 

Detailed Description

Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.0/A4Data/scripts/Game/GameMode/SCR_GameModeEditor.c.

Constructor & Destructor Documentation

◆ SCR_GameModeEditor()

void SCR_GameModeEditor.SCR_GameModeEditor ( IEntitySource  src,
IEntity  parent 
)

◆ ~SCR_GameModeEditor()

void SCR_GameModeEditor.~SCR_GameModeEditor ( )

Member Function Documentation

◆ GetGameMasterTarget()

EGameModeEditorTarget SCR_GameModeEditor.GetGameMasterTarget ( )

Get game master target which dictates how players obtain their GM rights.

Note that target might be forced to change on evaluate on server if set on voting is enabled and the player is hosting Main use is to check if target == EVERYBODY or NOBODY

Returns
EGameModeEditorTarget enum holding the information regarding the target type
Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.0/A4Data/scripts/Game/GameMode/SCR_GameModeEditor.c.

◆ OnEditorManagerCreatedServer()

void SCR_GameModeEditor.OnEditorManagerCreatedServer ( SCR_EditorManagerEntity  editorManager)
protected

◆ OnEditorManagerDeletedServer()

void SCR_GameModeEditor.OnEditorManagerDeletedServer ( SCR_EditorManagerEntity  editorManager)
protected

◆ OnEditorManagerInitOwner()

void SCR_GameModeEditor.OnEditorManagerInitOwner ( SCR_EditorManagerEntity  editorManager)
protected

◆ OnGameEnd()

override void SCR_GameModeEditor.OnGameEnd ( )

◆ OnGameStart()

override void SCR_GameModeEditor.OnGameStart ( )

Gets called after world is initialized but before first ticks.

Implements SCR_BaseGameMode.

Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.0/A4Data/scripts/Game/GameMode/SCR_GameModeEditor.c.

◆ OnLimitedChanged()

void SCR_GameModeEditor.OnLimitedChanged ( bool  isLimited)
protected

◆ OnPlayerDeleted()

override void SCR_GameModeEditor.OnPlayerDeleted ( int  playerId,
IEntity  player 
)

◆ OnPlayerKilled()

override void SCR_GameModeEditor.OnPlayerKilled ( int  playerId,
IEntity  playerEntity,
IEntity  killerEntity,
notnull Instigator  killer 
)

Default player kill behaviour. Called when a player is killed (and HandlePlayerKilled returns true).

Implements SCR_BaseGameMode.

Examples
d:/jenkins/workspace/ar_data_branches_stable_1.2.0/A4Data/scripts/Game/GameMode/SCR_GameModeEditor.c.

◆ OnPlayerTerminated()

void SCR_GameModeEditor.OnPlayerTerminated ( int  playerId)
protected

Member Data Documentation

◆ m_bAutoInitEditor

bool SCR_GameModeEditor.m_bAutoInitEditor
protected

◆ m_Core

SCR_EditorManagerCore SCR_GameModeEditor.m_Core
protected

◆ m_GameMasterTarget

EGameModeEditorTarget SCR_GameModeEditor.m_GameMasterTarget
protected

◆ m_iPersistentGameMasterPlayerID

int SCR_GameModeEditor.m_iPersistentGameMasterPlayerID
protected

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