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_GameModeCampaign Interface Reference
Inheritance diagram for SCR_GameModeCampaign:
[legend]

Public Member Functions

ScriptInvoker GetOnFactionAssignedLocalPlayer ()
 Triggered when the local player picks a faction.
 
ScriptInvoker GetOnStarted ()
 Triggered when Conflict gamemode has started.
 
ScriptInvoker GetOnMatchSituationChanged ()
 Triggered when an event happened which should be communicated to players (i.e. amount of control points held etc.)
 
ScriptInvoker GetOnCallsignOffsetChanged ()
 
int GetSuppliesReplenishThreshold ()
 
int GetQuickSuppliesReplenishThreshold ()
 
float GetQuickSuppliesReplenishMultiplier ()
 
int GetSuppliesArrivalInterval ()
 
int GetRegularSuppliesIncome ()
 
int GetRegularSuppliesIncomeBase ()
 
int GetRegularSuppliesIncomeExtra ()
 
int GetSupplyDepotIconThreshold ()
 
SCR_CampaignMilitaryBaseManager GetBaseManager ()
 
float GetVictoryTimer ()
 
int GetControlPointTreshold ()
 
int GetMinStartingSupplies ()
 
int GetMaxStartingSupplies ()
 
int GetStartingSuppliesInterval ()
 
bool WasRemnantsStateLoaded ()
 
bool IsSessionLoadInProgress ()
 
ResourceName GetSeekDestroyWaypointPrefab ()
 
int GetWinningFactionId ()
 
WorldTimestamp GetVictoryTimestamp ()
 
WorldTimestamp GetVictoryPauseTimestamp ()
 
bool IsTutorial ()
 
bool GetIsMatchOver ()
 
bool HasStarted ()
 
int GetCallsignOffset ()
 
void OnMatchSituationChanged ()
 
override bool RplSave (ScriptBitWriter writer)
 
override bool RplLoad (ScriptBitReader reader)
 
void SetControlPointsHeld (SCR_CampaignFaction faction, int newCount)
 
void SetPrimaryTarget (notnull SCR_CampaignFaction faction, SCR_CampaignMilitaryBaseComponent target)
 
void BroadcastMHQFeedback (SCR_EMobileAssemblyStatus msgID, int playerID, int factionID)
 
void RpcDo_BroadcastMHQFeedback (SCR_EMobileAssemblyStatus msgID, int playerID, int factionID)
 
void RequestStart ()
 
void OnStarted ()
 
void OnCallsignOffsetChanged ()
 
override void OnWorldPostProcess (World world)
 Called once loading of all entities of the world have been finished (still within the loading)
 
FactionKey GetFactionKeyByEnum (SCR_ECampaignFaction faction)
 
SCR_CampaignFaction GetFactionByEnum (SCR_ECampaignFaction faction)
 
bool IsProxy ()
 
bool CanRequestVehicleWithoutRank ()
 Getter for "Rank required" parameter for spawning vehicles.
 
void StoreLoadedData (notnull SCR_CampaignStruct struct)
 Handle the loaded struct; we want to apply it after gamemode has initialized.
 
void StoreRemnantsStates (out notnull array< ref SCR_CampaignRemnantInfoStruct > outEntries)
 
void LoadRemnantsStates (notnull array< ref SCR_CampaignRemnantInfoStruct > entries)
 
void OnStructureBuilt (SCR_CampaignMilitaryBaseComponent base, SCR_EditableEntityComponent entity, bool add)
 
void SetIsTutorial (bool isTutorial)
 
void LoadClientData (notnull array< ref SCR_CampaignPlayerStruct > data)
 
void WriteAllClientsData ()
 
void SpawnMobileHQ (notnull SCR_CampaignFaction faction, vector pos, vector rot)
 
int GetClientsData (notnull out array< ref SCR_CampaignClientData > dataArray)
 
SCR_CampaignClientData GetClientData (int playerId)
 Get corresponding client data, create new object if not found.
 
override void OnPlayerRegistered (int playerId)
 Called on every machine after a player is registered (identity, name etc.).
 
override void OnPlayerAuditSuccess (int iPlayerID)
 
override void OnPlayerDisconnected (int playerId, KickCauseCode cause, int timeout)
 Called after a player is disconnected.
 
override 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.
 
