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_AIChangeUnitState.c
Go to the documentation of this file.
1
class
SCR_AIChangeUnitState
:
AITaskScripted
2
{
3
static
const
string
PORT_STATE =
"UnitState"
;
4
5
[
Attribute
(
"0"
,
UIWidgets
.ComboBox,
"State of unit"
,
""
, ParamEnumArray.FromEnum(EUnitState) )]
6
protected
EUnitState
m_stateToChange
;
7
8
[
Attribute
(
"1"
,
UIWidgets
.CheckBox,
"Add true, remove false"
)]
9
protected
bool
m_stateAdd
;
10
11
protected
static
override
bool
VisibleInPalette
()
12
{
13
return
true
;
14
}
15
16
override
ENodeResult
EOnTaskSimulate
(AIAgent owner,
float
dt)
17
{
18
int
unitState;
19
if
(
GetVariableIn
(PORT_STATE,unitState))
20
{
21
m_stateToChange
=
Math
.AbsInt(unitState);
22
m_stateAdd
= unitState > 0;
23
}
24
25
SCR_ChimeraAIAgent
chimeraAgent =
SCR_ChimeraAIAgent
.Cast(owner);
26
if
(!chimeraAgent)
27
return
SCR_AgentMustChimera
(
this
, owner);
28
29
SCR_AIInfoComponent
infoComp = chimeraAgent.m_InfoComponent;
30
if
(!infoComp)
31
ENodeResult
.FAIL;
32
33
if
(
m_stateAdd
)
34
infoComp.
AddUnitState
(
m_stateToChange
);
35
else
36
infoComp.
RemoveUnitState
(
m_stateToChange
);
37
return
ENodeResult
.SUCCESS;
38
}
39
40
override
string
GetNodeMiddleText
()
41
{
42
string
result =
"Removing"
;
43
if
(
m_stateAdd
)
44
result =
"Adding"
;
45
return
result +
" "
+
typename
.EnumToString(EUnitState,
m_stateToChange
);
46
};
47
48
protected
static
ref
TStringArray
s_aVarsIn
= {
49
PORT_STATE
50
};
51
override
TStringArray
GetVariablesIn
()
52
{
53
return
s_aVarsIn
;
54
}
55
56
static
override
string
GetOnHoverDescription
()
57
{
58
return
"Changes Unit State either adding flag or removing depending of sign of variable in in-port"
;
59
};
60
};
SCR_AgentMustChimera
ENodeResult SCR_AgentMustChimera(Node node, AIAgent owner)
Definition
NodeError.c:21
AITaskScripted
Definition
AITaskScripted.c:13
Math
Definition
Math.c:13
Node::GetVariableIn
proto bool GetVariableIn(string name, out void val)
SCR_AIChangeUnitState
Definition
SCR_AIChangeUnitState.c:2
SCR_AIChangeUnitState::s_aVarsIn
static ref TStringArray s_aVarsIn
Definition
SCR_AIChangeUnitState.c:48
SCR_AIChangeUnitState::m_stateAdd
bool m_stateAdd
Definition
SCR_AIChangeUnitState.c:9
SCR_AIChangeUnitState::GetVariablesIn
override TStringArray GetVariablesIn()
Definition
SCR_AIChangeUnitState.c:51
SCR_AIChangeUnitState::m_stateToChange
EUnitState m_stateToChange
Definition
SCR_AIChangeUnitState.c:6
SCR_AIChangeUnitState::EOnTaskSimulate
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
Definition
SCR_AIChangeUnitState.c:16
SCR_AIChangeUnitState::GetOnHoverDescription
static override string GetOnHoverDescription()
Definition
SCR_AIChangeUnitState.c:56
SCR_AIChangeUnitState::GetNodeMiddleText
override string GetNodeMiddleText()
Definition
SCR_AIChangeUnitState.c:40
SCR_AIChangeUnitState::VisibleInPalette
static override bool VisibleInPalette()
Definition
SCR_AIChangeUnitState.c:11
SCR_AIInfoComponent
Definition
SCR_AIInfoComponent.c:46
SCR_AIInfoComponent::AddUnitState
void AddUnitState(EUnitState state)
Definition
SCR_AIInfoComponent.c:243
SCR_AIInfoComponent::RemoveUnitState
void RemoveUnitState(EUnitState state)
Definition
SCR_AIInfoComponent.c:251
SCR_ChimeraAIAgent
Definition
SCR_ChimeraAIAgent.c:6
UIWidgets
Definition
attributes.c:40
ENodeResult
ENodeResult
Definition
ENodeResult.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
TStringArray
array< string > TStringArray
Definition
Types.c:385
scripts
Game
AI
ScriptedNodes
Soldier
SCR_AIChangeUnitState.c
Generated by
1.17.0