Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_StressTestGroupActivation.c
Go to the documentation of this file.
1 class SCR_StressTestGroupActivationClass : GenericEntityClass
2 {
3 }
4 
6 {
7  [Attribute( defvalue: "1.0", uiwidget: UIWidgets.Slider, desc: "Activate groups every [s]", params: "0 5 0.1" )]
8  float m_fNextGroupTime;
9 
10  ref private array<IEntity> m_entities = {};
11  private int m_iIndex;
12  private float m_fTimeElapsed;
13 
14  //------------------------------------------------------------------------------------------------
15  // constructor
18  void SCR_StressTestGroupActivation(IEntitySource src, IEntity parent)
19  {
20  SetEventMask(EntityEvent.INIT | EntityEvent.FRAME);
21  SetFlags(EntityFlags.ACTIVE, false);
22  }
23 
24  //------------------------------------------------------------------------------------------------
25  override void EOnInit(IEntity owner)
26  {
27  BaseWorld world = GetGame().GetWorld();
28  if (world)
29  world.GetActiveEntities(m_entities);
30  m_iIndex = 0;
31  m_fTimeElapsed = 0;
32  }
33 
34  //------------------------------------------------------------------------------------------------
35  override void EOnFrame(IEntity owner, float timeSlice)
36  {
37  if (m_fTimeElapsed > m_fNextGroupTime)
38  {
39  for (int i = m_iIndex, length = m_entities.Count(); i < length; i++)
40  {
41  SCR_AIGroup group = SCR_AIGroup.Cast(m_entities[i]);
42  if (group)
43  {
44  if (DiagMenu.GetBool(SCR_DebugMenuID.DEBUGUI_AI_PRINT_GROUP_INFO))
45  PrintFormat("Group %1 activated at location %2",group,group.GetOrigin());
46 
47  group.SpawnUnits();
48  m_iIndex = i + 1;
49  m_fTimeElapsed = 0;
50  break;
51  }
52  if (i == m_entities.Count() - 1)
53  {
54  ClearEventMask(EntityEvent.FRAME);
55  if (DiagMenu.GetBool(SCR_DebugMenuID.DEBUGUI_AI_PRINT_GROUP_INFO))
56  Print("SCR_StressTestGroup: activation of groups completed");
57  }
58  }
59  }
60 
61  m_fTimeElapsed += timeSlice;
62  }
63 }
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
m_fTimeElapsed
private float m_fTimeElapsed
Definition: SCR_StressTestGroupActivation.c:12
SCR_StressTestGroupActivation
void SCR_StressTestGroupActivation(IEntitySource src, IEntity parent)
Definition: SCR_StressTestGroupActivation.c:18
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
GenericEntity
SCR_GenericBoxEntityClass GenericEntity
EOnFrame
override void EOnFrame(IEntity owner, float timeSlice)
Definition: SCR_StressTestGroupActivation.c:35
SCR_StressTestGroupActivationClass
Definition: SCR_StressTestGroupActivation.c:1
m_entities
ref private array< IEntity > m_entities
Definition: SCR_StressTestGroupActivation.c:10
EOnInit
override void EOnInit(IEntity owner)
Definition: SCR_StressTestGroupActivation.c:25
m_iIndex
private int m_iIndex
Definition: SCR_StressTestGroupActivation.c:11
SCR_AIGroup
Definition: SCR_AIGroup.c:68
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
SCR_DebugMenuID
SCR_DebugMenuID
This enum contains all IDs for DiagMenu entries added in script.
Definition: DebugMenuID.c:3
Attribute
SCR_StressTestGroupActivationClass GenericEntityClass Attribute(defvalue:"1.0", uiwidget:UIWidgets.Slider, desc:"Activate groups every [s]", params:"0 5 0.1")] float m_fNextGroupTime