override 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 OnSpawnPointFactionAssigned (SCR_SpawnPoint spawnpoint)
 
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 bool CanPlayerSpawn_S (SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, out SCR_ESpawnResult result=SCR_ESpawnResult.SPAWN_NOT_ALLOWED)
 Disable spawning with custom loadout on bases with no armories.
 
override void OnControllableDestroyed (IEntity entity, IEntity killerEntity, notnull Instigator instigator)
 Award additional XP for enemies killed in friendly bases.
 
void OnEntityRequested (notnull IEntity spawnedEntity, IEntity user, SCR_Faction faction, SCR_MilitaryBaseLogicComponent service)
 Called when an entity is spawned by Free Roam Building.
 
void SCR_GameModeCampaign (IEntitySource src, IEntity parent)
 
void ~SCR_GameModeCampaign ()
 
- 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)
 

Static Public Member Functions

static SCR_GameModeCampaign GetInstance ()
 

Static Public Attributes

static const int MINIMUM_DELAY = 100
 
static const int UI_UPDATE_DELAY = 250
 
static const int MEDIUM_DELAY = 1000
 
static const int DEFAULT_DELAY = 2000
 
static const int BACKEND_DELAY = 25000
 
- Static Public Attributes inherited from SCR_BaseGameMode
const static string WB_GAME_MODE_CATEGORY = "Game Mode"
 

Protected Member Functions

void RPC_DoSetControlPointsHeld (int factionIndex, int count)
 
void RPC_DoSetPrimaryTarget (int factionIndex, int targetId)
 
void Start ()
 
void DisableExtraSpawnpoint (SCR_SpawnPoint spawnpoint)
 
void CheckForWinner ()
 Find out if any faction has won and it's time to end the match.
 
void RPC_DoEndMatch (int winningFactionId)
 
void ApplyLoadedData ()
 
void EndSessionLoadProgress ()
 
void ApplyClientData (int playerId)
 
void WriteClientData (int playerID, bool disconnecting=false, PlayerController pc=null)
 Save object with player's current data.
 
void OnAmbientVehicleSpawned (SCR_AmbientVehicleSpawnPointComponent spawnpoint, Vehicle vehicle)
 
void OnRankChanged (SCR_ECharacterRank oldRank, SCR_ECharacterRank newRank, notnull IEntity owner, bool silent)
 
void UpdateRespawnPenalty (int playerId)
 Handles forgiving of post-suicide deploy timer penalties.
 
void OnSuicide (int playerId)
 
void OnPlayerFactionResponse_S (SCR_PlayerFactionAffiliationComponent component, int factionIndex, bool response)
 
void OnPlayerFactionResponse_O (SCR_PlayerFactionAffiliationComponent component, int factionIndex, bool response)
 
void ProcessFactionAssignment (Faction assignedFaction)
 See HandleOnFactionAssigned.
 
- 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_bAutostart
 
bool m_bTerminateScenario
 
int m_iControlPointsThreshold
 
float m_fVictoryTimer
 
int m_iSuppliesReplenishThreshold
 
int m_iQuickSuppliesReplenishThreshold
 
float m_fQuickSuppliesReplenishMultiplier
 
int m_iSuppliesArrivalInterval
 
int m_iRegularSuppliesIncome
 
int m_iRegularSuppliesIncomeBase
 
int m_iRegularSuppliesIncomeExtra
 
int m_iHQStartingSupplies
 
int m_iMinStartingSupplies
 
int m_iMaxStartingSupplies
 
int m_iStartingSuppliesInterval
 
FactionKey m_sBLUFORFactionKey
 
FactionKey m_sOPFORFactionKey
 
FactionKey m_sINDFORFactionKey
 
bool m_bRandomizeSupplies
 
int m_iSupplyDepotIconThreshold
 
ResourceName m_sSeekDestroyWaypointPrefab
 
int m_iSuicidePenaltyCooldown
 
int m_iSuicideRespawnDelay
 
int m_iSuicideForgiveCooldown
 
ref ScriptInvoker m_OnFactionAssignedLocalPlayer
 
ref ScriptInvoker m_OnStarted
 
ref ScriptInvoker m_OnMatchSituationChanged
 
ref ScriptInvoker m_OnCallsignOffsetChanged
 
ref map< int, Factionm_mUnprocessedFactionAssignments = new map<int, Faction>()
 
ref array< SCR_PlayerRadioSpawnPointCampaignm_aRadioSpawnPoints = {}
 
