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

Public Member Functions

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 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.
 

Member Function Documentation

◆ HandlePlayerKilled()

bool BaseGameMode.HandlePlayerKilled ( int  playerId,
IEntity  playerEntity,
IEntity  killerEntity,
notnull Instigator  killer 
)
protected

Called after a player is killed, but before 'OnPlayerKilled'.

The default behavior is such that this method returns true, therefore each kill is handled automatically, resulting in a 'OnPlayerKilled' callback. When this method is overridden to return false, the callback is not called automatically.

This custom behavior can be used to suppress 'OnPlayerKilled' callbacks in specific scenarios, e.g. when a player is possessing an AI, in which case it might not be desirable to raise this callback, but rather handle the kill manually, by the user: e.g. by returning the player's control of their previous entity.

Return true to handle kill automatically, resulting in an immediate 'OnPlayerKilled' callback, otherwise the kill callback is suppressed, allowing custom user handling.

Parameters
playerIdPlayerId of victim player.
playerEntity of victim player (if any).
killerEntityentity of the instigator. If killerEntity is null, you can use instigator.GetInstigatorEntity() if appropiate.
killerEntity of killer instigator (if any).
Returns
True to handle kill automatically (raise 'OnPlayerKilled'), false to not handle automatically (don't raise).

Implemented in SCR_BaseGameMode.

◆ OnControllableDeleted()

void BaseGameMode.OnControllableDeleted ( IEntity  entity)
protected

Implemented in SCR_BaseGameMode.

◆ OnControllableDestroyed()

void BaseGameMode.OnControllableDestroyed ( IEntity  entity,
IEntity  killerEntity,
notnull Instigator  instigator 
)
protected

◆ OnControllableSpawned()

void BaseGameMode.OnControllableSpawned ( IEntity  entity)
protected

When a controllable entity is spawned, this event is raised.

Controllable entity is such that has BaseControllerComponent and can be possessed either by a player, an AI or stay unpossessed.

Parameters
entitySpawned entity that raised this event

Implemented in SCR_BaseGameMode.

◆ OnGameStart()

void BaseGameMode.OnGameStart ( )
protected

Gets called after world is initialized but before first ticks.

Implemented in SCR_BaseGameMode, and SCR_GameModeEditor.

◆ OnPlayerAuditFail()

void BaseGameMode.OnPlayerAuditFail ( int  iPlayerID)
protected

Implemented in SCR_BaseGameMode.

◆ OnPlayerAuditRevived()

void BaseGameMode.OnPlayerAuditRevived ( int  iPlayerID)
protected

Implemented in SCR_BaseGameMode.

◆ OnPlayerAuditSuccess()

void BaseGameMode.OnPlayerAuditSuccess ( int  iPlayerID)
protected

Implemented in SCR_BaseGameMode, and SCR_GameModeCampaign.

◆ OnPlayerAuditTimeouted()

void BaseGameMode.OnPlayerAuditTimeouted ( int  iPlayerID)
protected

Implemented in SCR_BaseGameMode.

◆ OnPlayerConnected()

void BaseGameMode.OnPlayerConnected ( int  playerId)
protected

Called after a player is connected.

Server-only.

Parameters
playerIdPlayerId of connected player.

Implemented in SCR_BaseGameMode.

◆ OnPlayerDisconnected()

void BaseGameMode.OnPlayerDisconnected ( int  playerId,
KickCauseCode  cause,
int  timeout 
)
protected

Called after a player is disconnected.

Parameters
playerIdPlayerId of disconnected player.
causeCause code
timeoutKick timeout in seconds (-1 is infinity)

Implemented in SCR_BaseGameMode, SCR_GameModeCampaign, and SCR_GameModeCleanSweep.

◆ OnPlayerKilled()

void BaseGameMode.OnPlayerKilled ( int  playerId,
IEntity  playerEntity,
IEntity  killerEntity,
notnull Instigator  killer 
)
protected

Called after a player gets killed (but only after 'SCR_HandlePlayerKilled' returns true).

Parameters
playerIdPlayerId of victim player.
playerEntity of victim player if any.
killerEntityentity of the instigator. If killerEntity is null, you can use instigator.GetInstigatorEntity() if appropiate.
killerEntity of killer instigator if any.

Implemented in SCR_BaseGameMode, SCR_GameModeCampaign, SCR_GameModeCleanSweep, and SCR_GameModeEditor.

◆ OnPlayerRegistered()

void BaseGameMode.OnPlayerRegistered ( int  playerId)
protected

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

Always called after OnPlayerConnected.

Parameters
playerIdPlayerId of registered player.

Implemented in SCR_BaseGameMode, SCR_GameModeCampaign, and SCR_GameModeCleanSweep.

◆ OnPlayerRoleChange()

void BaseGameMode.OnPlayerRoleChange ( int  playerId,
EPlayerRole  roleFlags 
)
protected

Called when player role changes.

Parameters
playerIdPlayer whose role is being changed.
roleFlagsRoles as a flags

Implemented in SCR_BaseGameMode.

◆ OnPlayerSpawned()

void BaseGameMode.OnPlayerSpawned ( int  playerId,
IEntity  controlledEntity 
)
protected

Called after a player is spawned.

Parameters
playerIdPlayerId of spawned player.
controlledEntitySpawned entity for this player.

Implemented in SCR_BaseGameMode.

◆ OnWorldPostProcess()

void BaseGameMode.OnWorldPostProcess ( World  world)

Event called once loading of all entities of the world have been finished. (still within the loading)

Implemented in SCR_BaseGameMode, and SCR_GameModeCampaign.


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