Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIDebugCounter.c
Go to the documentation of this file.
1// Node for debug and test purpouses
3{
4 [Attribute("0", UIWidgets.CheckBox, "Fail node after simulate?")]
5 protected bool m_bFailAfter;
6
7 [Attribute("0", UIWidgets.CheckBox, "Running until OnAbort")]
8 protected bool m_bWaitOnAbort;
9
10 [Attribute("0", UIWidgets.CheckBox, "Increment OnAbort")]
11 protected bool m_bIncrementOnAbort;
12
13 [Attribute("", UIWidgets.Auto, "Echo when increased")]
14 protected string m_sDebugMessage;
15
16 static const string PORT_VAR_IN = "Counter";
17 static const string PORT_VAR_OUT= "Out";
18
19 //------------------------------------------------------------------------------------------------
20 protected static ref TStringArray s_aVarsIn = {
22 };
24 {
25 return s_aVarsIn;
26 }
27
28 //------------------------------------------------------------------------------------------------
29 protected static ref TStringArray s_aVarsOut = {
31 };
32 override array<string> GetVariablesOut()
33 {
34 return s_aVarsOut;
35 }
36
37 //------------------------------------------------------------------------------------------------
38 override void OnAbort(AIAgent owner, Node nodeCausingAbort)
39 {
41 {
42 int count;
44 count++;
45 if (m_sDebugMessage != string.Empty)
46 Print("DebugCounter: " + m_sDebugMessage);
48 }
49 }
50
51 //------------------------------------------------------------------------------------------------
52 override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
53 {
55 return ENodeResult.RUNNING;
56
57 int count;
59 count++;
60 if (m_sDebugMessage != string.Empty)
61 Print("DebugCounter: " + m_sDebugMessage);
63
64 if (m_bFailAfter)
65 return ENodeResult.FAIL;
66
67 return ENodeResult.SUCCESS;
68 }
69
70 //------------------------------------------------------------------------------------------------
71 static override bool VisibleInPalette()
72 {
73 return true;
74 }
75
76 //------------------------------------------------------------------------------------------------
77 static override protected bool CanReturnRunning()
78 {
79 return true;
80 }
81
82 //------------------------------------------------------------------------------------------------
83 protected static override string GetOnHoverDescription()
84 {
85 return "Increments variable for debug with configurable node behavior.";
86 }
87
88 //------------------------------------------------------------------------------------------------
89 override string GetNodeMiddleText()
90 {
91 string text = "";
93 text = "Increment OnAbort\n";
95 return text + "RUNNING";
96 if (m_bFailAfter)
97 return text + "FAILS";
98 else
99 return text + "SUCESS";
100 }
101};
Definition Node.c:13
proto void SetVariableOut(string name, void val)
proto bool GetVariableIn(string name, out void val)
static ref TStringArray s_aVarsIn
static const string PORT_VAR_IN
override string GetNodeMiddleText()
override array< string > GetVariablesOut()
override TStringArray GetVariablesIn()
static const string PORT_VAR_OUT
static override string GetOnHoverDescription()
override void OnAbort(AIAgent owner, Node nodeCausingAbort)
static override bool VisibleInPalette()
static ref TStringArray s_aVarsOut
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
ENodeResult
Definition ENodeResult.c:13
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
SCR_FieldOfViewSettings Attribute
array< string > TStringArray
Definition Types.c:385