Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CampaignBuildingManagerComponent.c
Go to the documentation of this file.
1 [ComponentEditorProps(category: "GameScripted/GameMode/Components", description: "Base for gamemode scripted component.")]
3 {
4 }
5 
8 class SCR_CampaignBuildingManagerComponent : SCR_BaseGameModeComponent
9 {
10  [Attribute("", UIWidgets.ResourcePickerThumbnail, "Prefab of trigger spawned on server to activate a building mode when player enters its range.", "et")]
11  protected ResourceName m_sFreeRoamBuildingServerTrigger;
12 
13  [Attribute("", UIWidgets.ResourcePickerThumbnail, "Prefab of trigger spawned only on clients, to visualize the building area and allow player build only within its radius.", "et")]
14  protected ResourceName m_sFreeRoamBuildingClientTrigger;
15 
16  [Attribute("{58F07022C12D0CF5}Assets/Editor/PlacingPreview/Preview.emat", UIWidgets.ResourcePickerThumbnail, "Material used when for the preview of the compositions outside of the building mode.", category: "Preview", params: "emat")]
17  protected ResourceName m_sPreviewMaterial;
18 
19  [Attribute("0", UIWidgets.ComboBox, "", enums: ParamEnumArray.FromEnum(EEditableEntityBudget))]
21 
22  [Attribute("25", UIWidgets.EditBox, "Refund percentage", "")]
24 
25  [Attribute("10", UIWidgets.EditBox, "How many times player has to perform build step to gain a XP reward", "")]
26  protected int m_iXpRewardTreshold;
27 
29  [Attribute("0", UIWidgets.CheckBox, "If checked, only players of faction that match the owning faction of provider can disassemble composition")]
31 
32  [Attribute()]
34 
35  [Attribute("", UIWidgets.ResourceNamePicker, desc: "Config with prefabs available to build. The config has to be the same as on Editor Mode - placing editor component..", params: "conf")]
36  protected ResourceName m_sPrefabsToBuildResource;
37 
38  protected ref array<ResourceName> m_aPlaceablePrefabs = {};
39 
41  protected IEntity m_TemporaryProvider;
42  protected RplComponent m_RplComponent;
43  protected int m_iBuildingCycle
44 
45  //------------------------------------------------------------------------------------------------
48  {
49  return m_OutlineManager;
50  }
51 
52  //------------------------------------------------------------------------------------------------
53  protected bool GetResourceComponent(IEntity owner, out SCR_ResourceComponent component)
54  {
55  if (!owner)
56  return false;
57 
58  IEntity providerEntity;
59  SCR_CampaignBuildingCompositionComponent campaignCompositionComponent = SCR_CampaignBuildingCompositionComponent.Cast(owner.FindComponent(SCR_CampaignBuildingCompositionComponent));
60  if (campaignCompositionComponent)
61  providerEntity = campaignCompositionComponent.GetProviderEntity();
62 
63  if (!providerEntity)
64  {
65  providerEntity = GetTemporaryProvider();
67  }
68 
69  if (!providerEntity)
70  return false;
71 
73 
74  component = SCR_ResourceComponent.FindResourceComponent(providerEntity);
75 
76  return component;
77  }
78 
79  //------------------------------------------------------------------------------------------------
82  {
83  return m_sPreviewMaterial;
84  }
85 
86  //------------------------------------------------------------------------------------------------
89  {
90  return m_sFreeRoamBuildingServerTrigger;
91  }
92 
93  //------------------------------------------------------------------------------------------------
96  {
98  }
99 
100  //------------------------------------------------------------------------------------------------
102  void SetTemporaryProvider(IEntity ent)
103  {
104  m_TemporaryProvider = ent;
105  }
106 
107  //------------------------------------------------------------------------------------------------
110  {
111  return m_TemporaryProvider;
112  }
113 
114  //------------------------------------------------------------------------------------------------
118  {
120  }
121 
122  //------------------------------------------------------------------------------------------------
124  [Obsolete("SCR_CampaignBuildingManagerComponent.GetResourceComponent() should be used instead.")]
125  protected bool GetSupplyComponent(IEntity ownerEntity, out SCR_CampaignSuppliesComponent suppliesComponent)
126  {
127  SCR_CampaignBuildingCompositionComponent campaignCompositionComponent = SCR_CampaignBuildingCompositionComponent.Cast(ownerEntity.FindComponent(SCR_CampaignBuildingCompositionComponent));
128  if (!campaignCompositionComponent)
129  return false;
130 
131  IEntity providerEntity;
132  providerEntity = campaignCompositionComponent.GetProviderEntity();
133  if (!providerEntity)
134  {
135  providerEntity = GetTemporaryProvider();
136  SetTemporaryProvider(null);
137  }
138  else
139  SetTemporaryProvider(null);
140 
141  if (!providerEntity)
142  return false;
143 
144  suppliesComponent = SCR_CampaignSuppliesComponent.Cast(providerEntity.FindComponent(SCR_CampaignSuppliesComponent));
145  return suppliesComponent != null;
146  }
147 
148  //------------------------------------------------------------------------------------------------
151  {
152  m_iBuildingCycle++;
153  if (m_iBuildingCycle < m_iXpRewardTreshold)
154  return;
155 
156  m_iBuildingCycle = 0;
157 
158  PlayerController playerController = GetGame().GetPlayerController();
159  if (!playerController)
160  return;
161 
162  SCR_CampaignBuildingNetworkComponent networkComponent = SCR_CampaignBuildingNetworkComponent.Cast(playerController.FindComponent(SCR_CampaignBuildingNetworkComponent));
163  if (!networkComponent)
164  return;
165 
166  networkComponent.AddXPReward(playerController.GetPlayerId());
167  }
168 
169  //------------------------------------------------------------------------------------------------
173  {
175  }
176 
177  //------------------------------------------------------------------------------------------------
178  protected void OnEntityCoreBudgetUpdated(EEditableEntityBudget entityBudget, int originalBudgetValue, int budgetChange, int updatedBudgetValue, SCR_EditableEntityComponent entity)
179  {
180  if (IsProxy())
181  return;
182 
183  if (entityBudget != m_BudgetType)
184  return;
185 
186  if (entity.GetOwner().IsLoaded())
187  return;
188 
189  SCR_GameModeCampaign campaign = SCR_GameModeCampaign.GetInstance();
190 
191  if (campaign && campaign.IsSessionLoadInProgress())
192  return;
193 
194  int propBudgetValue;
195  array<ref SCR_EntityBudgetValue> budgets = {};
196  entity.GetEntityAndChildrenBudgetCost(budgets);
197 
198  foreach (SCR_EntityBudgetValue budget : budgets)
199  {
200  if (budget.GetBudgetType() != EEditableEntityBudget.PROPS)
201  continue;
202 
203  propBudgetValue = budget.GetBudgetValue();
204  break;
205  }
206 
207  IEntity entityOwner = entity.GetOwnerScripted();
208  SCR_ResourceComponent resourceComponent;
209 
210  if (!GetResourceComponent(entityOwner, resourceComponent))
211  return;
212 
213  //~ Supplies not enabled so no need to remove any
214  if (!resourceComponent.IsResourceTypeEnabled())
215  return;
216 
217  IEntity providerEntity = resourceComponent.GetOwner();
218 
219  if (!providerEntity)
220  return;
221 
222  SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(providerEntity.FindComponent(SCR_CampaignBuildingProviderComponent));
223 
224  if (!providerComponent)
225  return;
226 
227  if (budgetChange < 0)
228  {
229  budgetChange = Math.Round(budgetChange * m_iCompositionRefundPercentage * 0.01);
230 
231  providerComponent.AddPropValue(-propBudgetValue);
232 
233  SCR_ResourceGenerator generator = resourceComponent.GetGenerator(EResourceGeneratorID.DEFAULT, EResourceType.SUPPLIES);
234 
235  if (generator)
236  generator.RequestGeneration(-budgetChange);
237  }
238  else
239  {
240  providerComponent.AddPropValue(propBudgetValue);
241 
242  SCR_ResourceConsumer consumer = resourceComponent.GetConsumer(EResourceGeneratorID.DEFAULT, EResourceType.SUPPLIES);
243 
244  if (consumer)
245  consumer.RequestConsumtion(budgetChange);
246  }
247  }
248 
249  //------------------------------------------------------------------------------------------------
250  override void EOnInit(IEntity owner)
251  {
253  m_RplComponent = RplComponent.Cast(owner.FindComponent(RplComponent));
254 
256 
257  if (!GetGameMode().IsMaster())
258  return;
259 
261  if (!core)
262  return;
263 
264  m_EntityCore.Event_OnEntityBudgetUpdated.Insert(OnEntityCoreBudgetUpdated);
265  }
266 
267  //------------------------------------------------------------------------------------------------
268  override void OnPostInit(IEntity owner)
269  {
270  if (SCR_Global.IsEditMode())
271  return;
272 
273  SetEventMask(owner, EntityEvent.INIT);
274  }
275 
276  //------------------------------------------------------------------------------------------------
277  protected bool IsProxy()
278  {
279  return (m_RplComponent && m_RplComponent.IsProxy());
280  }
281 
282  //------------------------------------------------------------------------------------------------
285  {
286  Resource configContainer = BaseContainerTools.LoadContainer(m_sPrefabsToBuildResource);
287  if (!configContainer || !configContainer.IsValid())
288  return;
289 
290  SCR_PlaceableEntitiesRegistry registry = SCR_PlaceableEntitiesRegistry.Cast(BaseContainerTools.CreateInstanceFromContainer(configContainer.GetResource().ToBaseContainer()));
291  if (!registry)
292  return;
293 
294  m_aPlaceablePrefabs = registry.GetPrefabs();
295  }
296 
297  //------------------------------------------------------------------------------------------------
301  ResourceName GetCompositionResourceName(int prefabID)
302  {
303  // the array doesn't exist or the index I'm searching for is out of the bounds, terminate.
304  if (!m_aPlaceablePrefabs || !m_aPlaceablePrefabs.IsIndexValid(prefabID))
305  return string.Empty;
306 
307  return m_aPlaceablePrefabs[prefabID];
308  }
309 
310  //------------------------------------------------------------------------------------------------
314  int GetCompositionId(ResourceName resName)
315  {
316  return m_aPlaceablePrefabs.Find(resName);
317  }
318 
319  //------------------------------------------------------------------------------------------------
324  void GetEditorMode(int playerID, notnull IEntity provider, bool userActionActivationOnly = false, bool userActionUsed = false)
325  {
326  SCR_EditorManagerEntity editorManager = GetEditorManagerEntity(playerID);
327  if (!editorManager)
328  return;
329 
330  SCR_EditorModeEntity modeEntity = SCR_EditorModeEntity.Cast(editorManager.FindModeEntity(EEditorMode.BUILDING));
331  if (!modeEntity)
332  modeEntity = editorManager.CreateEditorMode(EEditorMode.BUILDING, false);
333 
334  if (!modeEntity)
335  return;
336 
337  SetEditorMode(editorManager, modeEntity, playerID, provider, userActionActivationOnly, userActionUsed);
338  }
339 
340  //------------------------------------------------------------------------------------------------
341  protected void SetEditorMode(notnull SCR_EditorManagerEntity editorManager, notnull SCR_EditorModeEntity modeEntity, int playerID, notnull IEntity provider, bool userActionActivationOnly = false, bool userActionUsed = false)
342  {
343  SCR_CampaignBuildingEditorComponent buildingComponent = SCR_CampaignBuildingEditorComponent.Cast(modeEntity.FindComponent(SCR_CampaignBuildingEditorComponent));
344  if (!buildingComponent)
345  return;
346 
347  SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(provider.FindComponent(SCR_CampaignBuildingProviderComponent));
348  if (!providerComponent)
349  return;
350 
351  providerComponent.AddNewAvailableUser(playerID);
352  if (userActionUsed)
353  providerComponent.AddNewActiveUser(playerID);
354 
355  buildingComponent.AddProviderEntityEditorComponent(providerComponent);
356 
357  if (!editorManager.IsOpened())
358  editorManager.SetCurrentMode(EEditorMode.BUILDING);
359 
360  if (userActionActivationOnly || userActionUsed)
361  ToggleEditorMode(editorManager);
362 
363  // events
364  SCR_PlacingEditorComponent placingComponent = SCR_PlacingEditorComponent.Cast(modeEntity.FindComponent(SCR_PlacingEditorComponent));
365  placingComponent.GetOnPlaceEntityServer().Insert(EntitySpawnedByProvider);
366 
368  if (gameMode)
369  gameMode.GetOnPlayerDisconnected().Insert(PlayerDisconnected);
370 
371  SetOnPlayerDeathEvent(playerID);
372  SetOnProviderDestroyedEvent(provider);
373  providerComponent.SetCheckProviderMove();
374  }
375 
376  //------------------------------------------------------------------------------------------------
381  void PlayerDisconnected(int playerId, KickCauseCode cause, int timeout)
382  {
384  if (!gameMode)
385  return;
386 
387  gameMode.GetOnPlayerDisconnected().Remove(PlayerDisconnected);
388  }
389 
390  //------------------------------------------------------------------------------------------------
392  void EntitySpawnedByProvider(int prefabID, SCR_EditableEntityComponent editableEntity, int playerId)
393  {
394  SCR_GameModeCampaign campaign = SCR_GameModeCampaign.GetInstance();
395  if (!campaign)
396  return;
397 
398  SCR_EditorManagerEntity editorManager = GetEditorManagerEntity(playerId);
399  if (!editorManager)
400  return;
401 
402  SCR_EditorModeEntity modeEntity = SCR_EditorModeEntity.Cast(editorManager.FindModeEntity(EEditorMode.BUILDING));
403  if (!modeEntity)
404  return;
405 
406  SCR_CampaignBuildingEditorComponent buildingComponent = SCR_CampaignBuildingEditorComponent.Cast(modeEntity.FindComponent(SCR_CampaignBuildingEditorComponent));
407  if (!buildingComponent)
408  return;
409 
410  SCR_CampaignBuildingProviderComponent provider = SCR_CampaignBuildingProviderComponent.Cast(buildingComponent.GetProviderComponent());
411  if (!provider)
412  return;
413 
414  IEntity player = GetGame().GetPlayerManager().GetPlayerControlledEntity(playerId);
415  if (!player)
416  return;
417 
418  campaign.OnEntityRequested(editableEntity.GetOwner(), player, SCR_Faction.Cast(SCR_Faction.GetEntityFaction(editableEntity.GetOwner())), provider);
419  }
420 
421  //------------------------------------------------------------------------------------------------
422  protected void SetOnPlayerDeathEvent(int playerID)
423  {
424  IEntity player = GetGame().GetPlayerManager().GetPlayerControlledEntity(playerID);
425  if (!player)
426  return;
427 
429  if (!comp)
430  return;
431 
432  comp.GetOnPlayerDeathWithParam().Insert(OnPlayerDeath);
433  }
434 
435  //------------------------------------------------------------------------------------------------
436  protected void RemoveOnPlayerDeathEvent(int playerID)
437  {
438  IEntity player = GetGame().GetPlayerManager().GetPlayerControlledEntity(playerID);
439  if (!player)
440  return;
441 
443  if (!comp)
444  return;
445 
446  comp.GetOnPlayerDeathWithParam().Remove(OnPlayerDeath);
447  }
448 
449  //------------------------------------------------------------------------------------------------
450  protected void SetOnProviderDestroyedEvent(IEntity provider)
451  {
452  SCR_DamageManagerComponent hitZoneContainerComponent = SCR_DamageManagerComponent.Cast(provider.FindComponent(SCR_DamageManagerComponent));
453  if (!hitZoneContainerComponent)
454  return;
455 
456  SCR_HitZone zone = SCR_HitZone.Cast(hitZoneContainerComponent.GetDefaultHitZone());
457  if (zone)
458  zone.GetOnDamageStateChanged().Insert(OnProviderDestroyed);
459  }
460 
461  //------------------------------------------------------------------------------------------------
462  protected void RemoveOnProviderDestroyedEvent(IEntity provider)
463  {
464  SCR_DamageManagerComponent hitZoneContainerComponent = SCR_DamageManagerComponent.Cast(provider.FindComponent(SCR_DamageManagerComponent));
465  if (!hitZoneContainerComponent)
466  return;
467 
468  SCR_HitZone zone = SCR_HitZone.Cast(hitZoneContainerComponent.GetDefaultHitZone());
469  if (zone)
470  zone.GetOnDamageStateChanged().Remove(OnProviderDestroyed);
471  }
472 
473  //------------------------------------------------------------------------------------------------
474  protected void OnPlayerDeath(SCR_CharacterControllerComponent characterController, IEntity instigatorEntity, notnull Instigator killer)
475  {
476  if (!characterController)
477  return;
478 
479  int playerID = GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(characterController.GetOwner());
480 
481  SCR_EditorManagerEntity editorManager = GetEditorManagerEntity(playerID);
482  if (!editorManager)
483  return;
484 
485  if (editorManager.IsOpened())
486  ToggleEditorMode(editorManager);
487 
488  RemoveEditorMode(playerID);
489  }
490 
491  //------------------------------------------------------------------------------------------------
494  protected void OnProviderDestroyed(SCR_HitZone hitZone)
495  {
496  if (!hitZone)
497  return;
498 
499  if (hitZone.GetDamageState() != EDamageState.DESTROYED)
500  return;
501 
502  IEntity provider = hitZone.GetOwner();
503  if (!provider)
504  return;
505 
506  SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(provider.FindComponent(SCR_CampaignBuildingProviderComponent));
507  if (!providerComponent)
508  return;
509 
510  array<int> playersIDs = {};
511  providerComponent.GetAvailableUsers(playersIDs);
512  foreach (int playerId : playersIDs)
513  {
514  if (providerComponent.ContainActiveUsers(playerId))
515  {
516  RemoveProvider(playerId, providerComponent, true);
517  providerComponent.RemoveActiveUser(playerId);
518  }
519 
520  providerComponent.RemoveAvailableUser(playerId);
521  }
522  }
523 
524  //------------------------------------------------------------------------------------------------
529  bool RemovePlayerIdFromProvider(int playerID, SCR_CampaignBuildingProviderComponent providerComponent)
530  {
531  bool isActiveUser = providerComponent.ContainActiveUsers(playerID);
532 
533  providerComponent.RemoveActiveUser(playerID);
534  providerComponent.RemoveAvailableUser(playerID);
535 
536  return isActiveUser;
537  }
538 
539  //------------------------------------------------------------------------------------------------
544  void RemoveProvider(int playerID, SCR_CampaignBuildingProviderComponent providerComponent, bool isActiveUser)
545  {
546  SCR_EditorManagerEntity editorManager = GetEditorManagerEntity(playerID);
547  if (!editorManager)
548  return;
549 
550  SCR_EditorModeEntity modeEntity = SCR_EditorModeEntity.Cast(editorManager.FindModeEntity(EEditorMode.BUILDING));
551  if (!modeEntity)
552  return;
553 
554  SCR_CampaignBuildingEditorComponent editorComponent = SCR_CampaignBuildingEditorComponent.Cast(modeEntity.FindComponent(SCR_CampaignBuildingEditorComponent));
555  if (!editorComponent)
556  return;
557 
558  if (isActiveUser && editorManager.IsOpened())
559  editorManager.Close();
560 
561  editorComponent.RemoveProviderEntityEditorComponent(providerComponent);
562 
563  IEntity provider = providerComponent.GetOwner();
564  if (provider)
565  RemoveOnProviderDestroyedEvent(providerComponent.GetOwner());
566 
567  providerComponent.RemoveCheckProviderMove();
568  RemoveOnPlayerDeathEvent(playerID);
569 
571  if (gameMode)
572  gameMode.GetOnPlayerDisconnected().Remove(PlayerDisconnected);
573 
574  // if it was a last provider and forced provider doesn't exist, remove the mode completely.
575  if (!editorComponent.GetProviderComponent())
576  RemoveEditorMode(playerID);
577  }
578 
579  //------------------------------------------------------------------------------------------------
580  protected void ToggleEditorMode(notnull SCR_EditorManagerEntity editorManager)
581  {
582  EEditorMode mode = editorManager.GetCurrentMode();
583 
584  editorManager.Toggle();
585  }
586 
587  //------------------------------------------------------------------------------------------------
588  protected void RemoveEditorMode(int playerID)
589  {
590  SCR_EditorManagerEntity editorManager = GetEditorManagerEntity(playerID);
591  if (!editorManager)
592  return;
593 
594  SCR_EditorModeEntity editorModeEntity = editorManager.FindModeEntity(EEditorMode.BUILDING);
595  if (!editorModeEntity)
596  return;
597 
598  SCR_EntityHelper.DeleteEntityAndChildren(editorModeEntity);
599  }
600 
601  //------------------------------------------------------------------------------------------------
603  {
605  if (!core)
606  return null;
607 
608  return core.GetEditorManager(playerID);
609  }
610 }
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
ToggleEditorMode
protected void ToggleEditorMode(notnull SCR_EditorManagerEntity editorManager)
Definition: SCR_CampaignBuildingManagerComponent.c:580
SCR_BaseGameMode
Definition: SCR_BaseGameMode.c:137
GetCompositionId
int GetCompositionId(ResourceName resName)
Definition: SCR_CampaignBuildingManagerComponent.c:314
SCR_EditableEntityCore
Definition: SCR_EditableEntityCore.c:10
m_iCompositionRefundPercentage
protected int m_iCompositionRefundPercentage
Definition: SCR_CampaignBuildingManagerComponent.c:23
m_bSameFactionDisassembleOnly
protected bool m_bSameFactionDisassembleOnly
Note: Provider is saved to composition only when it's built from base.
Definition: SCR_CampaignBuildingManagerComponent.c:30
IsMaster
protected bool IsMaster()
Definition: SCR_DataCollectorComponent.c:190
SCR_EntityHelper
Definition: SCR_EntityHelper.c:1
GetCompositionRefundPercentage
int GetCompositionRefundPercentage()
Definition: SCR_CampaignBuildingManagerComponent.c:172
OnEntityCoreBudgetUpdated
protected void OnEntityCoreBudgetUpdated(EEditableEntityBudget entityBudget, int originalBudgetValue, int budgetChange, int updatedBudgetValue, SCR_EditableEntityComponent entity)
Definition: SCR_CampaignBuildingManagerComponent.c:178
m_aPlaceablePrefabs
protected ref array< ResourceName > m_aPlaceablePrefabs
Definition: SCR_CampaignBuildingManagerComponent.c:38
GetServerTriggerResourceName
ResourceName GetServerTriggerResourceName()
Definition: SCR_CampaignBuildingManagerComponent.c:88
m_OutlineManager
protected ref SCR_CampaignBuildingCompositionOutlineManager m_OutlineManager
Definition: SCR_CampaignBuildingManagerComponent.c:33
GetPrefabListFromConfig
void GetPrefabListFromConfig()
Load all the available compositions at the beginning of the game to be accessible without the buildin...
Definition: SCR_CampaignBuildingManagerComponent.c:284
GetSupplyComponent
protected bool GetSupplyComponent(IEntity ownerEntity, out SCR_CampaignSuppliesComponent suppliesComponent)
Get supply component of the provider entity.
Definition: SCR_CampaignBuildingManagerComponent.c:125
IsProxy
protected bool IsProxy()
Definition: SCR_CampaignBuildingManagerComponent.c:277
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
RemoveEditorMode
protected void RemoveEditorMode(int playerID)
Definition: SCR_CampaignBuildingManagerComponent.c:588
EntitySpawnedByProvider
void EntitySpawnedByProvider(int prefabID, SCR_EditableEntityComponent editableEntity, int playerId)
Event triggered when the entity is spawned by this provider.
Definition: SCR_CampaignBuildingManagerComponent.c:392
RemoveOnPlayerDeathEvent
protected void RemoveOnPlayerDeathEvent(int playerID)
Definition: SCR_CampaignBuildingManagerComponent.c:436
PlayerDisconnected
void PlayerDisconnected(int playerId, KickCauseCode cause, int timeout)
Definition: SCR_CampaignBuildingManagerComponent.c:381
m_sFreeRoamBuildingClientTrigger
protected ResourceName m_sFreeRoamBuildingClientTrigger
Definition: SCR_CampaignBuildingManagerComponent.c:14
EDamageState
EDamageState
Definition: EDamageState.c:12
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_EditorModeEntity
Definition: SCR_EditorModeEntity.c:22
SCR_CharacterControllerComponent
Definition: SCR_CharacterControllerComponent.c:35
KickCauseCode
KickCauseCode
Definition: KickCauseCode.c:19
EEditableEntityBudget
EEditableEntityBudget
Definition: EEditableEntityBudget.c:1
Instigator
Definition: Instigator.c:6
GetOutlineManager
protected int m_iBuildingCycle SCR_CampaignBuildingCompositionOutlineManager GetOutlineManager()
Definition: SCR_CampaignBuildingManagerComponent.c:47
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition: SCR_BaseGameModeComponent.c:15
m_sPrefabsToBuildResource
protected ResourceName m_sPrefabsToBuildResource
Definition: SCR_CampaignBuildingManagerComponent.c:36
SCR_CampaignSuppliesComponent
void SCR_CampaignSuppliesComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_CampaignSuppliesComponent.c:327
SCR_GameModeCampaign
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
Definition: SCR_GameModeCampaign.c:1927
GetCompositionResourceName
ResourceName GetCompositionResourceName(int prefabID)
Definition: SCR_CampaignBuildingManagerComponent.c:301
ProcesXPreward
void ProcesXPreward()
Check if the number of cycles reaches a defined limit. If so, restart counter and send an RPC on serv...
Definition: SCR_CampaignBuildingManagerComponent.c:150
m_sPreviewMaterial
protected ResourceName m_sPreviewMaterial
Definition: SCR_CampaignBuildingManagerComponent.c:17
GetResourceComponent
protected bool GetResourceComponent(IEntity owner, out SCR_ResourceComponent component)
Definition: SCR_CampaignBuildingManagerComponent.c:53
GetEditorManagerEntity
protected SCR_EditorManagerEntity GetEditorManagerEntity(int playerID)
Definition: SCR_CampaignBuildingManagerComponent.c:602
SCR_CampaignBuildingCompositionOutlineManager
Definition: SCR_CampaignBuildingCompositionOutlineRegistry.c:6
SCR_EditorManagerCore
Core component to manage SCR_EditorManagerEntity.
Definition: SCR_EditorManagerCore.c:5
m_EntityCore
protected SCR_EditableEntityCore m_EntityCore
Definition: SCR_CampaignBuildingManagerComponent.c:40
CanDisassembleSameFactionOnly
bool CanDisassembleSameFactionOnly()
Definition: SCR_CampaignBuildingManagerComponent.c:117
EResourceType
EResourceType
Definition: SCR_ResourceContainer.c:1
OnPostInit
override void OnPostInit(IEntity owner)
Called on PostInit when all components are added.
Definition: SCR_CampaignBuildingManagerComponent.c:268
SetOnProviderDestroyedEvent
protected void SetOnProviderDestroyedEvent(IEntity provider)
Definition: SCR_CampaignBuildingManagerComponent.c:450
m_TemporaryProvider
protected IEntity m_TemporaryProvider
Definition: SCR_CampaignBuildingManagerComponent.c:41
SCR_EntityBudgetValue
Definition: SCR_EntityBudgetValue.c:2
GetCompositionPreviewMaterial
ResourceName GetCompositionPreviewMaterial()
Definition: SCR_CampaignBuildingManagerComponent.c:81
SetTemporaryProvider
void SetTemporaryProvider(IEntity ent)
Definition: SCR_CampaignBuildingManagerComponent.c:102
RemoveOnProviderDestroyedEvent
protected void RemoveOnProviderDestroyedEvent(IEntity provider)
Definition: SCR_CampaignBuildingManagerComponent.c:462
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
EOnInit
override void EOnInit(IEntity owner)
Definition: SCR_CampaignBuildingManagerComponent.c:250
EEditorMode
EEditorMode
Editor mode that defines overall functionality.
Definition: EEditorMode.c:5
GetTemporaryProvider
IEntity GetTemporaryProvider()
Definition: SCR_CampaignBuildingManagerComponent.c:109
m_RplComponent
protected RplComponent m_RplComponent
Definition: SCR_CampaignBuildingManagerComponent.c:42
SCR_HitZone
Definition: SCR_HitZone.c:1
SCR_Global
Definition: Functions.c:6
GetClientTriggerResourceName
ResourceName GetClientTriggerResourceName()
Definition: SCR_CampaignBuildingManagerComponent.c:95
SCR_PlaceableEntitiesRegistry
Definition: SCR_PlaceableEntitiesRegistry.c:8
SCR_CampaignBuildingManagerComponentClass
Definition: SCR_CampaignBuildingManagerComponent.c:2
RemoveProvider
void RemoveProvider(int playerID, SCR_CampaignBuildingProviderComponent providerComponent, bool isActiveUser)
Definition: SCR_CampaignBuildingManagerComponent.c:544
GetEditorMode
void GetEditorMode(int playerID, notnull IEntity provider, bool userActionActivationOnly=false, bool userActionUsed=false)
Definition: SCR_CampaignBuildingManagerComponent.c:324
m_iXpRewardTreshold
protected int m_iXpRewardTreshold
Definition: SCR_CampaignBuildingManagerComponent.c:26
OnProviderDestroyed
protected void OnProviderDestroyed(SCR_HitZone hitZone)
Definition: SCR_CampaignBuildingManagerComponent.c:494
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
RemovePlayerIdFromProvider
bool RemovePlayerIdFromProvider(int playerID, SCR_CampaignBuildingProviderComponent providerComponent)
Definition: SCR_CampaignBuildingManagerComponent.c:529
SCR_PlacingEditorComponent
Definition: SCR_PlacingEditorComponent.c:118
SetOnPlayerDeathEvent
protected void SetOnPlayerDeathEvent(int playerID)
Definition: SCR_CampaignBuildingManagerComponent.c:422
SCR_BaseGameModeComponentClass
Definition: SCR_BaseGameModeComponent.c:2
Attribute
SCR_CampaignBuildingManagerComponentClass SCR_BaseGameModeComponentClass Attribute("", UIWidgets.ResourcePickerThumbnail, "Prefab of trigger spawned on server to activate a building mode when player enters its range.", "et")] protected ResourceName m_sFreeRoamBuildingServerTrigger
OnPlayerDeath
protected void OnPlayerDeath(SCR_CharacterControllerComponent characterController, IEntity instigatorEntity, notnull Instigator killer)
Definition: SCR_CampaignBuildingManagerComponent.c:474
m_BudgetType
protected EEditableEntityBudget m_BudgetType
Definition: SCR_CampaignBuildingManagerComponent.c:20
SCR_Faction
Definition: SCR_Faction.c:6
Obsolete
RespawnSystemComponentClass GameComponentClass Obsolete()] proto external GenericEntity DoSpawn(string prefab
RespawnSystemComponent should be attached to a gamemode to handle player spawning and respawning.
SCR_ResourceGenerator
Definition: SCR_ResourceGenerator.c:79
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180
EResourceGeneratorID
EResourceGeneratorID
Definition: SCR_ResourceGenerator.c:1
SCR_BaseGameModeComponent
void SCR_BaseGameModeComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_BaseGameModeComponent.c:199
SCR_EditorManagerEntity
Definition: SCR_EditorManagerEntity.c:26
SetEditorMode
protected void SetEditorMode(notnull SCR_EditorManagerEntity editorManager, notnull SCR_EditorModeEntity modeEntity, int playerID, notnull IEntity provider, bool userActionActivationOnly=false, bool userActionUsed=false)
Definition: SCR_CampaignBuildingManagerComponent.c:341