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_AIGroupSetMovementSpeed.c
Go to the documentation of this file.
1
3
class
SCR_AIGroupSetMovementSpeed
:
AITaskScripted
4
{
5
// Inputs
6
protected
static
const
string
SPEED_PORT
=
"Speed"
;
7
8
protected
AIGroupMovementComponent
m_MovementComponent
;
9
protected
SCR_AIGroupSettingsComponent
m_SettingsComp
;
10
11
[
Attribute
(
EMovementType
.IDLE.ToString(),
UIWidgets
.ComboBox, enums: ParamEnumArray.FromEnum(
EMovementType
))]
12
protected
EMovementType
m_eSpeed
;
13
14
//------------------------------------------------------------------------------------------------
15
override
void
OnInit
(AIAgent owner)
16
{
17
super.OnInit(owner);
18
19
m_SettingsComp
= SCR_AIGroupSettingsComponent.Cast(owner.FindComponent(SCR_AIGroupSettingsComponent));
20
m_MovementComponent
= AIGroupMovementComponent.Cast(owner.FindComponent(AIGroupMovementComponent));
21
}
22
23
//------------------------------------------------------------------------------------------------
24
override
ENodeResult
EOnTaskSimulate
(AIAgent owner,
float
dt)
25
{
26
if
(!
m_MovementComponent
)
27
return
ENodeResult
.FAIL;
28
29
EMovementType
speed;
30
31
if
(!
GetVariableIn
(
SPEED_PORT
, speed))
32
speed =
m_eSpeed
;
33
34
// Check if speed is restricted by settings
35
SCR_AIGroupCharactersMovementSpeedSettingBase
setting = null;
36
if
(
m_SettingsComp
)
37
setting =
SCR_AIGroupCharactersMovementSpeedSettingBase
.Cast(
m_SettingsComp
.GetCurrentSetting(
SCR_AIGroupCharactersMovementSpeedSettingBase
));
38
39
if
(setting)
40
speed = setting.GetSpeed(speed);
41
42
m_MovementComponent
.SetGroupCharactersWantedMovementType(speed);
43
44
return
ENodeResult
.SUCCESS;
45
}
46
47
//------------------------------------------------------------------------------------------------
48
static
override
bool
VisibleInPalette
() {
return
true
;}
49
50
//------------------------------------------------------------------------------------------------
51
protected
static
ref
TStringArray
s_aVarsIn
= {
52
SPEED_PORT
53
};
54
override
array<string>
GetVariablesIn
()
55
{
56
return
s_aVarsIn
;
57
}
58
59
//------------------------------------------------------------------------------------------------
60
override
string
GetNodeMiddleText
()
61
{
62
string
s;
63
s = s +
string
.Format(
"Speed: %1\n"
,
typename
.EnumToString(
EMovementType
,
m_eSpeed
));
64
return
s;
65
}
66
67
//------------------------------------------------------------------------------------------------
68
override
static
string
GetOnHoverDescription
()
69
{
70
return
"Sets movement speed of character. Also checks restrictions from settings."
;
71
}
72
};
AITaskScripted
Definition
AITaskScripted.c:13
Node::GetVariableIn
proto bool GetVariableIn(string name, out void val)
SCR_AIGroupCharactersMovementSpeedSettingBase
Definition
SCR_AIGroupCharactersMovementSpeedSetting.c:5
SCR_AIGroupSetMovementSpeed
Definition
SCR_AIGroupSetMovementSpeed.c:4
SCR_AIGroupSetMovementSpeed::VisibleInPalette
static override bool VisibleInPalette()
Definition
SCR_AIGroupSetMovementSpeed.c:48
SCR_AIGroupSetMovementSpeed::GetOnHoverDescription
static override string GetOnHoverDescription()
Definition
SCR_AIGroupSetMovementSpeed.c:68
SCR_AIGroupSetMovementSpeed::m_SettingsComp
SCR_AIGroupSettingsComponent m_SettingsComp
Definition
SCR_AIGroupSetMovementSpeed.c:9
SCR_AIGroupSetMovementSpeed::GetVariablesIn
override array< string > GetVariablesIn()
Definition
SCR_AIGroupSetMovementSpeed.c:54
SCR_AIGroupSetMovementSpeed::EOnTaskSimulate
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
Definition
SCR_AIGroupSetMovementSpeed.c:24
SCR_AIGroupSetMovementSpeed::s_aVarsIn
static ref TStringArray s_aVarsIn
Definition
SCR_AIGroupSetMovementSpeed.c:51
SCR_AIGroupSetMovementSpeed::m_MovementComponent
AIGroupMovementComponent m_MovementComponent
Definition
SCR_AIGroupSetMovementSpeed.c:8
SCR_AIGroupSetMovementSpeed::SPEED_PORT
static const string SPEED_PORT
Definition
SCR_AIGroupSetMovementSpeed.c:6
SCR_AIGroupSetMovementSpeed::m_eSpeed
EMovementType m_eSpeed
Definition
SCR_AIGroupSetMovementSpeed.c:12
SCR_AIGroupSetMovementSpeed::OnInit
override void OnInit(AIAgent owner)
Definition
SCR_AIGroupSetMovementSpeed.c:15
SCR_AIGroupSetMovementSpeed::GetNodeMiddleText
override string GetNodeMiddleText()
Definition
SCR_AIGroupSetMovementSpeed.c:60
UIWidgets
Definition
attributes.c:40
ENodeResult
ENodeResult
Definition
ENodeResult.c:13
EMovementType
EMovementType
Definition
EMovementType.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
TStringArray
array< string > TStringArray
Definition
Types.c:385
scripts
Game
AI
ScriptedNodes
Soldier
SCR_AIGroupSetMovementSpeed.c
Generated by
1.17.0