Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_BaseGameModeComponent.c
Go to the documentation of this file.
1 [ComponentEditorProps(category: "GameScripted/GameMode/Components", description: "Base for gamemode scripted component.")]
2 class SCR_BaseGameModeComponentClass : ScriptComponentClass
3 {
4 }
5 
9 {
11  protected SCR_BaseGameMode m_pGameMode;
12 
13  //------------------------------------------------------------------------------------------------
16  {
17  return m_pGameMode;
18  }
19 
20  //------------------------------------------------------------------------------------------------
22  void OnGameEnd();
23 
24  //------------------------------------------------------------------------------------------------
28 
29  //------------------------------------------------------------------------------------------------
33  void OnGameModeStart();
34 
35  //------------------------------------------------------------------------------------------------
39 
40  //------------------------------------------------------------------------------------------------
43  void OnPlayerConnected(int playerId);
44 
45  //------------------------------------------------------------------------------------------------
50  void OnPlayerAuditSuccess(int playerId);
51 
52  //------------------------------------------------------------------------------------------------
59  void OnPlayerAuditFail(int playerId);
60 
61  //------------------------------------------------------------------------------------------------
65  void OnPlayerAuditTimeouted(int playerId);
66 
67  //------------------------------------------------------------------------------------------------
71  void OnPlayerAuditRevived(int playerId);
72 
73  //------------------------------------------------------------------------------------------------
76  void OnPlayerRegistered(int playerId);
77 
78  //------------------------------------------------------------------------------------------------
83  void OnPlayerDisconnected(int playerId, KickCauseCode cause, int timeout);
84 
85  //------------------------------------------------------------------------------------------------
89  [Obsolete("Use OnPlayerSpawnFinalize_S instead")]
90  void OnPlayerSpawned(int playerId, IEntity controlledEntity);
91 
92  //------------------------------------------------------------------------------------------------
98  bool PreparePlayerEntity_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, IEntity entity)
99  {
100  return true;
101  }
102 
103  //------------------------------------------------------------------------------------------------
109  void OnSpawnPlayerEntityFailure_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, IEntity entity, SCR_SpawnData data, SCR_ESpawnResult reason);
110 
111  //------------------------------------------------------------------------------------------------
116  void OnPlayerSpawnFinalize_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, IEntity entity);
117 
118  //------------------------------------------------------------------------------------------------
120  bool HandlePlayerKilled(int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
121  {
122  return true; // by default, handle automatically
123  }
124 
125  //------------------------------------------------------------------------------------------------
131  void OnPlayerKilled(int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer);
132 
133  //------------------------------------------------------------------------------------------------
140  void OnPlayerKilledHandled(int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer);
141 
142  //------------------------------------------------------------------------------------------------
146  void OnPlayerDeleted(int playerId, IEntity player);
147 
148  //------------------------------------------------------------------------------------------------
152  void OnPlayerRoleChange(int playerId, EPlayerRole roleFlags);
153 
154  //------------------------------------------------------------------------------------------------
157  void OnWorldPostProcess(World world);
158 
159  //------------------------------------------------------------------------------------------------
161  [Obsolete()]
162  void HandleOnLoadoutAssigned(int playerID, SCR_BasePlayerLoadout assignedLoadout);
163 
164  //------------------------------------------------------------------------------------------------
166  [Obsolete()]
167  void HandleOnFactionAssigned(int playerID, Faction assignedFaction);
168 
169  //------------------------------------------------------------------------------------------------
171  [Obsolete()]
172  void HandleOnSpawnPointAssigned(int playerID, SCR_SpawnPoint spawnPoint);
173 
174  //------------------------------------------------------------------------------------------------
177  void OnControllableSpawned(IEntity entity);
178 
179  //------------------------------------------------------------------------------------------------
185  void OnControllableDestroyed(IEntity entity, IEntity killerEntity, notnull Instigator killer);
186 
187  //------------------------------------------------------------------------------------------------
192  void OnControllableDeleted(IEntity entity);
193 
194  //------------------------------------------------------------------------------------------------
195  // constructor
199  void SCR_BaseGameModeComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
200  {
201  m_pGameMode = SCR_BaseGameMode.Cast(ent);
202  if (!m_pGameMode)
203  {
204  string message = string.Format("%1 is attached to entity '%2' type=%3, required type=%4! This is not allowed!", Type().ToString(), ent.GetName(), ent.ClassName(), "SCR_BaseGameMode");
205  Debug.Error(message);
206  Print(message, LogLevel.WARNING);
207  }
208  }
209 }
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
SCR_BaseGameMode
Definition: SCR_BaseGameMode.c:137
OnPlayerKilled
void OnPlayerKilled(int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
Definition: SCR_CampaignFeedbackComponent.c:513
HandleOnLoadoutAssigned
void HandleOnLoadoutAssigned(int playerID, SCR_BasePlayerLoadout assignedLoadout)
What happens when a player is assigned a loadout.
SCR_ESpawnResult
SCR_ESpawnResult
Definition: SCR_ESpawnResult.c:8
EPlayerRole
EPlayerRole
Definition: EPlayerRole.c:7
ScriptComponent
SCR_SiteSlotEntityClass ScriptComponent
OnPlayerKilledHandled
void OnPlayerKilledHandled(int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
OnControllableDestroyed
void OnControllableDestroyed(IEntity entity, IEntity killerEntity, notnull Instigator killer)
Award additional XP for enemies killed in friendly bases.
Definition: SCR_XPHandlerComponent.c:94
OnPlayerAuditTimeouted
void OnPlayerAuditTimeouted(int playerId)
Definition: BaseGameMode.c:41
OnPlayerRegistered
void OnPlayerRegistered(int playerId)
Register provided client's respawn timer.
Definition: SCR_RespawnTimerComponent.c:207
OnGameStateChanged
void OnGameStateChanged(SCR_EGameModeState state)
Definition: SCR_BaseGameModeStateComponent.c:38
SCR_SpawnPoint
Spawn point entity defines positions on which players can possibly spawn.
Definition: SCR_SpawnPoint.c:27
OnGameEnd
void OnGameEnd()
Called on all machines when the world ends.
Definition: SCR_DataCollectorComponent.c:165
KickCauseCode
KickCauseCode
Definition: KickCauseCode.c:19
Instigator
Definition: Instigator.c:6
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition: SCR_BaseGameModeComponent.c:15
SCR_SpawnData
Definition: SCR_SpawnData.c:9
OnSpawnPlayerEntityFailure_S
void OnSpawnPlayerEntityFailure_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, IEntity entity, SCR_SpawnData data, SCR_ESpawnResult reason)
Definition: SCR_SpawnProtectionComponent.c:79
HandlePlayerKilled
bool HandlePlayerKilled(int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator killer)
See SCR_BaseGameMode.HandlePlayerKilled.
Definition: SCR_BaseGameModeComponent.c:120
OnGameModeStart
void OnGameModeStart()
Definition: SCR_DataCollectorComponent.c:408
SCR_GameModeEndData
Definition: SCR_GameModeEndData.c:4
OnControllableSpawned
void OnControllableSpawned(IEntity entity)
Definition: BaseGameMode.c:106
OnPlayerAuditSuccess
void OnPlayerAuditSuccess(int playerId)
Definition: SCR_DataCollectorComponent.c:248
m_pGameMode
SCR_BaseGameModeComponentClass m_pGameMode
The game mode entity this component is attached to.
OnPlayerConnected
void OnPlayerConnected(int playerId)
Definition: SCR_LocalPlayerPenalty.c:33
OnControllableDeleted
void OnControllableDeleted(IEntity entity)
Definition: SCR_PossessingManagerComponent.c:307
HandleOnFactionAssigned
void HandleOnFactionAssigned(int playerID, Faction assignedFaction)
What happens when a player is assigned a faction.
Definition: SCR_PlayerProfileManagerComponent.c:48
Faction
Definition: Faction.c:12
OnPlayerDeleted
void OnPlayerDeleted(int playerId, IEntity player)
Definition: SCR_RespawnTimerComponent.c:168
OnPlayerAuditRevived
void OnPlayerAuditRevived(int playerId)
Definition: BaseGameMode.c:47
OnPlayerSpawnFinalize_S
void OnPlayerSpawnFinalize_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, IEntity entity)
Definition: SCR_SpawnProtectionComponent.c:72
data
Get all prefabs that have the spawner data
Definition: SCR_EntityCatalogManagerComponent.c:305
OnWorldPostProcess
void OnWorldPostProcess(World world)
Event called once loading of all entities of the world have been finished. (still within the loading)
Definition: SCR_TimeAndWeatherHandlerComponent.c:166
OnPlayerSpawned
void OnPlayerSpawned(int playerId, IEntity controlledEntity)
Definition: SCR_XPHandlerComponent.c:32
SCR_EGameModeState
SCR_EGameModeState
Definition: SCR_EGameModeState.c:4
OnPlayerDisconnected
void OnPlayerDisconnected(int playerId, KickCauseCode cause, int timeout)
Definition: SCR_PlayerProfileManagerComponent.c:119
SCR_BasePlayerLoadout
Definition: SCR_BasePlayerLoadout.c:2
OnPlayerRoleChange
void OnPlayerRoleChange(int playerId, EPlayerRole roleFlags)
Definition: BaseGameMode.c:128
SCR_BaseGameModeComponentClass
Definition: SCR_BaseGameModeComponent.c:2
OnGameModeEnd
void OnGameModeEnd(SCR_GameModeEndData data)
Definition: SCR_DataCollectorComponent.c:49
Obsolete
RespawnSystemComponentClass GameComponentClass Obsolete()] proto external GenericEntity DoSpawn(string prefab
RespawnSystemComponent should be attached to a gamemode to handle player spawning and respawning.
OnPlayerAuditFail
void OnPlayerAuditFail(int playerId)
Definition: BaseGameMode.c:35
HandleOnSpawnPointAssigned
void HandleOnSpawnPointAssigned(int playerID, SCR_SpawnPoint spawnPoint)
What happens when a player is assigned a spawn point.
PreparePlayerEntity_S
bool PreparePlayerEntity_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnHandlerComponent handlerComponent, SCR_SpawnData data, IEntity entity)
Definition: SCR_BaseGameModeComponent.c:98
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180
SCR_BaseGameModeComponent
void SCR_BaseGameModeComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_BaseGameModeComponent.c:199