ref array< ref SCR_CampaignClientDatam_aRegisteredClients = {}
 
bool m_bIgnoreMinimumVehicleRank
 
bool m_bIsTutorial
 
bool m_bMatchOver
 
bool m_bWorldPostProcessDone
 
bool m_bRemnantsStateLoaded
 
bool m_bIsSessionLoadInProgress
 
ref SCR_CampaignMilitaryBaseManager m_BaseManager = new SCR_CampaignMilitaryBaseManager(this)
 
SCR_CampaignStruct m_LoadedData
 
bool m_bStarted
 
WorldTimestamp m_fVictoryTimestamp
 
WorldTimestamp m_fVictoryPauseTimestamp
 
int m_iWinningFactionId = SCR_CampaignMilitaryBaseComponent.INVALID_FACTION_INDEX
 
int m_iCallsignOffset = SCR_MilitaryBaseComponent.INVALID_BASE_CALLSIGN
 
- 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
 

Constructor & Destructor Documentation

◆ SCR_GameModeCampaign()

void SCR_GameModeCampaign.SCR_GameModeCampaign ( IEntitySource  src,
IEntity  parent 
)

◆ ~SCR_GameModeCampaign()

void SCR_GameModeCampaign.~SCR_GameModeCampaign ( )

Member Function Documentation

◆ ApplyClientData()

void SCR_GameModeCampaign.ApplyClientData ( int  playerId)
protected

◆ ApplyLoadedData()

void SCR_GameModeCampaign.ApplyLoadedData ( )
protected

◆ BroadcastMHQFeedback()

void SCR_GameModeCampaign.BroadcastMHQFeedback ( SCR_EMobileAssemblyStatus  msgID,
int  playerID,
int  factionID 
)

◆ CanPlayerSpawn_S()

override bool SCR_GameModeCampaign.CanPlayerSpawn_S ( SCR_SpawnRequestComponent  requestComponent,
SCR_SpawnHandlerComponent  handlerComponent,
SCR_SpawnData  data,
out SCR_ESpawnResult  result = SCR_ESpawnResult::SPAWN_NOT_ALLOWED 
)

Disable spawning with custom loadout on bases with no armories.

Authority: Override and implement logic for whether provided player can spawn.

Parameters
requestComponentThe player request component instigating this spawn.
handlerComponentThe spawn handler component handling this spawn.
dataThe request payload.
[out]resultReason why respawn is disabled. Note that if returns true the reason will always be OK
Returns
True when spawn is allowed, false otherwise.

Implements SCR_BaseGameMode.

◆ CanRequestVehicleWithoutRank()

bool SCR_GameModeCampaign.CanRequestVehicleWithoutRank ( )

Getter for "Rank required" parameter for spawning vehicles.

◆ CheckForWinner()

void SCR_GameModeCampaign.CheckForWinner ( )
protected

Find out if any faction has won and it's time to end the match.

◆ DisableExtraSpawnpoint()

void SCR_GameModeCampaign.DisableExtraSpawnpoint ( SCR_SpawnPoint  spawnpoint)
protected

◆ EndSessionLoadProgress()

void SCR_GameModeCampaign.EndSessionLoadProgress ( )
protected

◆ GetBaseManager()

SCR_CampaignMilitaryBaseManager SCR_GameModeCampaign.GetBaseManager ( )

◆ GetCallsignOffset()

int SCR_GameModeCampaign.GetCallsignOffset ( )

◆ GetClientData()

SCR_CampaignClientData SCR_GameModeCampaign.GetClientData ( int  playerId)

Get corresponding client data, create new object if not found.

◆ GetClientsData()

int SCR_GameModeCampaign.GetClientsData ( notnull out array< ref SCR_CampaignClientData dataArray)

◆ GetControlPointTreshold()

int SCR_GameModeCampaign.GetControlPointTreshold ( )

◆ GetFactionByEnum()

SCR_CampaignFaction SCR_GameModeCampaign.GetFactionByEnum ( SCR_ECampaignFaction  faction)

◆ GetFactionKeyByEnum()

FactionKey SCR_GameModeCampaign.GetFactionKeyByEnum ( SCR_ECampaignFaction  faction)

◆ GetInstance()

static SCR_GameModeCampaign SCR_GameModeCampaign.GetInstance ( )
static

◆ GetIsMatchOver()

