Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AITaskTimerGate.c
Go to the documentation of this file.
2 {
3  //------------------------------------------------------------------------------------------------
4 
5  override void OnEnter(AIAgent owner)
6  {
7 
8  }
9 
10  //------------------------------------------------------------------------------------------------
11  override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
12  {
13  if (GetVariableType(true, "Time") == float)
14  {
15  GetVariableIn("Time", m_Time);
16  if ( m_Time < 0)
17  isInfinite = true;
18  };
19 
20  bool reset;
21  GetVariableIn("ResetTime", reset);
22  if ( reset )
23  {
24  elapsedTime = 0;
25  SetVariableOut("ResetTimeOut", false);
26  };
27  elapsedTime += dt;
28 
29  if (GetVariableType(false, "Trigger") == bool)
30  {
31  bool res = elapsedTime > m_Time && !isInfinite;
32  SetVariableOut("Trigger", res);
33  }
34 
35  if (GetVariableType(false, "ElapsedTime") == float)
36  {
37  SetVariableOut("ElapsedTime", elapsedTime);
38  }
39 
40  if (elapsedTime < m_Time || isInfinite)
41  {
42  return ENodeResult.RUNNING;
43  }
44  else
45  {
46  elapsedTime = 0;
47  return ENodeResult.SUCCESS;
48  }
49 
50 
51  }
52 
53  //------------------------------------------------------------------------------------------------
54  override bool VisibleInPalette()
55  {
56  return true;
57  }
58 
59  //------------------------------------------------------------------------------------------------
60  protected override string GetOnHoverDescription()
61  {
62  return "Task Timer 2: similar to Task Timer, only is running while time has not elapsed";
63  }
64 
65  //------------------------------------------------------------------------------------------------
66 
67  override protected bool CanReturnRunning()
68  {
69  return true;
70  }
71 };
m_Time
WorldTimestamp m_Time
Definition: SCR_EditorManagerCore.c:581
SCR_AITaskTimerGate
Definition: SCR_AITaskTimerGate.c:1
SCR_AITaskTimer
Definition: SCR_AITaskTimer.c:1