Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIDebugTask.c
Go to the documentation of this file.
1// base class for debug nodes. override PrintInternal in child class
3{
4 [Attribute("0", UIWidgets.CheckBox, "Message prefixed with ref to self")]
5 private bool m_bIncludeMe;
6
7 [Attribute("", UIWidgets.EditBox, "Message to show")]
8 private string m_sDebugMessage;
9
10 [Attribute("0", UIWidgets.CheckBox, "Fail node after print?")]
11 protected bool m_bFailAfter;
12
13 static const string PORT_DEBUG_MESSAGE = "DebugMessage";
14
15 //------------------------------------------------------------------------------------------------
16 protected static ref TStringArray s_aVarsIn = {
18 };
20 {
21 return s_aVarsIn;
22 }
23
24 // override this in child class
25 //------------------------------------------------------------------------------------------------
26 protected void PrintInternal(string in)
27 {
28 }
29
30 //------------------------------------------------------------------------------------------------
31 override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
32 {
33//switch defines when neede to debug on server
34//#ifdef AI_DEBUG
35#ifdef WORKBENCH
36 string prefix;
37 if ( m_bIncludeMe )
38 prefix = owner.ToString() + ": ";
39 PrintInternal(prefix + m_sDebugMessage + SCR_AINodePortsHelpers.GetStringFromPort(this, PORT_DEBUG_MESSAGE));
40#endif
41 if (m_bFailAfter)
42 return ENodeResult.FAIL;
43 else
44 return ENodeResult.SUCCESS;
45 }
46
47 //------------------------------------------------------------------------------------------------
48 static override bool VisibleInPalette()
49 {
50 return false;
51 }
52
53 //------------------------------------------------------------------------------------------------
54 override string GetNodeMiddleText()
55 {
56 if (m_bFailAfter)
57 return "FAILS";
58 else
59 return "";
60 }
61};
static const string PORT_DEBUG_MESSAGE
static ref TStringArray s_aVarsIn
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
override string GetNodeMiddleText()
override TStringArray GetVariablesIn()
static override bool VisibleInPalette()
void PrintInternal(string in)
ENodeResult
Definition ENodeResult.c:13
SCR_FieldOfViewSettings Attribute
array< string > TStringArray
Definition Types.c:385