bool SCR_GameModeCampaign.GetIsMatchOver ( )

◆ GetMaxStartingSupplies()

int SCR_GameModeCampaign.GetMaxStartingSupplies ( )

◆ GetMinStartingSupplies()

int SCR_GameModeCampaign.GetMinStartingSupplies ( )

◆ GetOnCallsignOffsetChanged()

ScriptInvoker SCR_GameModeCampaign.GetOnCallsignOffsetChanged ( )

◆ GetOnFactionAssignedLocalPlayer()

ScriptInvoker SCR_GameModeCampaign.GetOnFactionAssignedLocalPlayer ( )

Triggered when the local player picks a faction.

◆ GetOnMatchSituationChanged()

ScriptInvoker SCR_GameModeCampaign.GetOnMatchSituationChanged ( )

Triggered when an event happened which should be communicated to players (i.e. amount of control points held etc.)

◆ GetOnStarted()

ScriptInvoker SCR_GameModeCampaign.GetOnStarted ( )

Triggered when Conflict gamemode has started.

◆ GetQuickSuppliesReplenishMultiplier()

float SCR_GameModeCampaign.GetQuickSuppliesReplenishMultiplier ( )

◆ GetQuickSuppliesReplenishThreshold()

int SCR_GameModeCampaign.GetQuickSuppliesReplenishThreshold ( )

◆ GetRegularSuppliesIncome()

int SCR_GameModeCampaign.GetRegularSuppliesIncome ( )

◆ GetRegularSuppliesIncomeBase()

int SCR_GameModeCampaign.GetRegularSuppliesIncomeBase ( )

◆ GetRegularSuppliesIncomeExtra()

int SCR_GameModeCampaign.GetRegularSuppliesIncomeExtra ( )

◆ GetSeekDestroyWaypointPrefab()

ResourceName SCR_GameModeCampaign.GetSeekDestroyWaypointPrefab ( )

◆ GetStartingSuppliesInterval()

int SCR_GameModeCampaign.GetStartingSuppliesInterval ( )

◆ GetSuppliesArrivalInterval()

int SCR_GameModeCampaign.GetSuppliesArrivalInterval ( )

◆ GetSuppliesReplenishThreshold()

int SCR_GameModeCampaign.GetSuppliesReplenishThreshold ( )

◆ GetSupplyDepotIconThreshold()

int SCR_GameModeCampaign.GetSupplyDepotIconThreshold ( )

◆ GetVictoryPauseTimestamp()

WorldTimestamp SCR_GameModeCampaign.GetVictoryPauseTimestamp ( )

◆ GetVictoryTimer()

float SCR_GameModeCampaign.GetVictoryTimer ( )

◆ GetVictoryTimestamp()

WorldTimestamp SCR_GameModeCampaign.GetVictoryTimestamp ( )

◆ GetWinningFactionId()

int SCR_GameModeCampaign.GetWinningFactionId ( )

◆ HasStarted()

bool SCR_GameModeCampaign.HasStarted ( )

◆ IsProxy()

bool SCR_GameModeCampaign.IsProxy ( )

◆ IsSessionLoadInProgress()

bool SCR_GameModeCampaign.IsSessionLoadInProgress ( )

◆ IsTutorial()

bool SCR_GameModeCampaign.IsTutorial ( )

◆ LoadClientData()

void SCR_GameModeCampaign.LoadClientData ( notnull array< ref SCR_CampaignPlayerStruct data)

◆ LoadRemnantsStates()

void SCR_GameModeCampaign.LoadRemnantsStates ( notnull array< ref SCR_CampaignRemnantInfoStruct entries)

◆ OnAmbientVehicleSpawned()

void SCR_GameModeCampaign.OnAmbientVehicleSpawned ( SCR_AmbientVehicleSpawnPointComponent  spawnpoint,
Vehicle  vehicle 
)
protected

◆ OnCallsignOffsetChanged()

void SCR_GameModeCampaign.OnCallsignOffsetChanged ( )

◆ OnControllableDestroyed()

override void SCR_GameModeCampaign.OnControllableDestroyed ( IEntity  entity,
IEntity  killerEntity,
notnull Instigator  instigator 
)

Award additional XP for enemies killed in friendly bases.

Implements SCR_BaseGameMode.

◆ OnEntityRequested()

