Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ScenarioFrameworkLayerBase.c
Go to the documentation of this file.
1 [EntityEditorProps(category: "GameScripted/ScenarioFramework/Layer", description: "")]
2 class SCR_ScenarioFrameworkLayerBaseClass : ScriptComponentClass
3 {
4 }
5 
6 // SCR_ScenarioFrameworkLayerBase Invoker
9 typedef ScriptInvokerBase<ScriptInvokerScenarioFrameworkLayerMethod> ScriptInvokerScenarioFrameworkLayer;
10 
12 {
13  ALL,
17 }
18 
20 {
21  [Attribute(defvalue: "0", UIWidgets.ComboBox, desc: "Spawn all children, only random one or random multiple ones?", "", ParamEnumArray.FromEnum(SCR_EScenarioFrameworkSpawnChildrenType), category: "Children")]
22  protected SCR_EScenarioFrameworkSpawnChildrenType m_SpawnChildren;
23 
24  [Attribute(desc: "Faction key that corresponds with the SCR_Faction set in FactionManager", category: "Asset")]
25  protected FactionKey m_sFactionKey;
26 
27  [Attribute(defvalue: "100", desc: "If the RANDOM_MULTIPLE option is selected, what's the percentage? ", UIWidgets.Graph, "0 100 1", category: "Children")]
28  protected int m_iRandomPercent;
29 
30  [Attribute(desc: "When enabled, it will repeatedly spawn childern according to other parameters set", category: "Children")]
31  protected bool m_bEnableRepeatedSpawn;
32 
33  [Attribute(defvalue: "-1", desc: "If Repeated Spawn is enabled, how many times can children be spawned? If set to -1, it is unlimited", category: "Children")]
34  protected int m_iRepeatedSpawnNumber;
35 
36  [Attribute(defvalue: "-1", UIWidgets.Slider, desc: "If Repeated Spawn is enabled, how frequently it will spawn next wave of children? Value -1 means disabled, thus children won't be spawned by the elapsed time.", params: "-1 86400 1", category: "Children")]
37  protected float m_fRepeatedSpawnTimer;
38 
39  [Attribute(desc: "Show the debug shapes during runtime", category: "Debug")]
41 
42  [Attribute("0", uiwidget: UIWidgets.ComboBox, "", "", ParamEnumArray.FromEnum(SCR_ScenarioFrameworkEActivationType), category: "Activation")]
43  protected SCR_ScenarioFrameworkEActivationType m_eActivationType;
44 
45  [Attribute(desc: "Conditions that will be checked upon init and based on the result it will let this to finish init or not", category: "Activation")]
46  protected ref array<ref SCR_ScenarioFrameworkActivationConditionBase> m_aActivationConditions;
47 
48  [Attribute(desc: "Actions that will be activated when this Area gets activated", category: "OnActivation")]
49  protected ref array<ref SCR_ScenarioFrameworkActionBase> m_aActivationActions;
50 
51  [Attribute(desc: "", category: "Activation")]
53 
54  [Attribute(UIWidgets.Auto, category: "Plugins")]
55  protected ref array<ref SCR_ScenarioFrameworkPlugin> m_aPlugins;
56 
57  protected ref array<SCR_ScenarioFrameworkLayerBase> m_aChildren = {};
58  protected ref array<SCR_ScenarioFrameworkLayerBase> m_aRandomlySpawnedChildren = {};
59  protected ref array<SCR_ScenarioFrameworkLogic> m_aLogic = {};
60 
61  protected ref ScriptInvokerBase<ScriptInvokerScenarioFrameworkLayerMethod> m_OnAllChildrenSpawned;
62  protected ref array<IEntity> m_aSpawnedEntities = {};
63  protected IEntity m_Entity;
66  protected float m_fDebugShapeRadius = 0.25;
67  protected WorldTimestamp m_fRepeatSpawnTimeStart;
68  protected WorldTimestamp m_fRepeatSpawnTimeEnd;
69  protected int m_iDebugShapeColor = ARGB(32, 0xFF, 0x00, 0x12);
72  protected bool m_bInitiated;
73  protected bool m_bIsRegistered;
74  protected bool m_bDynamicallyDespawned;
75  protected bool m_bIsTerminated; //Marks if this was terminated - either by death or deletion
76 
77  //Default values we need to store
79  SCR_ScenarioFrameworkEActivationType m_eActivationTypeDefault = m_eActivationType;
80 
81  static const int SPAWN_DELAY = 200;
82 
83  //------------------------------------------------------------------------------------------------
85  string GetName()
86  {
87  return GetOwner().GetName();
88  }
89 
90  //------------------------------------------------------------------------------------------------
92  void SetEntity(IEntity entity)
93  {
94  m_Entity = entity;
95  }
96 
97  //------------------------------------------------------------------------------------------------
100  {
101  return m_bIsTerminated;
102  }
103 
104  //------------------------------------------------------------------------------------------------
106  void SetIsTerminated(bool state)
107  {
108  m_bIsTerminated = state;
109  }
110 
111  //------------------------------------------------------------------------------------------------
113  void SetRandomlySpawnedChildren(array<string> randomlySpawnedChildren)
114  {
115  IEntity entity;
118  foreach (string child : randomlySpawnedChildren)
119  {
120  entity = GetGame().GetWorld().FindEntityByName(child);
121  if (!entity)
122  continue;
123 
124  layer = SCR_ScenarioFrameworkLayerBase.Cast(entity.FindComponent(SCR_ScenarioFrameworkLayerBase));
125  if (!layer)
126  continue;
127 
128  m_aRandomlySpawnedChildren.Insert(layer);
129  }
130  }
131 
132  //------------------------------------------------------------------------------------------------
134  array<SCR_ScenarioFrameworkLayerBase> GetRandomlySpawnedChildren()
135  {
137  }
138 
139  //------------------------------------------------------------------------------------------------
140  int GetPlayersCount(FactionKey factionName = "")
141  {
142  if (factionName.IsEmpty())
143  return GetGame().GetPlayerManager().GetPlayerCount();
144 
145  FactionManager factionManager = GetGame().GetFactionManager();
146  if (!factionManager)
147  return -1;
148 
149  int iCnt = 0;
150  array<int> aPlayerIDs = {};
151  SCR_PlayerController playerController;
152  GetGame().GetPlayerManager().GetPlayers(aPlayerIDs);
153  foreach (int iPlayerID : aPlayerIDs)
154  {
155  playerController = SCR_PlayerController.Cast(GetGame().GetPlayerManager().GetPlayerController(iPlayerID));
156  if (!playerController)
157  continue;
158 
159  if (playerController.GetLocalControlledEntityFaction() == factionManager.GetFactionByKey(factionName))
160  iCnt++;
161  }
162  return iCnt;
163  }
164 
165  //------------------------------------------------------------------------------------------------
166  int GetMaxPlayersForGameMode(FactionKey factionName = "")
167  {
168  //TODO: separate players by faction (attackers / defenders)
169  SCR_MissionHeader header = SCR_MissionHeader.Cast(GetGame().GetMissionHeader());
170 
171  if (!header)
172  return 4; //TODO: make a constant
173 
174  return header.m_iPlayerCount;
175  }
176 
177  //------------------------------------------------------------------------------------------------
180  {
181  if (m_Area)
182  return m_Area;
183 
184  IEntity entity = GetOwner().GetParent();
185  while (entity)
186  {
187  m_Area = SCR_ScenarioFrameworkArea.Cast(entity.FindComponent(SCR_ScenarioFrameworkArea));
188  if (m_Area)
189  return m_Area;
190 
191  entity = entity.GetParent();
192  }
193 
194  return null;
195  }
196 
197  //------------------------------------------------------------------------------------------------
199  SCR_ScenarioFrameworkLayerTask GetLayerTask()
200  {
201  SCR_ScenarioFrameworkLayerTask layer;
202  IEntity entity = GetOwner().GetParent();
203  while (entity)
204  {
205  layer = SCR_ScenarioFrameworkLayerTask.Cast(entity.FindComponent(SCR_ScenarioFrameworkLayerTask));
206  if (layer)
207  return layer;
208 
209  entity = entity.GetParent();
210  }
211 
212  return null;
213  }
214 
215  //------------------------------------------------------------------------------------------------
217  SCR_ScenarioFrameworkSlotTask GetSlotTask(array<SCR_ScenarioFrameworkLayerBase> aLayers)
218  {
219  SCR_ScenarioFrameworkSlotTask slotTask;
220  foreach (SCR_ScenarioFrameworkLayerBase layer : aLayers)
221  {
222  IEntity child = layer.GetOwner();
223  slotTask = SCR_ScenarioFrameworkSlotTask.Cast(child.FindComponent(SCR_ScenarioFrameworkSlotTask));
224  if (slotTask)
225  return slotTask;
226 
227  child = GetOwner().GetChildren();
228  while (child)
229  {
230  slotTask = SCR_ScenarioFrameworkSlotTask.Cast(child.FindComponent(SCR_ScenarioFrameworkSlotTask));
231  if (slotTask)
232  return slotTask;
233 
234  child = child.GetSibling();
235  }
236  }
237 
238  return null;
239  }
240 
241  //------------------------------------------------------------------------------------------------
242  protected void SetFactionKey(FactionKey factionKey)
243  {
244  m_sFactionKey = factionKey;
245  }
246 
247  //------------------------------------------------------------------------------------------------
248  protected FactionKey GetFactionKey()
249  {
250  return m_sFactionKey;
251  }
252 
253  //------------------------------------------------------------------------------------------------
256  {
257  m_ParentLayer = parentLayer;
258  }
259 
260  //------------------------------------------------------------------------------------------------
263  {
264  if (m_ParentLayer)
265  return m_ParentLayer;
266 
267  IEntity entity = GetOwner().GetParent();
268  if (!entity)
269  return null;
270 
272  return m_ParentLayer;
273  }
274 
275  //------------------------------------------------------------------------------------------------
278  {
279  return m_SpawnChildren;
280  }
281 
282  //------------------------------------------------------------------------------------------------
285  {
286  return m_bEnableRepeatedSpawn;
287  }
288 
289  //------------------------------------------------------------------------------------------------
291  void SetEnableRepeatedSpawn(bool value)
292  {
293  m_bEnableRepeatedSpawn = value;
294  }
295 
296  //------------------------------------------------------------------------------------------------
298  SCR_ScenarioFrameworkEActivationType GetActivationType()
299  {
300  return m_eActivationType;
301  }
302 
303  //------------------------------------------------------------------------------------------------
305  void SetActivationType(SCR_ScenarioFrameworkEActivationType activationType)
306  {
307  m_eActivationType = activationType;
308  }
309 
310  //------------------------------------------------------------------------------------------------
313  {
314  return m_bInitiated;
315  }
316 
317  //------------------------------------------------------------------------------------------------
320  {
322  }
323 
324  //------------------------------------------------------------------------------------------------
326  void SetDynamicDespawnExcluded(bool excluded)
327  {
328  m_bExcludeFromDynamicDespawn = excluded;
329  }
330 
331  //------------------------------------------------------------------------------------------------
333  array<IEntity> GetSpawnedEntities()
334  {
335  return m_aSpawnedEntities;
336  }
337 
338  //------------------------------------------------------------------------------------------------
340  array<SCR_ScenarioFrameworkLayerBase> GetChildrenEntities()
341  {
342  return m_aChildren;
343  }
344 
345  //------------------------------------------------------------------------------------------------
348  {
349  if (m_aChildren.IsEmpty())
350  return null;
351 
352  Math.Randomize(-1);
353  return m_aChildren.GetRandomElement();
354  }
355 
356  //------------------------------------------------------------------------------------------------
359  void GetChildren(out array<SCR_ScenarioFrameworkLayerBase> children)
360  {
361  children = {};
362  array<SCR_ScenarioFrameworkLayerBase> childrenReversed = {};
363  SCR_ScenarioFrameworkLayerBase slotComponent;
364  IEntity child = GetOwner().GetChildren();
365  while (child)
366  {
367  slotComponent = SCR_ScenarioFrameworkLayerBase.Cast(child.FindComponent(SCR_ScenarioFrameworkLayerBase));
368  if (slotComponent)
369  childrenReversed.Insert(slotComponent);
370 
371  child = child.GetSibling();
372  }
373 
374  for (int i = childrenReversed.Count() - 1; i >= 0; i--)
375  {
376  if (!children.Contains(childrenReversed[i]))
377  children.Insert(childrenReversed[i]);
378  }
379  }
380 
381  //------------------------------------------------------------------------------------------------
383  void GetLogics(out array<SCR_ScenarioFrameworkLogic> logics)
384  {
385  IEntity child = GetOwner().GetChildren();
386  SCR_ScenarioFrameworkLogic logic;
387  while (child)
388  {
389  logic = SCR_ScenarioFrameworkLogic.Cast(child);
390  if (logic && !logics.Contains(logic))
391  logics.Insert(logic);
392 
393  child = child.GetSibling();
394  }
395  }
396 
397  //------------------------------------------------------------------------------------------------
399  array<SCR_ScenarioFrameworkLogic> GetSpawnedLogics()
400  {
401  return m_aLogic;
402  }
403 
404  //------------------------------------------------------------------------------------------------
406  array<ref SCR_ScenarioFrameworkPlugin> GetSpawnedPlugins()
407  {
408  return m_aPlugins;
409  }
410 
411  //------------------------------------------------------------------------------------------------
414  {
415  return m_iRepeatedSpawnNumber;
416  }
417 
418  //------------------------------------------------------------------------------------------------
420  void SetRepeatedSpawnNumber(int number)
421  {
422  m_iRepeatedSpawnNumber = number;
423  }
424 
425  //------------------------------------------------------------------------------------------------
426  protected void RepeatedSpawn()
427  {
429  return;
430 
431  //This calls the RepeatedSpawnCalled with set delay and is set in a way that it
432  //Can be both queued that way or called manually from different place (pseudo-looped CallLater)
433  GetGame().GetCallqueue().CallLater(RepeatedSpawnCalled, 1000 * m_fRepeatedSpawnTimer);
434  }
435 
436  //------------------------------------------------------------------------------------------------
437  protected void RepeatedSpawnCalled()
438  {
440  SpawnChildren(true);
441 
443  return;
444 
445  RepeatedSpawn();
446  }
447 
448  //------------------------------------------------------------------------------------------------
451  {
453  m_OnAllChildrenSpawned = new ScriptInvokerBase<ScriptInvokerScenarioFrameworkLayerMethod>();
454 
455  return m_OnAllChildrenSpawned;
456  }
457 
458  //------------------------------------------------------------------------------------------------
461  {
463  m_OnAllChildrenSpawned.Invoke(this);
464  }
465 
466  //------------------------------------------------------------------------------------------------
470  {
471  if (m_SpawnChildren == SCR_EScenarioFrameworkSpawnChildrenType.ALL)
472  {
476  {
477  int activationType = child.GetActivationType();
478  if (activationType == SCR_ScenarioFrameworkEActivationType.ON_TRIGGER_ACTIVATION || activationType == SCR_ScenarioFrameworkEActivationType.ON_AREA_TRIGGER_ACTIVATION
479  || activationType == SCR_ScenarioFrameworkEActivationType.ON_TASKS_INIT)
480  continue;
481 
482  if (child.GetIsInitiated())
484 
486  }
487 
490  }
491  else if (m_SpawnChildren == SCR_EScenarioFrameworkSpawnChildrenType.RANDOM_ONE)
492  {
494  }
495  else
496  {
499  {
500  int activationType = child.GetActivationType();
501  if (activationType == SCR_ScenarioFrameworkEActivationType.ON_TRIGGER_ACTIVATION || activationType == SCR_ScenarioFrameworkEActivationType.ON_AREA_TRIGGER_ACTIVATION)
502  continue;
503 
504  if (child.GetIsInitiated())
506  }
507 
510  }
511  }
512 
513  //------------------------------------------------------------------------------------------------
516  void SpawnChildren(bool previouslyRandomized = false)
517  {
518  if (m_aChildren.IsEmpty())
519  {
521  return;
522  }
523 
524  if (m_SpawnChildren == SCR_EScenarioFrameworkSpawnChildrenType.ALL)
525  {
526  int slotCount;
528  {
529  if (SCR_ScenarioFrameworkSlotBase.Cast(child))
530  {
531  GetGame().GetCallqueue().CallLater(InitChild, SPAWN_DELAY * slotCount, false, child);
532  slotCount++;
533  }
534  else
535  {
536  InitChild(child);
537  }
538  }
539  }
540  else if (m_SpawnChildren == SCR_EScenarioFrameworkSpawnChildrenType.RANDOM_ONE)
541  {
542  //We need to introduce slight delay for the randomization by time seed to occur
543  GetGame().GetCallqueue().CallLater(SpawnRandomOneChild, Math.RandomInt(1, 10), false, previouslyRandomized);
544  }
545  else
546  {
547  //We need to introduce slight delay for the randomization by time seed to occur
548  GetGame().GetCallqueue().CallLater(SpawnRandomMultipleChildren, Math.RandomInt(1, 10), false, previouslyRandomized);
549  }
550  }
551 
552  //------------------------------------------------------------------------------------------------
555  {
557  {
558  GetGame().GetCallqueue().CallLater(InitChild, 200 * i, false, child);
559  }
560  }
561 
562  //------------------------------------------------------------------------------------------------
565  void SpawnRandomOneChild(bool previouslyRandomized = false)
566  {
567  if (previouslyRandomized)
569  else
570  {
572  m_aRandomlySpawnedChildren.Insert(child);
573  InitChild(child);
574  }
575  }
576 
577  //------------------------------------------------------------------------------------------------
580  void SpawnRandomMultipleChildren(bool previouslyRandomized = false)
581  {
582  if (previouslyRandomized)
584  else
585  {
586  array<SCR_ScenarioFrameworkLayerBase> aChildren = {};
587  aChildren.Copy(m_aChildren);
588 
589  if (aChildren.IsEmpty())
590  return;
591 
592  if (m_SpawnChildren == SCR_EScenarioFrameworkSpawnChildrenType.RANDOM_BASED_ON_PLAYERS_COUNT)
594 
595  m_iSupposedSpawnedChildren = Math.Round(m_aChildren.Count() / 100 * m_iRandomPercent);
597  for (int i = 1; i <= m_iSupposedSpawnedChildren; i++)
598  {
599  if (aChildren.IsEmpty())
600  continue;
601 
602  Math.Randomize(-1);
603  child = aChildren.GetRandomElement();
604  m_aRandomlySpawnedChildren.Insert(child);
605  InitChild(child);
606  aChildren.RemoveItem(child);
607  }
608  }
609  }
610 
611  //------------------------------------------------------------------------------------------------
615  {
616  if (!child)
617  return;
618 
619  child.SetParentLayer(this);
620  child.Init(GetParentArea(), SCR_ScenarioFrameworkEActivationType.SAME_AS_PARENT);
621  }
622 
623  //------------------------------------------------------------------------------------------------
626  {
627  return m_Entity;
628  }
629 
630  //------------------------------------------------------------------------------------------------
631  protected void ActivateLogic()
632  {
634  foreach (SCR_ScenarioFrameworkLogic logic : m_aLogic)
635  {
636  logic.Init();
637  }
638  }
639 
640  //------------------------------------------------------------------------------------------------
642  void RestoreToDefault(bool includeChildren = false, bool reinitAfterRestoration = false)
643  {
644  m_Entity = null;
647  m_bInitiated = false;
648  m_bIsRegistered = false;
649  m_bDynamicallyDespawned = false;
650  m_bIsTerminated = false;
651 
652  foreach (SCR_ScenarioFrameworkActionBase activationAction : m_aActivationActions)
653  {
654  activationAction.m_iNumberOfActivations = 0;
655  }
656 
657  if (includeChildren)
658  {
660  {
661  child.RestoreToDefault(includeChildren, false);
662  }
663  }
664 
665  m_aChildren.Clear();
666 
667  foreach (IEntity entity : m_aSpawnedEntities)
668  {
669  SCR_EntityHelper.DeleteEntityAndChildren(entity);
670  }
671 
672  m_aSpawnedEntities.Clear();
673 
674  if (reinitAfterRestoration)
675  Init(m_Area);
676  }
677 
678  //------------------------------------------------------------------------------------------------
681  {
683  if (!m_bInitiated)
684  {
686  return;
687  }
688 
690  return;
691 
692  m_bInitiated = false;
695  {
696  child.DynamicDespawn(this);
697  }
698 
699  m_aChildren.Clear();
700 
701  foreach (IEntity entity : m_aSpawnedEntities)
702  {
703  SCR_EntityHelper.DeleteEntityAndChildren(entity);
704  }
705 
706  m_aSpawnedEntities.Clear();
707  }
708 
709  //------------------------------------------------------------------------------------------------
712  {
713  Init(GetParentArea(), SCR_ScenarioFrameworkEActivationType.SAME_AS_PARENT);
714  }
715 
716  //------------------------------------------------------------------------------------------------
720  void Init(SCR_ScenarioFrameworkArea area = null, SCR_ScenarioFrameworkEActivationType activation = SCR_ScenarioFrameworkEActivationType.SAME_AS_PARENT)
721  {
722  if (m_bInitiated)
723  return;
724 
725  if (m_bIsTerminated)
726  {
727  if (!m_ParentLayer)
728  return;
729 
730  SCR_ScenarioFrameworkLayerTask layerTask = SCR_ScenarioFrameworkLayerTask.Cast(m_ParentLayer);
731  if (!layerTask && !GetParentArea().GetLayerTask())
732  return;
733  }
734 
735  if (!m_bDynamicallyDespawned && activation != m_eActivationType)
736  {
737  if (m_ParentLayer)
738  m_ParentLayer.CheckAllChildrenSpawned(this);
739 
740  return;
741  }
742 
744  {
745  //If just one condition is false, we don't continue and interrupt the init
746  if (!activationCondition.Init(GetOwner()))
747  {
748  if (m_ParentLayer)
749  m_ParentLayer.CheckAllChildrenSpawned(this);
750 
751  return;
752  }
753  }
754 
755  if (!area)
756  {
757  SCR_GameModeSFManager gameModeComp = SCR_GameModeSFManager.Cast(GetGame().GetGameMode().FindComponent(SCR_GameModeSFManager));
758  if (gameModeComp)
759  area = gameModeComp.GetParentArea(GetOwner());
760  }
761  m_Area = area;
762 
763  bool previouslyRandomized;
764  if (!m_aRandomlySpawnedChildren.IsEmpty())
765  previouslyRandomized = true;
766 
767  // Handles inheritance of faction settings from parents
768  if (m_sFactionKey.IsEmpty() && m_ParentLayer && !m_ParentLayer.GetFactionKey().IsEmpty())
769  SetFactionKey(m_ParentLayer.GetFactionKey());
770 
772 
774  SpawnChildren(previouslyRandomized);
775  }
776 
777  //------------------------------------------------------------------------------------------------
780  {
781  m_bInitiated = true;
782 
783  ActivateLogic();
784  foreach (SCR_ScenarioFrameworkPlugin plugin : m_aPlugins)
785  {
786  plugin.Init(this);
787  }
788 
789  foreach (SCR_ScenarioFrameworkActionBase activationAction : m_aActivationActions)
790  {
791  activationAction.Init(GetOwner());
792  }
793 
794  if (m_ParentLayer)
795  m_ParentLayer.CheckAllChildrenSpawned(this);
796 
798 
799  if (m_fRepeatedSpawnTimer >= 0)
800  RepeatedSpawn();
801  }
802 
803  //------------------------------------------------------------------------------------------------
804  override void EOnFrame(IEntity owner, float timeSlice)
805  {
806  super.EOnFrame(owner, timeSlice);
808  DrawDebugShape(true);
809  }
810 
811  //------------------------------------------------------------------------------------------------
812  override void OnPostInit(IEntity owner)
813  {
814  super.OnPostInit(owner);
816  {
817  //TODO: deactivate once the slots are not needed (after entity was spawned)
818  SetEventMask(owner, EntityEvent.INIT | EntityEvent.FRAME);
819  }
820  }
821  //------------------------------------------------------------------------------------------------
823  void SetDebugShapeSize(float fSize)
824  {
825  m_fDebugShapeRadius = fSize;
826  }
827 
828  //------------------------------------------------------------------------------------------------
829  protected void DrawDebugShape(bool draw)
830  {
831  Shape dbgShape = null;
832  if (!draw)
833  return;
834 
835  dbgShape = Shape.CreateSphere(
837  ShapeFlags.TRANSP | ShapeFlags.DOUBLESIDE | ShapeFlags.NOZWRITE | ShapeFlags.ONCE | ShapeFlags.NOOUTLINE,
838  GetOwner().GetOrigin(),
840  );
841  }
842 
843 #ifdef WORKBENCH
844  //------------------------------------------------------------------------------------------------
845  override void _WB_OnCreate(IEntity owner, IEntitySource src)
846  {
847  RenameOwnerEntity(owner);
848 
849  IEntity child = GetOwner().GetChildren();
850  while (child)
851  {
852  RenameOwnerEntity(child);
853  child = child.GetSibling();
854  }
855  }
856 
857  //------------------------------------------------------------------------------------------------
860  void RenameOwnerEntity(IEntity owner)
861  {
862  GenericEntity genericEntity = GenericEntity.Cast(owner);
863 
864  WorldEditorAPI api = genericEntity._WB_GetEditorAPI();
865  if (!api.UndoOrRedoIsRestoring())
866  api.RenameEntity(api.EntityToSource(owner), api.GenerateDefaultEntityName(api.EntityToSource(owner)));
867  }
868 #endif
869 
870  //------------------------------------------------------------------------------------------------
871  // constructor
875  void SCR_ScenarioFrameworkLayerBase(IEntityComponentSource src, IEntity ent, IEntity parent)
876  {
877 #ifdef WORKBENCH
878  m_iDebugShapeColor = ARGB(32, 0x99, 0xF3, 0x12);
879  foreach (SCR_ScenarioFrameworkPlugin plugin : m_aPlugins)
880  {
881  plugin.OnWBKeyChanged(this);
882  }
883 #endif
884  }
885 }
886 
888 class SCR_ScenarioFrameworkPlugin : ScriptAndConfig
889 {
890  protected SCR_ScenarioFrameworkLayerBase m_Object;
891 
892  //------------------------------------------------------------------------------------------------
895  {
896  return m_Object;
897  }
898 
899  //------------------------------------------------------------------------------------------------
902  void Init(SCR_ScenarioFrameworkLayerBase object)
903  {
904  m_Object = object;
905  }
906 
907  //------------------------------------------------------------------------------------------------
909  void OnWBKeyChanged(SCR_ScenarioFrameworkLayerBase object)
910  {
911  }
912 }
913 
915 class SCR_ScenarioFrameworkPluginTrigger : SCR_ScenarioFrameworkPlugin
916 {
917  [Attribute(defvalue: "5.0", UIWidgets.Slider, params: "1.0 1000.0 0.5", desc: "Radius of the trigger if selected", category: "Trigger")]
918  protected float m_fAreaRadius;
919 
920  [Attribute("0", UIWidgets.ComboBox, "By whom the trigger is activated", "", ParamEnumArray.FromEnum(TA_EActivationPresence), category: "Trigger Activation")]
921  protected TA_EActivationPresence m_eActivationPresence;
922 
923  [Attribute(desc: "If SPECIFIC_CLASS is selected, fill the class name here.", category: "Trigger")]
924  protected ref array<string> m_aSpecificClassNames;
925 
926  [Attribute(desc: "Which Prefabs and if their children will be detected by the trigger. Is combined with other filters using OR.", category: "Trigger")]
927  protected ref array<ref SCR_ScenarioFrameworkPrefabFilter> m_aPrefabFilter;
928 
929  [Attribute("", category: "Trigger Activation")]
930  protected FactionKey m_sActivatedByThisFaction;
931 
932  [Attribute(desc: "Here you can input custom trigger conditions that you can create by extending the SCR_CustomTriggerConditions", uiwidget: UIWidgets.Object)]
933  protected ref array<ref SCR_CustomTriggerConditions> m_aCustomTriggerConditions;
934 
935  [Attribute(defvalue: "1", UIWidgets.CheckBox, desc: "If you set some vehicle to be detected by the trigger, it will also search the inventory for vehicle prefabs/classes that are set", category: "Trigger")]
936  protected bool m_bSearchVehicleInventory;
937 
938  [Attribute(defvalue: "1", UIWidgets.CheckBox, desc: "Activate the trigger once or everytime the activation condition is true?", category: "Trigger")]
939  protected bool m_bOnce;
940 
941  [Attribute(defvalue: "1", UIWidgets.Slider, desc: "How frequently is the trigger updated and performing calculations. Lower numbers will decrease performance.", params: "0 86400 1", category: "Trigger")]
942  protected float m_fUpdateRate;
943 
944  [Attribute(defvalue: "0", UIWidgets.Slider, desc: "Minimum players needed to activate this trigger when PLAYER Activation presence is selected", params: "0 1 0.01", precision: 2, category: "Trigger")]
945  protected float m_fMinimumPlayersNeededPercentage;
946 
947  [Attribute(defvalue: "0", UIWidgets.Slider, desc: "For how long the trigger conditions must be true in order for the trigger to activate. If conditions become false, timer resets", params: "0 86400 1", category: "Trigger")]
948  protected float m_fActivationCountdownTimer;
949 
950  [Attribute(defvalue: "0", UIWidgets.CheckBox, desc: "Whether or not the notification is allowed to be displayed", category: "Trigger")]
951  protected bool m_bNotificationEnabled;
952 
953  [Attribute(desc: "Notification title text that will be displayed when the PLAYER Activation presence is selected", category: "Trigger")]
954  protected string m_sPlayerActivationNotificationTitle;
955 
956  [Attribute(defvalue: "0", UIWidgets.CheckBox, desc: "Whether or not the audio sound is played and affected by the trigger", category: "Trigger")]
957  protected bool m_bEnableAudio;
958 
959  [Attribute(desc: "Audio sound that will be playing when countdown is active.", category: "Trigger")]
960  protected string m_sCountdownAudio;
961 
962  //------------------------------------------------------------------------------------------------
963  override void Init(SCR_ScenarioFrameworkLayerBase object)
964  {
965  if (!object)
966  return;
967 
968  super.Init(object);
970  IEntity entity = object.GetSpawnedEntity();
971 
973  if (area)
974  {
975  trigger = SCR_CharacterTriggerEntity.Cast(area.GetTrigger());
976  }
977  else
978  {
979  if (!BaseGameTriggerEntity.Cast(entity))
980  {
981  Print("ScenarioFramework: SlotTrigger - The selected prefab is not trigger!", LogLevel.ERROR);
982  return;
983  }
984  trigger = SCR_CharacterTriggerEntity.Cast(entity);
985  }
986 
987  if (trigger)
988  {
989  trigger.SetSphereRadius(m_fAreaRadius);
990  trigger.SetActivationPresence(m_eActivationPresence);
991  trigger.SetOwnerFaction(m_sActivatedByThisFaction);
992  trigger.SetSpecificClassName(m_aSpecificClassNames);
993  trigger.SetPrefabFilters(m_aPrefabFilter);
994  trigger.SetCustomTriggerConditions(m_aCustomTriggerConditions);
995  trigger.SetSearchVehicleInventory(m_bSearchVehicleInventory);
996  trigger.SetOnce(m_bOnce);
997  trigger.SetUpdateRate(m_fUpdateRate);
998  trigger.SetNotificationEnabled(m_bNotificationEnabled);
999  trigger.SetEnableAudio(m_bEnableAudio);
1000  trigger.SetMinimumPlayersNeeded(m_fMinimumPlayersNeededPercentage);
1001  trigger.SetPlayerActivationNotificationTitle(m_sPlayerActivationNotificationTitle);
1002  trigger.SetActivationCountdownTimer(m_fActivationCountdownTimer);
1003  trigger.SetCountdownAudio(m_sCountdownAudio);
1004 
1005  return;
1006  }
1007 
1008  SCR_BaseFactionTriggerEntity factionTrigger = SCR_BaseFactionTriggerEntity.Cast(entity);
1009  if (factionTrigger)
1010  {
1011  factionTrigger.SetSphereRadius(m_fAreaRadius);
1012  FactionManager factionManager = GetGame().GetFactionManager();
1013  if (factionManager)
1014  factionTrigger.SetOwnerFaction(factionManager.GetFactionByKey(m_sActivatedByThisFaction));
1015  }
1016  }
1017 
1018  //------------------------------------------------------------------------------------------------
1019  override void OnWBKeyChanged(SCR_ScenarioFrameworkLayerBase object)
1020  {
1021  super.OnWBKeyChanged(object);
1022  object.SetDebugShapeSize(m_fAreaRadius);
1023  //src.Set("m_sAreaName", m_fAreaRadius);
1024  }
1025 }
1026 
1028 class SCR_ScenarioFrameworkPluginOnDestroyEvent : SCR_ScenarioFrameworkPlugin
1029 {
1030  [Attribute(UIWidgets.Auto, desc: "What to do once object gets destroyed", category: "OnDestroy")]
1031  protected ref array<ref SCR_ScenarioFrameworkActionBase> m_aActionsOnDestroy;
1032 
1033  protected IEntity m_Asset;
1034 
1035  //------------------------------------------------------------------------------------------------
1036  override void Init(SCR_ScenarioFrameworkLayerBase object)
1037  {
1038  if (!object)
1039  return;
1040 
1041  super.Init(object);
1043  IEntity entity = object.GetSpawnedEntity();
1044  if (!entity)
1045  return;
1046 
1047  m_Asset = entity;
1048  SCR_DamageManagerComponent objectDmgManager = SCR_DamageManagerComponent.Cast(SCR_DamageManagerComponent.GetDamageManager(m_Asset));
1049  if (objectDmgManager)
1050  objectDmgManager.GetOnDamageStateChanged().Insert(OnObjectDamage);
1051  else
1052  PrintFormat("ScenarioFramework: Registering OnDestroy of entity %1 failed! The entity doesn't have damage manager", entity, LogLevel.ERROR);
1053 
1054  if (Vehicle.Cast(m_Asset))
1055  {
1056  VehicleControllerComponent_SA vehicleController = VehicleControllerComponent_SA.Cast(m_Asset.FindComponent(VehicleControllerComponent_SA));
1057  if (vehicleController)
1058  vehicleController.GetOnEngineStop().Insert(CheckEngineDrowned);
1059 
1060  // Since there is no invoker and no reliable way how to tackle drowned vehicles, in order to make it reliable,
1061  // We cannot solely rely on GetOnEngineStop because vehicle could have been pushed/moved into the water without started engine.
1062  GetGame().GetCallqueue().CallLater(CheckEngineDrowned, 5000, true);
1063  }
1064  }
1065 
1066  //------------------------------------------------------------------------------------------------
1068  void OnObjectDamage(EDamageState state)
1069  {
1070  if (state != EDamageState.DESTROYED || !m_Asset)
1071  return;
1072 
1073  SCR_DamageManagerComponent objectDmgManager = SCR_DamageManagerComponent.Cast(SCR_DamageManagerComponent.GetDamageManager(m_Asset));
1074  if (objectDmgManager)
1075  {
1076  objectDmgManager.GetOnDamageStateChanged().Remove(OnObjectDamage);
1077  GetGame().GetCallqueue().Remove(CheckEngineDrowned);
1078 
1079  VehicleControllerComponent_SA vehicleController = VehicleControllerComponent_SA.Cast(m_Asset.FindComponent(VehicleControllerComponent_SA));
1080  if (vehicleController)
1081  vehicleController.GetOnEngineStop().Remove(CheckEngineDrowned);
1082  }
1083 
1084  foreach (SCR_ScenarioFrameworkActionBase action : m_aActionsOnDestroy)
1085  {
1086  action.OnActivate(m_Asset);
1087  }
1088  }
1089 
1090  //------------------------------------------------------------------------------------------------
1092  void CheckEngineDrowned()
1093  {
1094  if (!m_Asset)
1095  return;
1096 
1097  VehicleControllerComponent_SA vehicleController = VehicleControllerComponent_SA.Cast(m_Asset.FindComponent(VehicleControllerComponent_SA));
1098  if (vehicleController && vehicleController.GetEngineDrowned())
1099  {
1100  vehicleController.GetOnEngineStop().Remove(CheckEngineDrowned);
1101  GetGame().GetCallqueue().Remove(CheckEngineDrowned);
1102 
1103  SCR_DamageManagerComponent objectDmgManager = SCR_DamageManagerComponent.Cast(SCR_DamageManagerComponent.GetDamageManager(m_Asset));
1104  if (objectDmgManager)
1105  objectDmgManager.GetOnDamageStateChanged().Remove(OnObjectDamage);
1106 
1107  foreach (SCR_ScenarioFrameworkActionBase action : m_aActionsOnDestroy)
1108  {
1109  action.OnActivate(m_Asset);
1110  }
1111  }
1112  }
1113 
1114 }
1115 
1117 class SCR_ScenarioFrameworkPluginOnInventoryChange : SCR_ScenarioFrameworkPlugin
1118 {
1119  [Attribute(UIWidgets.Auto, desc: "What to do once object inventory has changed by item addition")]
1120  protected ref array<ref SCR_ScenarioFrameworkActionBase> m_aActionsOnItemAdded;
1121 
1122  [Attribute(UIWidgets.Auto, desc: "What to do once object inventory has changed by item removal")]
1123  protected ref array<ref SCR_ScenarioFrameworkActionBase> m_aActionsOnItemRemoved;
1124 
1125  protected IEntity m_Asset;
1126 
1127  //------------------------------------------------------------------------------------------------
1128  override void Init(SCR_ScenarioFrameworkLayerBase object)
1129  {
1130  if (!object)
1131  return;
1132 
1133  super.Init(object);
1134  IEntity entity = object.GetSpawnedEntity();
1135  if (!entity)
1136  return;
1137 
1138  m_Asset = entity;
1139 
1140  //Inventory system is a mess and since different entities have different storage managers that don't have this properly inherited, we need to account for that here
1141  SCR_InventoryStorageManagerComponent storageManager1 = SCR_InventoryStorageManagerComponent.Cast(m_Asset.FindComponent(SCR_InventoryStorageManagerComponent));
1142  if (storageManager1)
1143  {
1144  storageManager1.m_OnItemAddedInvoker.Insert(OnItemAdded);
1145  storageManager1.m_OnItemRemovedInvoker.Insert(OnItemRemoved);
1146  return;
1147  }
1148 
1149  SCR_VehicleInventoryStorageManagerComponent storageManager2 = SCR_VehicleInventoryStorageManagerComponent.Cast(m_Asset.FindComponent(SCR_VehicleInventoryStorageManagerComponent));
1150  if (storageManager2)
1151  {
1152  storageManager2.m_OnItemAddedInvoker.Insert(OnItemAdded);
1153  storageManager2.m_OnItemRemovedInvoker.Insert(OnItemRemoved);
1154  return;
1155  }
1156 
1157  SCR_ArsenalInventoryStorageManagerComponent storageManager3 = SCR_ArsenalInventoryStorageManagerComponent.Cast(m_Asset.FindComponent(SCR_ArsenalInventoryStorageManagerComponent));
1158  if (storageManager3)
1159  {
1160  storageManager3.m_OnItemAddedInvoker.Insert(OnItemAdded);
1161  storageManager3.m_OnItemRemovedInvoker.Insert(OnItemRemoved);
1162  return;
1163  }
1164  }
1165 
1166  //------------------------------------------------------------------------------------------------
1167  protected void OnItemAdded(IEntity item, BaseInventoryStorageComponent storageOwner)
1168  {
1169  foreach (SCR_ScenarioFrameworkActionBase action : m_aActionsOnItemAdded)
1170  {
1171  action.OnActivate(m_Asset);
1172  }
1173  }
1174 
1175  //------------------------------------------------------------------------------------------------
1176  protected void OnItemRemoved(IEntity item, BaseInventoryStorageComponent storageOwner)
1177  {
1178  foreach (SCR_ScenarioFrameworkActionBase action : m_aActionsOnItemRemoved)
1179  {
1180  action.OnActivate(m_Asset);
1181  }
1182  }
1183 }
1184 
1186 class SCR_ScenarioFrameworkPluginSpawnPoint : SCR_ScenarioFrameworkPlugin
1187 {
1188  [Attribute("0", desc: "Find empty position for spawning within given radius. When none is found, entity position will be used.")]
1189  protected float m_fSpawnRadius;
1190 
1191  [Attribute("US", UIWidgets.EditBox, "Determines which faction can spawn on this spawn point."), RplProp(onRplName: "OnSetFactionKey")]
1192  protected string m_sFaction;
1193 
1194  [Attribute("0")]
1195  protected bool m_bShowInDeployMapOnly;
1196 
1197  [Attribute("0", desc: "Use custom timer when deploying on this spawn point. Takes the remaining respawn time from SCR_TimedSpawnPointComponent")]
1198  protected bool m_bTimedSpawnPoint;
1199 
1200  [Attribute()]
1201  protected ref SCR_UIInfo m_Info;
1202 
1203  [Attribute("0", desc: "Allow usage of Spawn Positions in range")]
1204  protected bool m_bUseNearbySpawnPositions;
1205 
1206  [Attribute("100", desc: "Spawn position detection radius, in metres")]
1207  protected float m_fSpawnPositionUsageRange;
1208 
1209  [Attribute("0", desc: "Additional respawn time (in seconds) when spawning on this spawn point"), RplProp()]
1210  protected float m_fRespawnTime;
1211 
1212  [Attribute(UIWidgets.Auto, desc: "What to do once Spawn Point is used",)]
1213  protected ref array<ref SCR_ScenarioFrameworkActionBase> m_aActionsOnSpawnPointUsed;
1214 
1215  protected IEntity m_Asset;
1216 
1217  //------------------------------------------------------------------------------------------------
1218  override void Init(SCR_ScenarioFrameworkLayerBase object)
1219  {
1220  if (!object)
1221  return;
1222 
1223  super.Init(object);
1224  m_Asset = object.GetSpawnedEntity();
1225  if (!m_Asset)
1226  return;
1227 
1228  SCR_SpawnPoint spawnPoint = SCR_SpawnPoint.Cast(m_Asset);
1229  if (!spawnPoint)
1230  return;
1231 
1232  spawnPoint.SetSpawnRadius(m_fSpawnRadius);
1233  spawnPoint.SetFactionKey(m_sFaction);
1234  spawnPoint.SetVisibleInDeployMapOnly(m_bShowInDeployMapOnly);
1235  spawnPoint.SetIsTimed(m_bTimedSpawnPoint);
1236 
1237  if (m_Info)
1238  {
1239  spawnPoint.LinkInfo(m_Info);
1240  spawnPoint.SetSpawnPointName(m_Info.GetName());
1241  }
1242 
1243  spawnPoint.SetUseNearbySpawnPositions(m_bUseNearbySpawnPositions);
1244  spawnPoint.SetSpawnPositionRange(m_fSpawnPositionUsageRange);
1245  spawnPoint.SetRespawnTime(m_fRespawnTime);
1246 
1247  spawnPoint.GetOnSpawnPointFinalizeSpawn().Insert(OnFinalizeSpawnDone_S);
1248  }
1249 
1250  //------------------------------------------------------------------------------------------------
1251  void OnFinalizeSpawnDone_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data, IEntity entity)
1252  {
1253  foreach (SCR_ScenarioFrameworkActionBase action : m_aActionsOnSpawnPointUsed)
1254  {
1255  action.OnActivate(entity);
1256  }
1257  }
1258 }
OnFinalizeSpawnDone_S
override void OnFinalizeSpawnDone_S(SCR_SpawnRequestComponent requestComponent, SCR_SpawnData data, IEntity entity)
Definition: SCR_PlayerSpawnPoint.c:284
m_aCustomTriggerConditions
protected ref array< ref SCR_CustomTriggerConditions > m_aCustomTriggerConditions
Definition: SCR_CharacterTriggerEntity.c:32
m_iRandomPercent
protected int m_iRandomPercent
Definition: SCR_ScenarioFrameworkLayerBase.c:28
m_aPlugins
protected ref array< ref SCR_ScenarioFrameworkPlugin > m_aPlugins
Definition: SCR_ScenarioFrameworkLayerBase.c:55
GetSpawnedEntities
array< IEntity > GetSpawnedEntities()
Definition: SCR_ScenarioFrameworkLayerBase.c:333
DynamicDespawn
void DynamicDespawn(SCR_ScenarioFrameworkLayerBase layer)
Definition: SCR_ScenarioFrameworkLayerBase.c:680
SCR_PlayerController
Definition: SCR_PlayerController.c:31
SCR_ScenarioFrameworkActivationConditionBase
Definition: SCR_ScenarioFrameworkSlotBase.c:677
m_eActivationType
protected SCR_ScenarioFrameworkEActivationType m_eActivationType
Definition: SCR_ScenarioFrameworkLayerBase.c:43
SCR_EntityHelper
Definition: SCR_EntityHelper.c:1
InitChild
void InitChild(SCR_ScenarioFrameworkLayerBase child)
Definition: SCR_ScenarioFrameworkLayerBase.c:614
SpawnRandomMultipleChildren
void SpawnRandomMultipleChildren(bool previouslyRandomized=false)
Definition: SCR_ScenarioFrameworkLayerBase.c:580
m_sCountdownAudio
protected string m_sCountdownAudio
Definition: SCR_CharacterTriggerEntity.c:59
GetRepeatedSpawnNumber
int GetRepeatedSpawnNumber()
Definition: SCR_ScenarioFrameworkLayerBase.c:413
GetName
string GetName()
Definition: SCR_ScenarioFrameworkLayerBase.c:85
m_bInitiated
protected bool m_bInitiated
Definition: SCR_ScenarioFrameworkLayerBase.c:72
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
RANDOM_MULTIPLE
RANDOM_MULTIPLE
Definition: SCR_ScenarioFrameworkLayerBase.c:12
SCR_BaseFactionTriggerEntity
Definition: SCR_BaseFactionTriggerEntity.c:5
ScriptComponent
SCR_SiteSlotEntityClass ScriptComponent
m_fRepeatSpawnTimeStart
protected WorldTimestamp m_fRepeatSpawnTimeStart
Definition: SCR_ScenarioFrameworkLayerBase.c:67
m_sPlayerActivationNotificationTitle
protected string m_sPlayerActivationNotificationTitle
Definition: SCR_CharacterTriggerEntity.c:53
DrawDebugShape
protected void DrawDebugShape(bool draw)
Definition: SCR_ScenarioFrameworkLayerBase.c:829
SetParentLayer
void SetParentLayer(SCR_ScenarioFrameworkLayerBase parentLayer)
Definition: SCR_ScenarioFrameworkLayerBase.c:255
m_OnAllChildrenSpawned
protected ref ScriptInvokerBase< ScriptInvokerScenarioFrameworkLayerMethod > m_OnAllChildrenSpawned
Definition: SCR_ScenarioFrameworkLayerBase.c:61
GetOnAllChildrenSpawned
ScriptInvokerScenarioFrameworkLayer GetOnAllChildrenSpawned()
Definition: SCR_ScenarioFrameworkLayerBase.c:450
RplProp
SCR_RplTestEntityClass RplProp
Used for handling entity spawning requests for SCR_CatalogEntitySpawnerComponent and inherited classe...
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
m_bShowDebugShapesDuringRuntime
protected bool m_bShowDebugShapesDuringRuntime
Definition: SCR_ScenarioFrameworkLayerBase.c:40
m_bEnableRepeatedSpawn
protected bool m_bEnableRepeatedSpawn
Definition: SCR_ScenarioFrameworkLayerBase.c:31
OnItemRemoved
override protected void OnItemRemoved(BaseInventoryStorageComponent storageOwner, IEntity item)
Definition: SCR_ArsenalInventoryStorageManagerComponent.c:95
m_eActivationPresence
protected TA_EActivationPresence m_eActivationPresence
Definition: SCR_CharacterTriggerEntity.c:20
GetIsTerminated
bool GetIsTerminated()
Definition: SCR_ScenarioFrameworkLayerBase.c:99
Attribute
enum SCR_EScenarioFrameworkSpawnChildrenType Attribute(defvalue:"0", UIWidgets.ComboBox, desc:"Spawn all children, only random one or random multiple ones?", "", ParamEnumArray.FromEnum(SCR_EScenarioFrameworkSpawnChildrenType), category:"Children")] protected SCR_EScenarioFrameworkSpawnChildrenType m_SpawnChildren
m_Area
protected SCR_ScenarioFrameworkArea m_Area
Definition: SCR_ScenarioFrameworkLayerBase.c:64
SpawnChildren
void SpawnChildren(bool previouslyRandomized=false)
Definition: SCR_ScenarioFrameworkLayerBase.c:516
m_aActivationActions
protected ref array< ref SCR_ScenarioFrameworkActionBase > m_aActivationActions
Definition: SCR_ScenarioFrameworkLayerBase.c:49
EDamageState
EDamageState
Definition: EDamageState.c:12
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
ActivateLogic
protected void ActivateLogic()
Definition: SCR_ScenarioFrameworkLayerBase.c:631
SCR_SpawnPoint
Spawn point entity defines positions on which players can possibly spawn.
Definition: SCR_SpawnPoint.c:27
EOnFrame
override void EOnFrame(IEntity owner, float timeSlice)
Definition: SCR_ScenarioFrameworkLayerBase.c:804
GenericEntity
SCR_GenericBoxEntityClass GenericEntity
ScriptInvokerScenarioFrameworkLayer
ScriptInvokerBase< ScriptInvokerScenarioFrameworkLayerMethod > ScriptInvokerScenarioFrameworkLayer
Definition: SCR_ScenarioFrameworkLayerBase.c:9
func
func
Definition: SCR_AIThreatSystem.c:5
GetSpawnedEntity
IEntity GetSpawnedEntity()
Definition: SCR_ScenarioFrameworkLayerBase.c:625
GetLayerTask
SCR_ScenarioFrameworkLayerTask GetLayerTask()
Get layer task the object is nested into if there is some.
Definition: SCR_ScenarioFrameworkLayerBase.c:199
Init
void Init(SCR_ScenarioFrameworkArea area=null, SCR_ScenarioFrameworkEActivationType activation=SCR_ScenarioFrameworkEActivationType.SAME_AS_PARENT)
Definition: SCR_ScenarioFrameworkLayerBase.c:720
m_sFactionKey
protected FactionKey m_sFactionKey
Definition: SCR_ScenarioFrameworkLayerBase.c:25
GetPlayerController
proto external PlayerController GetPlayerController()
Definition: SCR_PlayerDeployMenuHandlerComponent.c:307
OnItemAdded
override protected void OnItemAdded(BaseInventoryStorageComponent storageOwner, IEntity item)
Definition: SCR_ArsenalInventoryStorageManagerComponent.c:56
m_aRandomlySpawnedChildren
protected ref array< SCR_ScenarioFrameworkLayerBase > m_aRandomlySpawnedChildren
Definition: SCR_ScenarioFrameworkLayerBase.c:58
InvokeAllChildrenSpawned
void InvokeAllChildrenSpawned()
Definition: SCR_ScenarioFrameworkLayerBase.c:460
DynamicReinit
void DynamicReinit()
Definition: SCR_ScenarioFrameworkLayerBase.c:711
BaseContainerProps
SCR_ScenarioFrameworkPlugin ScriptAndConfig BaseContainerProps()
m_fRepeatedSpawnTimer
protected float m_fRepeatedSpawnTimer
Definition: SCR_ScenarioFrameworkLayerBase.c:37
m_bExcludeFromDynamicDespawn
protected bool m_bExcludeFromDynamicDespawn
Definition: SCR_ScenarioFrameworkLayerBase.c:52
SetIsTerminated
void SetIsTerminated(bool state)
Definition: SCR_ScenarioFrameworkLayerBase.c:106
SpawnRandomOneChild
void SpawnRandomOneChild(bool previouslyRandomized=false)
Definition: SCR_ScenarioFrameworkLayerBase.c:565
GetLogics
void GetLogics(out array< SCR_ScenarioFrameworkLogic > logics)
Definition: SCR_ScenarioFrameworkLayerBase.c:383
SetDebugShapeSize
void SetDebugShapeSize(float fSize)
Definition: SCR_ScenarioFrameworkLayerBase.c:823
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition: SCR_BaseGameModeComponent.c:15
m_fActivationCountdownTimer
protected float m_fActivationCountdownTimer
Definition: SCR_CharacterTriggerEntity.c:44
GetMaxPlayersForGameMode
int GetMaxPlayersForGameMode(FactionKey factionName="")
Definition: SCR_ScenarioFrameworkLayerBase.c:166
SCR_SpawnData
Definition: SCR_SpawnData.c:9
m_bSearchVehicleInventory
protected bool m_bSearchVehicleInventory
Definition: SCR_CharacterTriggerEntity.c:35
GetSpawnedLogics
array< SCR_ScenarioFrameworkLogic > GetSpawnedLogics()
Definition: SCR_ScenarioFrameworkLayerBase.c:399
GetOrigin
vector GetOrigin()
Definition: SCR_AIUtilityComponent.c:279
m_iRepeatedSpawnNumber
protected int m_iRepeatedSpawnNumber
Definition: SCR_ScenarioFrameworkLayerBase.c:34
SCR_ScenarioFrameworkSlotBase
void SCR_ScenarioFrameworkSlotBase(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_ScenarioFrameworkSlotBase.c:661
GetChildrenEntities
array< SCR_ScenarioFrameworkLayerBase > GetChildrenEntities()
Definition: SCR_ScenarioFrameworkLayerBase.c:340
OnWBKeyChanged
void OnWBKeyChanged(SCR_ScenarioFrameworkLayerBase object)
Definition: SCR_ScenarioFrameworkLayerBase.c:895
m_Info
protected ref SCR_HintUIInfo m_Info
Definition: SCR_BaseHintCondition.c:3
SCR_ContainerActionTitle
SCR_ContainerActionTitle BaseContainerCustomTitle SCR_ContainerActionTitle()] class SCR_ScenarioFrameworkActionBase
Definition: SCR_ScenarioFrameworkActions.c:43
m_fRepeatSpawnTimeEnd
protected WorldTimestamp m_fRepeatSpawnTimeEnd
Definition: SCR_ScenarioFrameworkLayerBase.c:68
m_bOnce
protected bool m_bOnce
Definition: SCR_CharacterTriggerEntity.c:38
GetRandomChildren
SCR_ScenarioFrameworkLayerBase GetRandomChildren()
Returns the random Slot.
Definition: SCR_ScenarioFrameworkLayerBase.c:347
RestoreToDefault
void RestoreToDefault(bool includeChildren=false, bool reinitAfterRestoration=false)
Definition: SCR_ScenarioFrameworkLayerBase.c:642
m_bDynamicallyDespawned
protected bool m_bDynamicallyDespawned
Definition: SCR_ScenarioFrameworkLayerBase.c:74
m_Entity
protected IEntity m_Entity
Definition: SCR_ScenarioFrameworkLayerBase.c:63
m_fMinimumPlayersNeededPercentage
protected float m_fMinimumPlayersNeededPercentage
Definition: SCR_CharacterTriggerEntity.c:41
SCR_ScenarioFrameworkArea
Definition: SCR_ScenarioFrameworkArea.c:24
m_aChildren
protected ref array< SCR_ScenarioFrameworkLayerBase > m_aChildren
Definition: SCR_ScenarioFrameworkLayerBase.c:57
RepeatedSpawn
protected void RepeatedSpawn()
Definition: SCR_ScenarioFrameworkLayerBase.c:426
GetEnableRepeatedSpawn
bool GetEnableRepeatedSpawn()
Definition: SCR_ScenarioFrameworkLayerBase.c:284
m_iSupposedSpawnedChildren
protected int m_iSupposedSpawnedChildren
Definition: SCR_ScenarioFrameworkLayerBase.c:71
GetParentLayer
SCR_ScenarioFrameworkLayerBase GetParentLayer()
Definition: SCR_ScenarioFrameworkLayerBase.c:262
OnPostInit
override void OnPostInit(IEntity owner)
Editable Mine.
Definition: SCR_ScenarioFrameworkLayerBase.c:812
RANDOM_ONE
RANDOM_ONE
Definition: SCR_ScenarioFrameworkLayerBase.c:11
m_iDebugShapeColor
protected int m_iDebugShapeColor
Definition: SCR_ScenarioFrameworkLayerBase.c:69
GetIsInitiated
bool GetIsInitiated()
Definition: SCR_ScenarioFrameworkLayerBase.c:312
SCR_ScenarioFrameworkPlugin
Definition: SCR_ScenarioFrameworkLayerBase.c:888
m_bIsRegistered
protected bool m_bIsRegistered
Definition: SCR_ScenarioFrameworkLayerBase.c:73
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition: SCR_FuelNode.c:128
SetEnableRepeatedSpawn
void SetEnableRepeatedSpawn(bool value)
Definition: SCR_ScenarioFrameworkLayerBase.c:291
GetPlayersCount
int GetPlayersCount(FactionKey factionName="")
Definition: SCR_ScenarioFrameworkLayerBase.c:140
SCR_UIInfo
Definition: SCR_UIInfo.c:7
GetFactionKey
protected FactionKey GetFactionKey()
Definition: SCR_ScenarioFrameworkLayerBase.c:248
m_ParentLayer
protected SCR_ScenarioFrameworkLayerBase m_ParentLayer
Definition: SCR_ScenarioFrameworkLayerBase.c:65
SetRepeatedSpawnNumber
void SetRepeatedSpawnNumber(int number)
Definition: SCR_ScenarioFrameworkLayerBase.c:420
m_bNotificationEnabled
protected bool m_bNotificationEnabled
Definition: SCR_CharacterTriggerEntity.c:47
m_aSpecificClassNames
protected ref array< string > m_aSpecificClassNames
Definition: SCR_CharacterTriggerEntity.c:26
AfterAllChildrenSpawned
void AfterAllChildrenSpawned(SCR_ScenarioFrameworkLayerBase layer)
Definition: SCR_ScenarioFrameworkLayerBase.c:779
SetRandomlySpawnedChildren
void SetRandomlySpawnedChildren(array< string > randomlySpawnedChildren)
Definition: SCR_ScenarioFrameworkLayerBase.c:113
m_iCurrentlySpawnedChildren
protected int m_iCurrentlySpawnedChildren
Definition: SCR_ScenarioFrameworkLayerBase.c:70
SCR_CharacterTriggerEntity
Definition: SCR_CharacterTriggerEntity.c:17
m_bIsTerminated
protected bool m_bIsTerminated
Definition: SCR_ScenarioFrameworkLayerBase.c:75
GetParentArea
SCR_ScenarioFrameworkArea GetParentArea()
Get parent area the object is nested into.
Definition: SCR_ScenarioFrameworkLayerBase.c:179
ScriptInvokerScenarioFrameworkLayerMethod
func ScriptInvokerScenarioFrameworkLayerMethod
Definition: SCR_ScenarioFrameworkLayerBase.c:8
m_bEnableAudio
protected bool m_bEnableAudio
Definition: SCR_CharacterTriggerEntity.c:56
GetSpawnedPlugins
array< ref SCR_ScenarioFrameworkPlugin > GetSpawnedPlugins()
Definition: SCR_ScenarioFrameworkLayerBase.c:406
m_iRepeatedSpawnNumberDefault
int m_iRepeatedSpawnNumberDefault
Definition: SCR_ScenarioFrameworkLayerBase.c:78
SetEntity
void SetEntity(IEntity entity)
Definition: SCR_ScenarioFrameworkLayerBase.c:92
m_aPrefabFilter
protected ref array< ref SCR_ScenarioFrameworkPrefabFilter > m_aPrefabFilter
Definition: SCR_CharacterTriggerEntity.c:29
SCR_EScenarioFrameworkSpawnChildrenType
SCR_EScenarioFrameworkSpawnChildrenType
Definition: SCR_ScenarioFrameworkLayerBase.c:11
GetDynamicDespawnExcluded
bool GetDynamicDespawnExcluded()
Definition: SCR_ScenarioFrameworkLayerBase.c:319
GetSlotTask
SCR_ScenarioFrameworkSlotTask GetSlotTask(array< SCR_ScenarioFrameworkLayerBase > aLayers)
Get SlotTask from array of LayerBases if there is any.
Definition: SCR_ScenarioFrameworkLayerBase.c:217
SCR_ScenarioFrameworkLayerBase
void SCR_ScenarioFrameworkLayerBase(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_ScenarioFrameworkLayerBase.c:875
m_aLogic
protected ref array< SCR_ScenarioFrameworkLogic > m_aLogic
Definition: SCR_ScenarioFrameworkLayerBase.c:59
m_fDebugShapeRadius
protected float m_fDebugShapeRadius
Definition: SCR_ScenarioFrameworkLayerBase.c:66
GetChildren
void GetChildren(out array< SCR_ScenarioFrameworkLayerBase > children)
Definition: SCR_ScenarioFrameworkLayerBase.c:359
data
Get all prefabs that have the spawner data
Definition: SCR_EntityCatalogManagerComponent.c:305
RepeatedSpawnCalled
protected void RepeatedSpawnCalled()
Definition: SCR_ScenarioFrameworkLayerBase.c:437
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
m_aSpawnedEntities
protected ref array< IEntity > m_aSpawnedEntities
Definition: SCR_ScenarioFrameworkLayerBase.c:62
m_eActivationTypeDefault
SCR_ScenarioFrameworkEActivationType m_eActivationTypeDefault
Definition: SCR_ScenarioFrameworkLayerBase.c:79
CheckAllChildrenSpawned
void CheckAllChildrenSpawned(SCR_ScenarioFrameworkLayerBase layer=null)
Definition: SCR_ScenarioFrameworkLayerBase.c:469
SpawnPreviouslyRandomizedChildren
void SpawnPreviouslyRandomizedChildren()
Definition: SCR_ScenarioFrameworkLayerBase.c:554
m_Object
protected SCR_ScenarioFrameworkLayerBase m_Object
Definition: SCR_ScenarioFrameworkLayerBase.c:876
GetActivationType
SCR_ScenarioFrameworkEActivationType GetActivationType()
Definition: SCR_ScenarioFrameworkLayerBase.c:298
SetDynamicDespawnExcluded
void SetDynamicDespawnExcluded(bool excluded)
Definition: SCR_ScenarioFrameworkLayerBase.c:326
SetActivationType
void SetActivationType(SCR_ScenarioFrameworkEActivationType activationType)
Definition: SCR_ScenarioFrameworkLayerBase.c:305
SCR_ScenarioFrameworkLayerBaseClass
Definition: SCR_ScenarioFrameworkLayerBase.c:2
SCR_MissionHeader
Definition: SCR_MissionHeader.c:1
GetRandomlySpawnedChildren
array< SCR_ScenarioFrameworkLayerBase > GetRandomlySpawnedChildren()
Definition: SCR_ScenarioFrameworkLayerBase.c:134
SetFactionKey
protected void SetFactionKey(FactionKey factionKey)
Definition: SCR_ScenarioFrameworkLayerBase.c:242
m_aActivationConditions
protected ref array< ref SCR_ScenarioFrameworkActivationConditionBase > m_aActivationConditions
Definition: SCR_ScenarioFrameworkLayerBase.c:46
OnObjectDamage
void OnObjectDamage(EDamageState state)
Definition: SCR_ScenarioFrameworkSlotBase.c:67
GetSpawnChildrenType
SCR_EScenarioFrameworkSpawnChildrenType GetSpawnChildrenType()
Definition: SCR_ScenarioFrameworkLayerBase.c:277
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180
ALL
ALL
Definition: SCR_ScenarioFrameworkLayerBase.c:10
RANDOM_BASED_ON_PLAYERS_COUNT
RANDOM_BASED_ON_PLAYERS_COUNT
Definition: SCR_ScenarioFrameworkLayerBase.c:14