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_AIProcessOrder.c
Go to the documentation of this file.
1
class
SCR_AIProcessOrder
:
AITaskScripted
2
{
3
static
const
string
ORDER_PORT =
"OrderObjectIn"
;
4
static
const
string
ORDER_TYPE =
"OrderTypeOut"
;
5
static
const
string
SCRIPTED_ORDER =
"IsScriptedOrder"
;
6
static
const
string
ORDER_VALUE =
"SciptedOrderValue"
;
7
static
const
string
ORDER_DEBUG_TEXT =
"DebugText"
;
8
9
10
[
Attribute
(
"0"
,
UIWidgets
.CheckBox,
"Log Debug"
)]
11
bool
m_bDebugMe;
12
13
AIOrder
m_Order;
14
string
m_sDebugString;
15
16
override
ENodeResult
EOnTaskSimulate(AIAgent owner,
float
dt)
17
{
18
if
(!
GetVariableIn
(ORDER_PORT, m_Order))
19
return
ENodeResult
.FAIL;
20
if
(!m_Order)
21
return
ENodeResult
.FAIL;
22
23
SetVariableOut
(ORDER_DEBUG_TEXT, m_Order.GetText());
24
25
SCR_AIOrderBase
order =
SCR_AIOrderBase
.Cast(m_Order);
26
if
(!order && m_Order)
27
{
28
SetVariableOut
(ORDER_TYPE, m_Order.GetOrderType());
29
SetVariableOut
(SCRIPTED_ORDER,
false
);
30
ClearVariable
(ORDER_VALUE);
31
}
32
else
33
{
34
order.GetOrderParameters(
this
);
35
#ifdef WORKBENCH
36
if
(m_bDebugMe)
37
PrintFormat
(
"%1 : %2"
,owner,m_sDebugString);
38
#endif
39
}
40
41
#ifdef WORKBENCH
42
SCR_AIOrderBase
scriptOrder =
SCR_AIOrderBase
.Cast(m_Order);
43
string
dbgString;
44
if
(scriptOrder)
45
dbgString =
typename
.EnumToString(
EOrderType_Character
,scriptOrder.m_eOrderType);
46
else
47
dbgString = m_Order.GetOrderTypeString();
48
SCR_AIDebugVisualization
.
VisualizeMessage
(owner.GetControlledEntity(), dbgString,
EAIDebugCategory
.ORDER, 3);
49
#endif
50
51
#ifdef AI_DEBUG
52
AddDebugMessage(owner,
string
.Format(
"Process order: %1, from BT: %2"
, order, order.m_sSentFromBt));
53
#endif
54
55
return
ENodeResult
.SUCCESS;
56
}
57
58
protected
static
ref
TStringArray
s_aVarsOut
= {
59
SCRIPTED_ORDER,
60
ORDER_TYPE,
61
ORDER_VALUE,
62
ORDER_DEBUG_TEXT
63
};
64
override
TStringArray
GetVariablesOut
()
65
{
66
return
s_aVarsOut
;
67
}
68
69
protected
static
ref
TStringArray
s_aVarsIn
= {
70
ORDER_PORT
71
};
72
override
TStringArray
GetVariablesIn
()
73
{
74
return
s_aVarsIn
;
75
}
76
77
static
override
bool
VisibleInPalette
()
78
{
79
return
true
;
80
}
81
82
static
override
string
GetOnHoverDescription
()
83
{
84
return
"Process order: reads order and gets type and data of order from it"
;
85
};
86
87
#ifdef AI_DEBUG
88
protected
void
AddDebugMessage(AIAgent agent,
string
str)
89
{
90
SCR_AIInfoBaseComponent infoComp = SCR_AIInfoBaseComponent.Cast(agent.FindComponent(SCR_AIInfoBaseComponent));
91
infoComp.AddDebugMessage(str, msgType:
EAIDebugMsgType
.MAILBOX);
92
}
93
#endif
94
};
EAIDebugMsgType
EAIDebugMsgType
Definition
SCR_AIDebugMessage.c:2
EOrderType_Character
EOrderType_Character
Definition
SCR_AIOrder.c:2
EAIDebugCategory
EAIDebugCategory
Definition
SCR_AIWorld.c:12
AIOrder
Specialized message to send orders between AI agents.
Definition
AIOrder.c:14
AITaskScripted
Definition
AITaskScripted.c:13
Node::SetVariableOut
proto void SetVariableOut(string name, void val)
Node::GetVariableIn
proto bool GetVariableIn(string name, out void val)
Node::ClearVariable
proto void ClearVariable(string name)
SCR_AIDebugVisualization
Definition
SCR_AIDebugVisualization.c:10
SCR_AIDebugVisualization::VisualizeMessage
static void VisualizeMessage(IEntity entity, string message, EAIDebugCategory category, float showTime, Color color=Color.White, float fontSize=16, bool ignoreCategory=false)
Definition
SCR_AIDebugVisualization.c:34
SCR_AIOrderBase
Definition
SCR_AIOrder.c:15
SCR_AIProcessOrder
Definition
SCR_AIProcessOrder.c:2
SCR_AIProcessOrder::s_aVarsOut
static ref TStringArray s_aVarsOut
Definition
SCR_AIProcessOrder.c:58
SCR_AIProcessOrder::GetVariablesIn
override TStringArray GetVariablesIn()
Definition
SCR_AIProcessOrder.c:72
SCR_AIProcessOrder::VisibleInPalette
static override bool VisibleInPalette()
Definition
SCR_AIProcessOrder.c:77
SCR_AIProcessOrder::s_aVarsIn
static ref TStringArray s_aVarsIn
Definition
SCR_AIProcessOrder.c:69
SCR_AIProcessOrder::GetVariablesOut
override TStringArray GetVariablesOut()
Definition
SCR_AIProcessOrder.c:64
SCR_AIProcessOrder::GetOnHoverDescription
static override string GetOnHoverDescription()
Definition
SCR_AIProcessOrder.c:82
UIWidgets
Definition
attributes.c:40
ENodeResult
ENodeResult
Definition
ENodeResult.c:13
PrintFormat
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)
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
TStringArray
array< string > TStringArray
Definition
Types.c:385
scripts
Game
AI
ScriptedNodes
Orders
SCR_AIProcessOrder.c
Generated by
1.17.0