void SCR_GameModeCampaign.OnEntityRequested ( notnull IEntity  spawnedEntity,
IEntity  user,
SCR_Faction  faction,
SCR_MilitaryBaseLogicComponent  service 
)

Called when an entity is spawned by Free Roam Building.

◆ OnMatchSituationChanged()

void SCR_GameModeCampaign.OnMatchSituationChanged ( )

◆ OnPlayerAuditSuccess()

override void SCR_GameModeCampaign.OnPlayerAuditSuccess ( int  iPlayerID)

Implements SCR_BaseGameMode.

◆ OnPlayerDisconnected()

override void SCR_GameModeCampaign.OnPlayerDisconnected ( int  playerId,
KickCauseCode  cause,
int  timeout 
)

Called after a player is disconnected.

Parameters
playerIdPlayerId of disconnected player.

Implements SCR_BaseGameMode.

◆ OnPlayerFactionResponse_O()

void SCR_GameModeCampaign.OnPlayerFactionResponse_O ( SCR_PlayerFactionAffiliationComponent  component,
int  factionIndex,
bool  response 
)
protected

◆ OnPlayerFactionResponse_S()

void SCR_GameModeCampaign.OnPlayerFactionResponse_S ( SCR_PlayerFactionAffiliationComponent  component,
int  factionIndex,
bool  response 
)
protected

◆ OnPlayerKilled()

override void SCR_GameModeCampaign.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.

◆ OnPlayerRegistered()

override void SCR_GameModeCampaign.OnPlayerRegistered ( int  playerId)

Called on every machine after a player is registered (identity, name etc.).

Always called after OnPlayerConnected.

Parameters
playerIdPlayerId of registered player.

Implements SCR_BaseGameMode.

◆ OnPlayerSpawnFinalize_S()

override void SCR_GameModeCampaign.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.

This is the final step in the respawn process and after this point the owner of SCR_SpawnRequestComponent is spawned.

Parameters
requestComponentInstigator of the request.
handlerComponentHandler that processed the request.
dataThe payload of the request.
entitySpawned (or generally assigned) entity.

Implements SCR_BaseGameMode.

◆ OnPlayerSpawnOnPoint_S()

override void SCR_GameModeCampaign.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.

See: SCR_BaseGameMode.OnPlayerSpawnFinalize_S

Implements SCR_BaseGameMode.

◆ OnRankChanged()

void SCR_GameModeCampaign.OnRankChanged ( SCR_ECharacterRank  oldRank,
SCR_ECharacterRank  newRank,
notnull IEntity  owner,
bool  silent 
)
protected

◆ OnSpawnPointFactionAssigned()

void SCR_GameModeCampaign.OnSpawnPointFactionAssigned ( SCR_SpawnPoint  spawnpoint)

◆ OnStarted()

void SCR_GameModeCampaign.OnStarted ( )

◆ OnStructureBuilt()

void SCR_GameModeCampaign.OnStructureBuilt ( SCR_CampaignMilitaryBaseComponent  base,
SCR_EditableEntityComponent  entity,
bool  add 
)

◆ OnSuicide()

void SCR_GameModeCampaign.OnSuicide ( int  playerId)
protected

◆ OnWorldPostProcess()

override void SCR_GameModeCampaign.OnWorldPostProcess ( World  world)

Called once loading of all entities of the world have been finished (still within the loading)

Parameters
worldLoaded world

Implements SCR_BaseGameMode.

◆ ProcessFactionAssignment()

void SCR_GameModeCampaign.ProcessFactionAssignment ( Faction  assignedFaction)
protected

See HandleOnFactionAssigned.

◆ RequestStart()

void SCR_GameModeCampaign.RequestStart ( )

◆ RPC_DoEndMatch()

void SCR_GameModeCampaign.RPC_DoEndMatch ( int  winningFactionId)
protected

◆ RPC_DoSetControlPointsHeld()

void SCR_GameModeCampaign.RPC_DoSetControlPointsHeld ( int  factionIndex,
int  count 
)
protected

◆ RPC_DoSetPrimaryTarget()

void SCR_GameModeCampaign.RPC_DoSetPrimaryTarget ( int  factionIndex,
int  targetId 
)
protected

◆ RpcDo_BroadcastMHQFeedback()

void SCR_GameModeCampaign.RpcDo_BroadcastMHQFeedback ( SCR_EMobileAssemblyStatus  msgID,
int  playerID,
int  factionID 
)

