Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_StressTestGroupActivation.c
Go to the documentation of this file.
1class SCR_StressTestGroupActivationClass : GenericEntityClass
2{
3}
4
5class SCR_StressTestGroupActivation : GenericEntity
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 {
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;
50 break;
51 }
52 if (i == m_entities.Count() - 1)
53 {
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}
SCR_DebugMenuID
This enum contains all IDs for DiagMenu entries added in script.
Definition DebugMenuID.c:4
ArmaReforgerScripted GetGame()
Definition game.c:1398
void SCR_AIGroup(IEntitySource src, IEntity parent)
float m_fTimeElapsed
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
enum EVehicleType IEntity
proto external EntityEvent SetEventMask(EntityEvent e)
void EOnInit(IEntity owner)
void EOnFrame(IEntity owner, float timeSlice)
proto external EntityEvent ClearEventMask(EntityEvent e)
proto external EntityFlags SetFlags(EntityFlags flags, bool recursively=false)
void SpawnUnits()
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
Definition EntityEvent.c:14
EntityFlags
Various entity flags.
Definition EntityFlags.c:14