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_DefendWaypoint.c
Go to the documentation of this file.
1
class
SCR_DefendWaypointClass
:
SCR_TimedWaypointClass
2
{
3
};
4
5
//----------------------------------------------------------------------------------------
6
class
SCR_DefendWaypoint
:
SCR_TimedWaypoint
7
{
8
[
Attribute
(
"0"
,
UIWidgets
.Object,
"Fast init - units will be spawned on their defensive locations"
)];
9
protected
bool
m_bFastInit
;
10
11
[
Attribute
(
""
,
UIWidgets
.Object,
"Defend presets"
)];
12
protected
ref array<ref SCR_DefendWaypointPreset>
m_aDefendPresets
;
13
14
protected
int
m_iCurrentDefendPreset
;
15
16
//----------------------------------------------------------------------------------------
17
bool
GetFastInit
()
18
{
19
return
m_bFastInit
;
20
}
21
22
//----------------------------------------------------------------------------------------
23
void
SetFastInit
(
bool
isFastInit)
24
{
25
m_bFastInit
= isFastInit;
26
}
27
28
//----------------------------------------------------------------------------------------
29
override
SCR_AIWaypointState
CreateWaypointState
(
SCR_AIGroupUtilityComponent
groupUtilityComp)
30
{
31
return
new
SCR_AIDefendWaypointState
(groupUtilityComp,
this
);
32
}
33
34
//------------------------------------------------------------------------------------------------
36
void
ClearDefendPresets
()
37
{
38
if
(
m_aDefendPresets
)
39
m_aDefendPresets
.Clear();
40
}
41
42
//----------------------------------------------------------------------------------------
43
SCR_DefendWaypointPreset
GetCurrentDefendPreset
()
44
{
45
if
(!
m_aDefendPresets
.IsIndexValid(
m_iCurrentDefendPreset
))
46
return
null;
47
return
m_aDefendPresets
[
m_iCurrentDefendPreset
];
48
}
49
50
//----------------------------------------------------------------------------------------
51
int
GetCurrentDefendPresetIndex
()
52
{
53
return
m_iCurrentDefendPreset
;
54
}
55
56
//----------------------------------------------------------------------------------------
57
bool
SetCurrentDefendPreset
(
int
newDefendPresetIndex)
58
{
59
if
(
m_aDefendPresets
.IsIndexValid(newDefendPresetIndex))
60
{
61
m_iCurrentDefendPreset
= newDefendPresetIndex;
62
return
true
;
63
}
64
return
false
;
65
}
66
67
//----------------------------------------------------------------------------------------
68
bool
AddDefendPreset
(
SCR_DefendWaypointPreset
preset)
69
{
70
if
(!
m_aDefendPresets
.Contains(preset))
71
{
72
m_aDefendPresets
.Insert(preset);
73
return
true
;
74
}
75
return
false
;
76
}
77
78
//----------------------------------------------------------------------------------------
79
bool
RemoveDefendPreset
(
int
presetIndex)
80
{
81
if
(
m_aDefendPresets
.IsIndexValid(presetIndex))
82
{
83
m_aDefendPresets
.Remove(presetIndex);
84
return
true
;
85
}
86
return
false
;
87
}
88
};
89
90
//----------------------------------------------------------------------------------------
91
class
SCR_AIDefendWaypointState
:
SCR_AIWaypointState
92
{
93
override
void
OnDeselected
()
94
{
95
super.OnDeselected();
96
97
SCR_AIGroup
myGroup =
m_Utility
.m_Owner;
98
99
if
(!myGroup)
100
return
;
101
102
array<AIAgent> groupMembers = {};
103
myGroup.GetAgents(groupMembers);
104
105
AICommunicationComponent mailbox = myGroup.GetCommunicationComponent();
106
if
(!mailbox)
107
return
;
108
109
foreach
(AIAgent receiver: groupMembers)
110
{
111
if
(receiver)
112
{
113
SCR_ChimeraAIAgent
chimeraAgent =
SCR_ChimeraAIAgent
.Cast(receiver);
114
if
(!chimeraAgent)
115
continue
;
116
117
SCR_AIInfoComponent
aiInfo = chimeraAgent.m_InfoComponent;
118
if
(!aiInfo || !aiInfo.
HasUnitState
(EUnitState.IN_TURRET))
119
continue
;
120
121
ChimeraCharacter
character =
ChimeraCharacter
.Cast(receiver.GetControlledEntity());
122
if
(character && character.IsInVehicle())
123
{
124
SCR_AIMessage_GetOut
msg2 =
new
SCR_AIMessage_GetOut
();
125
126
msg2.SetText(
"Waypoint was deselected, leave vehicle"
);
127
msg2.SetReceiver(receiver);
128
mailbox.RequestBroadcast(msg2, receiver);
129
}
130
}
131
}
132
myGroup.
ReleaseCompartments
();
133
}
134
};
ChimeraCharacter
Definition
ChimeraCharacter.c:13
SCR_AIDefendWaypointState
Definition
SCR_DefendWaypoint.c:92
SCR_AIGroup
Definition
SCR_AIGroup.c:75
SCR_AIGroup::ReleaseCompartments
void ReleaseCompartments()
Definition
SCR_AIGroup.c:2024
SCR_AIGroupUtilityComponent
Definition
SCR_AIGroupUtilityComponent.c:18
SCR_AIInfoComponent
Definition
SCR_AIInfoComponent.c:46
SCR_AIInfoComponent::HasUnitState
bool HasUnitState(EUnitState state)
Definition
SCR_AIInfoComponent.c:261
SCR_AIMessage_GetOut
Definition
SCR_AIMessage.c:640
SCR_AIWaypointState
Definition
SCR_AIWaypointState.c:7
SCR_AIWaypointState::m_Utility
SCR_AIGroupUtilityComponent m_Utility
Definition
SCR_AIWaypointState.c:8
SCR_AIWaypointState::OnDeselected
void OnDeselected()
Definition
SCR_AIWaypointState.c:24
SCR_AIWaypointState::SCR_AIWaypointState
void SCR_AIWaypointState(notnull SCR_AIGroupUtilityComponent utility, SCR_AIWaypoint waypoint)
Definition
SCR_AIWaypointState.c:11
SCR_ChimeraAIAgent
Definition
SCR_ChimeraAIAgent.c:6
SCR_DefendWaypointClass
Definition
SCR_DefendWaypoint.c:2
SCR_DefendWaypoint
Definition
SCR_DefendWaypoint.c:7
SCR_DefendWaypoint::GetFastInit
bool GetFastInit()
Definition
SCR_DefendWaypoint.c:17
SCR_DefendWaypoint::AddDefendPreset
bool AddDefendPreset(SCR_DefendWaypointPreset preset)
Definition
SCR_DefendWaypoint.c:68
SCR_DefendWaypoint::SetCurrentDefendPreset
bool SetCurrentDefendPreset(int newDefendPresetIndex)
Definition
SCR_DefendWaypoint.c:57
SCR_DefendWaypoint::ClearDefendPresets
void ClearDefendPresets()
Clears Defend Presets.
Definition
SCR_DefendWaypoint.c:36
SCR_DefendWaypoint::SetFastInit
void SetFastInit(bool isFastInit)
Definition
SCR_DefendWaypoint.c:23
SCR_DefendWaypoint::m_aDefendPresets
ref array< ref SCR_DefendWaypointPreset > m_aDefendPresets
Definition
SCR_DefendWaypoint.c:12
SCR_DefendWaypoint::m_bFastInit
bool m_bFastInit
Definition
SCR_DefendWaypoint.c:9
SCR_DefendWaypoint::GetCurrentDefendPreset
SCR_DefendWaypointPreset GetCurrentDefendPreset()
Definition
SCR_DefendWaypoint.c:43
SCR_DefendWaypoint::m_iCurrentDefendPreset
int m_iCurrentDefendPreset
Definition
SCR_DefendWaypoint.c:14
SCR_DefendWaypoint::CreateWaypointState
override SCR_AIWaypointState CreateWaypointState(SCR_AIGroupUtilityComponent groupUtilityComp)
Definition
SCR_DefendWaypoint.c:29
SCR_DefendWaypoint::RemoveDefendPreset
bool RemoveDefendPreset(int presetIndex)
Definition
SCR_DefendWaypoint.c:79
SCR_DefendWaypoint::GetCurrentDefendPresetIndex
int GetCurrentDefendPresetIndex()
Definition
SCR_DefendWaypoint.c:51
SCR_DefendWaypointPreset
Definition
SCR_DefendWaypointPreset.c:7
SCR_TimedWaypointClass
Definition
SCR_TimedWaypoint.c:2
SCR_TimedWaypoint
Definition
SCR_TimedWaypoint.c:25
UIWidgets
Definition
attributes.c:40
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
AI
Group
SCR_DefendWaypoint.c
Generated by
1.17.0