◆ RplLoad()

override bool SCR_GameModeCampaign.RplLoad ( ScriptBitReader  reader)

Implements SCR_BaseGameMode.

◆ RplSave()

override bool SCR_GameModeCampaign.RplSave ( ScriptBitWriter  writer)

Implements SCR_BaseGameMode.

◆ SetControlPointsHeld()

void SCR_GameModeCampaign.SetControlPointsHeld ( SCR_CampaignFaction  faction,
int  newCount 
)

◆ SetIsTutorial()

void SCR_GameModeCampaign.SetIsTutorial ( bool  isTutorial)

◆ SetPrimaryTarget()

void SCR_GameModeCampaign.SetPrimaryTarget ( notnull SCR_CampaignFaction  faction,
SCR_CampaignMilitaryBaseComponent  target 
)

◆ SpawnMobileHQ()

void SCR_GameModeCampaign.SpawnMobileHQ ( notnull SCR_CampaignFaction  faction,
vector  pos,
vector  rot 
)

◆ Start()

void SCR_GameModeCampaign.Start ( )
protected

◆ StoreLoadedData()

void SCR_GameModeCampaign.StoreLoadedData ( notnull SCR_CampaignStruct  struct)

Handle the loaded struct; we want to apply it after gamemode has initialized.

◆ StoreRemnantsStates()

void SCR_GameModeCampaign.StoreRemnantsStates ( out notnull array< ref SCR_CampaignRemnantInfoStruct outEntries)

◆ UpdateRespawnPenalty()

void SCR_GameModeCampaign.UpdateRespawnPenalty ( int  playerId)
protected

Handles forgiving of post-suicide deploy timer penalties.

◆ WasRemnantsStateLoaded()

bool SCR_GameModeCampaign.WasRemnantsStateLoaded ( )

◆ WriteAllClientsData()

void SCR_GameModeCampaign.WriteAllClientsData ( )

◆ WriteClientData()

void SCR_GameModeCampaign.WriteClientData ( int  playerID,
bool  disconnecting = false,
PlayerController  pc = null 
)
protected

Save object with player's current data.

Member Data Documentation

◆ BACKEND_DELAY

const int SCR_GameModeCampaign.BACKEND_DELAY = 25000
static

◆ DEFAULT_DELAY

const int SCR_GameModeCampaign.DEFAULT_DELAY = 2000
static

◆ m_aRadioSpawnPoints

ref array<SCR_PlayerRadioSpawnPointCampaign> SCR_GameModeCampaign.m_aRadioSpawnPoints = {}
protected

◆ m_aRegisteredClients

ref array<ref SCR_CampaignClientData> SCR_GameModeCampaign.m_aRegisteredClients = {}
protected

◆ m_BaseManager

ref SCR_CampaignMilitaryBaseManager SCR_GameModeCampaign.m_BaseManager = new SCR_CampaignMilitaryBaseManager(this)
protected

◆ m_bAutostart

bool SCR_GameModeCampaign.m_bAutostart
protected

◆ m_bIgnoreMinimumVehicleRank

bool SCR_GameModeCampaign.m_bIgnoreMinimumVehicleRank
protected

◆ m_bIsSessionLoadInProgress

bool SCR_GameModeCampaign.m_bIsSessionLoadInProgress
protected

◆ m_bIsTutorial

bool SCR_GameModeCampaign.m_bIsTutorial
protected

◆ m_bMatchOver

bool SCR_GameModeCampaign.m_bMatchOver
protected

◆ m_bRandomizeSupplies

bool SCR_GameModeCampaign.m_bRandomizeSupplies
protected

◆ m_bRemnantsStateLoaded

bool SCR_GameModeCampaign.m_bRemnantsStateLoaded
protected

◆ m_bStarted

bool SCR_GameModeCampaign.m_bStarted
protected

◆ m_bTerminateScenario

bool SCR_GameModeCampaign.m_bTerminateScenario
protected

◆ m_bWorldPostProcessDone

bool SCR_GameModeCampaign.m_bWorldPostProcessDone
protected

◆ m_fQuickSuppliesReplenishMultiplier

float SCR_GameModeCampaign.m_fQuickSuppliesReplenishMultiplier
protected

◆ m_fVictoryPauseTimestamp

WorldTimestamp SCR_GameModeCampaign.m_fVictoryPauseTimestamp
protected

