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_AIGetSmartActionSentinelParams.c
Go to the documentation of this file.
1
class
SCR_AIGetSmartActionSentinelParams
:
AITaskScripted
2
{
3
static
const
string
SMART_ACTION_GUARD_PORT =
"SmartActionGuard"
;
4
static
const
string
POSITION_PORT =
"OutPos"
;
5
static
const
string
LOOK_DIRECTION_PORT =
"LookPosition"
;
6
static
const
string
LOOK_DIRECTION_RANGE_PORT =
"LookDirectionRange"
;
7
static
const
string
STANCE_PORT =
"Stance"
;
8
static
const
string
USE_BINOCULARS_PORT =
"UseBinoculars"
;
9
static
const
string
LEANING_PORT =
"LeaningType"
;
10
11
protected
static
override
bool
VisibleInPalette
()
12
{
13
return
true
;
14
}
15
16
//-----------------------------------------------------------------------------------------------------------------------------------------
17
protected
static
ref
TStringArray
s_aVarsIn
= {
18
SMART_ACTION_GUARD_PORT
19
};
20
override
TStringArray
GetVariablesIn
()
21
{
22
return
s_aVarsIn
;
23
}
24
25
//-----------------------------------------------------------------------------------------------------------------------------------------
26
protected
static
ref
TStringArray
s_aVarsOut
= {
27
POSITION_PORT,
28
LOOK_DIRECTION_PORT,
29
LOOK_DIRECTION_RANGE_PORT,
30
STANCE_PORT,
31
USE_BINOCULARS_PORT,
32
LEANING_PORT
33
};
34
override
TStringArray
GetVariablesOut
()
35
{
36
return
s_aVarsOut
;
37
}
38
39
//-----------------------------------------------------------------------------------------------------------------------------------------
40
override
ENodeResult
EOnTaskSimulate
(AIAgent owner,
float
dt)
41
{
42
SCR_AISmartActionSentinelComponent
smartAction;
43
if
(!
GetVariableIn
(SMART_ACTION_GUARD_PORT, smartAction) || !smartAction)
44
{
45
NodeError
(
this
, owner,
"Invalid SCR_AISmartActionSentinelComponent provided!"
);
46
return
ENodeResult
.FAIL;
47
}
48
49
IEntity
actionOwner = smartAction.GetOwner();
50
51
vector
worldPosition = smartAction.GetActionOffset(), worldPositionToLook = smartAction.GetLookPosition(), smartObjectPos = actionOwner.
GetOrigin
();
52
vector
mat[4];
53
actionOwner.
GetWorldTransform
(mat);
54
worldPosition = smartObjectPos + worldPosition.Multiply3(mat);
55
if
(worldPositionToLook ==
vector
.Zero)
56
worldPositionToLook = smartObjectPos + (10 *
vector
.Forward).Multiply3(mat);
57
else
58
worldPositionToLook = smartObjectPos + worldPositionToLook.Multiply3(mat);
59
60
SetVariableOut
(POSITION_PORT, worldPosition);
61
SetVariableOut
(LOOK_DIRECTION_PORT, worldPositionToLook);
62
SetVariableOut
(LOOK_DIRECTION_RANGE_PORT, smartAction.GetLookDirectionRange());
63
SetVariableOut
(STANCE_PORT, smartAction.GetDesiredStance());
64
SetVariableOut
(USE_BINOCULARS_PORT, smartAction.GetUseBinoculars());
65
switch
(smartAction.GetLeaningType())
66
{
67
case
ELeaningType
.LEFT :
68
{
69
SetVariableOut
(LEANING_PORT,
"CharacterLeanToggleLeft"
);
70
break
;
71
};
72
case
ELeaningType
.RIGHT :
73
{
74
SetVariableOut
(LEANING_PORT,
"CharacterLeanToggleRight"
);
75
break
;
76
};
77
default
:
78
{
79
ClearVariable
(LEANING_PORT);
80
};
81
};
82
return
ENodeResult
.SUCCESS;
83
}
84
};
NodeError
ENodeResult NodeError(Node node, AIAgent owner, string msg)
Error call to be used in scripted BT nodes.
Definition
NodeError.c:3
ELeaningType
ELeaningType
Definition
SCR_AISmartActionSentinelComponent.c:2
AITaskScripted
Definition
AITaskScripted.c:13
IEntity
Definition
IEntity.c:13
IEntity::GetOrigin
proto external vector GetOrigin()
IEntity::GetWorldTransform
proto external void GetWorldTransform(out vector mat[])
See IEntity::GetTransform.
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_AIGetSmartActionSentinelParams
Definition
SCR_AIGetSmartActionSentinelParams.c:2
SCR_AIGetSmartActionSentinelParams::GetVariablesOut
override TStringArray GetVariablesOut()
Definition
SCR_AIGetSmartActionSentinelParams.c:34
SCR_AIGetSmartActionSentinelParams::EOnTaskSimulate
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
Definition
SCR_AIGetSmartActionSentinelParams.c:40
SCR_AIGetSmartActionSentinelParams::s_aVarsIn
static ref TStringArray s_aVarsIn
Definition
SCR_AIGetSmartActionSentinelParams.c:17
SCR_AIGetSmartActionSentinelParams::s_aVarsOut
static ref TStringArray s_aVarsOut
Definition
SCR_AIGetSmartActionSentinelParams.c:26
SCR_AIGetSmartActionSentinelParams::GetVariablesIn
override TStringArray GetVariablesIn()
Definition
SCR_AIGetSmartActionSentinelParams.c:20
SCR_AIGetSmartActionSentinelParams::VisibleInPalette
static override bool VisibleInPalette()
Definition
SCR_AIGetSmartActionSentinelParams.c:11
SCR_AISmartActionSentinelComponent
Definition
SCR_AISmartActionSentinelComponent.c:80
vector
Definition
vector.c:13
ENodeResult
ENodeResult
Definition
ENodeResult.c:13
TStringArray
array< string > TStringArray
Definition
Types.c:385
scripts
Game
AI
ScriptedNodes
Soldier
SCR_AIGetSmartActionSentinelParams.c
Generated by
1.17.0