Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_AIDebugCounter.c
Go to the documentation of this file.
1
// Node for debug and test purpouses
2
class
SCR_AIDebugCounter
:
AITaskScripted
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
= {
21
PORT_VAR_IN
22
};
23
override
TStringArray
GetVariablesIn
()
24
{
25
return
s_aVarsIn
;
26
}
27
28
//------------------------------------------------------------------------------------------------
29
protected
static
ref
TStringArray
s_aVarsOut
= {
30
PORT_VAR_OUT
31
};
32
override
array<string>
GetVariablesOut
()
33
{
34
return
s_aVarsOut
;
35
}
36
37
//------------------------------------------------------------------------------------------------
38
override
void
OnAbort
(AIAgent owner,
Node
nodeCausingAbort)
39
{
40
if
(
m_bIncrementOnAbort
)
41
{
42
int
count;
43
GetVariableIn
(
PORT_VAR_IN
, count);
44
count++;
45
if
(
m_sDebugMessage
!=
string
.Empty)
46
Print
(
"DebugCounter: "
+
m_sDebugMessage
);
47
SetVariableOut
(
PORT_VAR_OUT
, count);
48
}
49
}
50
51
//------------------------------------------------------------------------------------------------
52
override
ENodeResult
EOnTaskSimulate
(AIAgent owner,
float
dt)
53
{
54
if
(
m_bWaitOnAbort
)
55
return
ENodeResult
.RUNNING;
56
57
int
count;
58
GetVariableIn
(
PORT_VAR_IN
, count);
59
count++;
60
if
(
m_sDebugMessage
!=
string
.Empty)
61
Print
(
"DebugCounter: "
+
m_sDebugMessage
);
62
SetVariableOut
(
PORT_VAR_OUT
, count);
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 =
""
;
92
if
(
m_bIncrementOnAbort
)
93
text =
"Increment OnAbort\n"
;
94
if
(
m_bWaitOnAbort
)
95
return
text +
"RUNNING"
;
96
if
(
m_bFailAfter
)
97
return
text +
"FAILS"
;
98
else
99
return
text +
"SUCESS"
;
100
}
101
};
AITaskScripted
Definition
AITaskScripted.c:13
Node
Definition
Node.c:13
Node::SetVariableOut
proto void SetVariableOut(string name, void val)
Node::GetVariableIn
proto bool GetVariableIn(string name, out void val)
SCR_AIDebugCounter
Definition
SCR_AIDebugCounter.c:3
SCR_AIDebugCounter::s_aVarsIn
static ref TStringArray s_aVarsIn
Definition
SCR_AIDebugCounter.c:20
SCR_AIDebugCounter::m_bFailAfter
bool m_bFailAfter
Definition
SCR_AIDebugCounter.c:5
SCR_AIDebugCounter::PORT_VAR_IN
static const string PORT_VAR_IN
Definition
SCR_AIDebugCounter.c:16
SCR_AIDebugCounter::GetNodeMiddleText
override string GetNodeMiddleText()
Definition
SCR_AIDebugCounter.c:89
SCR_AIDebugCounter::m_bIncrementOnAbort
bool m_bIncrementOnAbort
Definition
SCR_AIDebugCounter.c:11
SCR_AIDebugCounter::GetVariablesOut
override array< string > GetVariablesOut()
Definition
SCR_AIDebugCounter.c:32
SCR_AIDebugCounter::m_bWaitOnAbort
bool m_bWaitOnAbort
Definition
SCR_AIDebugCounter.c:8
SCR_AIDebugCounter::m_sDebugMessage
string m_sDebugMessage
Definition
SCR_AIDebugCounter.c:14
SCR_AIDebugCounter::GetVariablesIn
override TStringArray GetVariablesIn()
Definition
SCR_AIDebugCounter.c:23
SCR_AIDebugCounter::PORT_VAR_OUT
static const string PORT_VAR_OUT
Definition
SCR_AIDebugCounter.c:17
SCR_AIDebugCounter::GetOnHoverDescription
static override string GetOnHoverDescription()
Definition
SCR_AIDebugCounter.c:83
SCR_AIDebugCounter::CanReturnRunning
bool CanReturnRunning()
Definition
SCR_AIDebugCounter.c:77
SCR_AIDebugCounter::OnAbort
override void OnAbort(AIAgent owner, Node nodeCausingAbort)
Definition
SCR_AIDebugCounter.c:38
SCR_AIDebugCounter::VisibleInPalette
static override bool VisibleInPalette()
Definition
SCR_AIDebugCounter.c:71
SCR_AIDebugCounter::s_aVarsOut
static ref TStringArray s_aVarsOut
Definition
SCR_AIDebugCounter.c:29
SCR_AIDebugCounter::EOnTaskSimulate
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
Definition
SCR_AIDebugCounter.c:52
UIWidgets
Definition
attributes.c:40
ENodeResult
ENodeResult
Definition
ENodeResult.c:13
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
TStringArray
array< string > TStringArray
Definition
Types.c:385
scripts
Game
AI
ScriptedNodes
Debug
SCR_AIDebugCounter.c
Generated by
1.17.0