◆ m_fVictoryTimer

float SCR_GameModeCampaign.m_fVictoryTimer
protected

◆ m_fVictoryTimestamp

WorldTimestamp SCR_GameModeCampaign.m_fVictoryTimestamp
protected

◆ m_iCallsignOffset

int SCR_GameModeCampaign.m_iCallsignOffset = SCR_MilitaryBaseComponent.INVALID_BASE_CALLSIGN
protected

◆ m_iControlPointsThreshold

int SCR_GameModeCampaign.m_iControlPointsThreshold
protected

◆ m_iHQStartingSupplies

int SCR_GameModeCampaign.m_iHQStartingSupplies
protected

◆ m_iMaxStartingSupplies

int SCR_GameModeCampaign.m_iMaxStartingSupplies
protected

◆ m_iMinStartingSupplies

int SCR_GameModeCampaign.m_iMinStartingSupplies
protected

◆ m_iQuickSuppliesReplenishThreshold

int SCR_GameModeCampaign.m_iQuickSuppliesReplenishThreshold
protected

◆ m_iRegularSuppliesIncome

int SCR_GameModeCampaign.m_iRegularSuppliesIncome
protected

◆ m_iRegularSuppliesIncomeBase

int SCR_GameModeCampaign.m_iRegularSuppliesIncomeBase
protected

◆ m_iRegularSuppliesIncomeExtra

int SCR_GameModeCampaign.m_iRegularSuppliesIncomeExtra
protected

◆ m_iStartingSuppliesInterval

int SCR_GameModeCampaign.m_iStartingSuppliesInterval
protected

◆ m_iSuicideForgiveCooldown

int SCR_GameModeCampaign.m_iSuicideForgiveCooldown
protected

◆ m_iSuicidePenaltyCooldown

int SCR_GameModeCampaign.m_iSuicidePenaltyCooldown
protected

◆ m_iSuicideRespawnDelay

int SCR_GameModeCampaign.m_iSuicideRespawnDelay
protected

◆ m_iSuppliesArrivalInterval

int SCR_GameModeCampaign.m_iSuppliesArrivalInterval
protected

◆ m_iSuppliesReplenishThreshold

int SCR_GameModeCampaign.m_iSuppliesReplenishThreshold
protected

◆ m_iSupplyDepotIconThreshold

int SCR_GameModeCampaign.m_iSupplyDepotIconThreshold
protected

◆ m_iWinningFactionId

int SCR_GameModeCampaign.m_iWinningFactionId = SCR_CampaignMilitaryBaseComponent.INVALID_FACTION_INDEX
protected

◆ m_LoadedData

SCR_CampaignStruct SCR_GameModeCampaign.m_LoadedData
protected

◆ m_mUnprocessedFactionAssignments

ref map<int, Faction> SCR_GameModeCampaign.m_mUnprocessedFactionAssignments = new map<int, Faction>()
protected

◆ m_OnCallsignOffsetChanged

ref ScriptInvoker SCR_GameModeCampaign.m_OnCallsignOffsetChanged
protected

◆ m_OnFactionAssignedLocalPlayer

ref ScriptInvoker SCR_GameModeCampaign.m_OnFactionAssignedLocalPlayer
protected

◆ m_OnMatchSituationChanged

ref ScriptInvoker SCR_GameModeCampaign.m_OnMatchSituationChanged
protected

◆ m_OnStarted

ref ScriptInvoker SCR_GameModeCampaign.m_OnStarted
protected

◆ m_sBLUFORFactionKey

FactionKey SCR_GameModeCampaign.m_sBLUFORFactionKey
protected

◆ m_sINDFORFactionKey

FactionKey SCR_GameModeCampaign.m_sINDFORFactionKey
protected

◆ m_sOPFORFactionKey

FactionKey SCR_GameModeCampaign.m_sOPFORFactionKey
protected

◆ m_sSeekDestroyWaypointPrefab

ResourceName SCR_GameModeCampaign.m_sSeekDestroyWaypointPrefab
protected

◆ MEDIUM_DELAY

const int SCR_GameModeCampaign.MEDIUM_DELAY = 1000
static

◆ MINIMUM_DELAY

const int SCR_GameModeCampaign.MINIMUM_DELAY = 100
static

◆ UI_UPDATE_DELAY

const int SCR_GameModeCampaign.UI_UPDATE_DELAY = 250
static

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