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_AIAnimationWaypoint.c
Go to the documentation of this file.
1
class
SCR_AIAnimationWaypointClass
:
SCR_AIWaypointClass
2
{
3
};
4
5
//------------------------------------------------------------------------------------------------
6
class
SCR_AIAnimationParameters
7
{
8
vector
m_vAnimationLocalTransform[4];
9
float
m_fAnimationDuration;
10
ref
SCR_AIAnimation_Base
m_oAnimationClass;
11
}
12
13
//------------------------------------------------------------------------------------------------
14
[
BaseContainerProps
()]
15
class
SCR_AIAnimationWaypointParameters
16
{
17
[
Attribute
(
""
,
UIWidgets
.Object,
"Animation position and angles - use PointInfo"
)]
18
ref
PointInfo
m_oAnimationLocalTransform;
19
[
Attribute
(
"-1"
,
UIWidgets
.EditBox,
"Animation duration [s], -1 for indefinite"
)]
20
float
m_fAnimationDuration
;
21
[
Attribute
(
""
,
UIWidgets
.Object,
"Animation methods"
)]
22
ref
SCR_AIAnimation_Base
m_oAnimationClass
;
23
24
private
ref
SCR_AIAnimationParameters
m_Parameters;
25
26
void
SCR_AIAnimationWaypointParameters()
27
{
28
if
(
SCR_Global
.
IsEditMode
())
29
return
;
30
m_Parameters =
new
SCR_AIAnimationParameters
;
31
if
(m_oAnimationLocalTransform)
32
m_oAnimationLocalTransform.GetLocalTransform(m_Parameters.m_vAnimationLocalTransform);
33
m_Parameters.m_fAnimationDuration =
m_fAnimationDuration
;
34
m_Parameters.m_oAnimationClass =
m_oAnimationClass
;
35
}
36
37
//------------------------------------------------------------------------------------------------
38
SCR_AIAnimationParameters GetParameters()
39
{
40
return
m_Parameters;
41
}
42
43
//------------------------------------------------------------------------------------------------
44
void
SetParameters(vector animationTransform[4],
float
animationDuration, SCR_AIAnimation_Base animationClass)
45
{
46
m_Parameters.m_vAnimationLocalTransform = animationTransform;
47
m_Parameters.m_fAnimationDuration = animationDuration;
48
m_Parameters.m_oAnimationClass = animationClass;
49
}
50
};
51
52
//------------------------------------------------------------------------------------------------
53
[
BaseContainerProps
()]
54
class
SCR_AIAnimationScript
55
{
56
[
Attribute
(
""
,
UIWidgets
.EditBox,
"Actor name"
,
""
)]
57
string
m_sAgentsName;
58
59
[
Attribute
(
""
,
UIWidgets
.Object,
"Animation list to perform by the actor given by the index (of group member)"
)]
60
protected
ref array<ref SCR_AIAnimationWaypointParameters>
m_aAgentAnimationParameters
;
61
62
//------------------------------------------------------------------------------------------------
63
string
GetAnimationActorName
()
64
{
65
return
m_sAgentsName;
66
}
67
68
//------------------------------------------------------------------------------------------------
69
void
SetAnimationActorName
(
string
actorName)
70
{
71
m_sAgentsName = actorName;
72
}
73
74
//------------------------------------------------------------------------------------------------
75
void
AddAnimationWaypointParameter
(notnull SCR_AIAnimationWaypointParameters animationWaypointParameter,
int
animationIndex)
76
{
77
if
(!
m_aAgentAnimationParameters
)
78
m_aAgentAnimationParameters
= {};
79
80
m_aAgentAnimationParameters
.InsertAt(animationWaypointParameter, animationIndex);
81
}
82
83
//------------------------------------------------------------------------------------------------
84
bool
RemoveAnimationWaypointParameter
(SCR_AIAnimationWaypointParameters animationWaypointParameter)
85
{
86
int
animationIndex =
m_aAgentAnimationParameters
.Find(animationWaypointParameter);
87
if
(animationIndex < 0)
88
return
false
;
89
m_aAgentAnimationParameters
.RemoveOrdered(animationIndex);
90
return
true
;
91
}
92
93
//------------------------------------------------------------------------------------------------
94
SCR_AIAnimationWaypointParameters
GetParameters
(
int
animationIndex)
95
{
96
return
m_aAgentAnimationParameters
[animationIndex];
97
}
98
99
//------------------------------------------------------------------------------------------------
100
bool
IsAnimationIndexValid
(
int
animationIndex)
101
{
102
return
m_aAgentAnimationParameters
.IsIndexValid(animationIndex);
103
}
104
105
//------------------------------------------------------------------------------------------------
106
vector
GetAnimationPosition
(
IEntity
rootEntity,
int
animationIndex)
107
{
108
if
(!
m_aAgentAnimationParameters
.IsIndexValid(animationIndex))
109
return
vector
.Zero;
110
vector
mat[4], outMat[4];
111
rootEntity.
GetWorldTransform
(mat);
112
Math3D
.MatrixMultiply4(mat,
m_aAgentAnimationParameters
[animationIndex].
GetParameters
().
m_vAnimationLocalTransform
, outMat);
113
return
outMat[3];
114
}
115
116
//------------------------------------------------------------------------------------------------
117
void
GetAnimationWorldTransform
(
IEntity
rootEntity,
int
animationIndex, out
vector
transform[4])
118
{
119
if
(!
m_aAgentAnimationParameters
.IsIndexValid(animationIndex))
120
return
;
121
vector
origMat[4];
122
rootEntity.
GetWorldTransform
(origMat);
123
Math3D
.MatrixMultiply4(origMat,
m_aAgentAnimationParameters
[animationIndex].
GetParameters
().
m_vAnimationLocalTransform
, transform);
124
}
125
126
//------------------------------------------------------------------------------------------------
127
float
GetAnimationDuration
(
int
animationIndex)
128
{
129
if
(!
m_aAgentAnimationParameters
.IsIndexValid(animationIndex))
130
return
0;
131
return
m_aAgentAnimationParameters
[animationIndex].GetParameters().m_fAnimationDuration;
132
}
133
134
//------------------------------------------------------------------------------------------------
135
SCR_AIAnimation_Base
GetAnimationClass
(
int
animationIndex)
136
{
137
if
(!
m_aAgentAnimationParameters
.IsIndexValid(animationIndex))
138
return
null;
139
return
m_aAgentAnimationParameters
[animationIndex].GetParameters().m_oAnimationClass;
140
}
141
};
142
143
//------------------------------------------------------------------------------------------------
144
void
SCR_AIOnAnimationBehaviorAction
(AIAgent agent,
bool
startingAnimation,
int
animationIndex);
145
typedef
func
SCR_AIOnAnimationBehaviorAction
;
146
147
//------------------------------------------------------------------------------------------------
148
class
SCR_AIAnimationWaypoint
:
SCR_AIWaypoint
149
{
150
[
Attribute
(
""
,
UIWidgets
.Object,
"List of group members scripts - what to do on this waypoint, each member has array of animations on locations"
)]
151
ref array<ref SCR_AIAnimationScript> m_aAnimationScripts;
152
153
protected
ref ScriptInvokerBase<SCR_AIOnAnimationBehaviorAction>
m_OnAnimationBehaviorAction
;
// called if any of the waypoint's users (characters) start or stop animation
154
155
//----------------------------------------------------------------------------------------
156
void
AddAnimationScript
(notnull
SCR_AIAnimationScript
animationScript,
int
animationIndex = -1)
157
{
158
if
(animationIndex < 0)
159
m_aAnimationScripts.Insert(animationScript);
160
else
161
m_aAnimationScripts.InsertAt(animationScript, animationIndex);
162
}
163
164
//----------------------------------------------------------------------------------------
165
bool
RemoveAnimationScript
(
SCR_AIAnimationScript
animationScript)
166
{
167
int
animationIndex = m_aAnimationScripts.Find(animationScript);
168
if
(animationIndex < 0)
169
return
false
;
170
m_aAnimationScripts.RemoveOrdered(animationIndex);
171
return
true
;
172
}
173
174
//----------------------------------------------------------------------------------------
175
override
SCR_AIWaypointState
CreateWaypointState
(
SCR_AIGroupUtilityComponent
groupUtilityComp)
176
{
177
return
new
SCR_AIAnimationWaypointState
(groupUtilityComp,
this
);
178
}
179
180
//----------------------------------------------------------------------------------------
181
ScriptInvokerBase<SCR_AIOnAnimationBehaviorAction>
GetOnAnimationBehaviorAction
()
182
{
183
if
(!
m_OnAnimationBehaviorAction
)
184
m_OnAnimationBehaviorAction
=
new
ScriptInvokerBase<SCR_AIOnAnimationBehaviorAction>();
185
return
m_OnAnimationBehaviorAction
;
186
}
187
};
188
189
//------------------------------------------------------------------------------------------------
190
class
SCR_AIAnimationWaypointState
:
SCR_AIWaypointState
191
{
192
//------------------------------------------------------------------------------------------------
193
override
void
OnExecuteWaypointTree
()
194
{
195
super.OnExecuteWaypointTree();
196
SCR_AIAnimationWaypoint
waypoint =
SCR_AIAnimationWaypoint
.Cast(
m_Waypoint
);
197
if
(!waypoint &&
m_Waypoint
)
198
m_Utility
.m_Owner.CompleteWaypoint(
m_Waypoint
);
199
200
auto
activity =
new
SCR_AIAnimateActivity
(
m_Utility
, waypoint, priorityLevel: waypoint.GetPriorityLevel());
201
m_Utility
.AddAction(activity);
202
}
203
};
m_oAnimationClass
ref SCR_AIAnimation_Base m_oAnimationClass
Definition
SCR_AIAnimationWaypoint.c:17
SCR_AIOnAnimationBehaviorAction
func SCR_AIOnAnimationBehaviorAction
Definition
SCR_AIAnimationWaypoint.c:145
m_vAnimationLocalTransform
vector m_vAnimationLocalTransform[4]
Definition
SCR_AIAnimationWaypoint.c:15
m_fAnimationDuration
float m_fAnimationDuration
Definition
SCR_AIAnimationWaypoint.c:16
BaseContainerProps
class SCR_AIAnimationScript BaseContainerProps
Definition
SCR_AIAnimationWaypoint.c:14
func
func
Definition
SCR_AIThreatSystem.c:6
IEntity
Definition
IEntity.c:13
IEntity::GetWorldTransform
proto external void GetWorldTransform(out vector mat[])
See IEntity::GetTransform.
Math3D
Definition
Math3D.c:13
PointInfo
PointInfo - allows to define position.
Definition
PointInfo.c:9
SCR_AIAnimateActivity
Definition
SCR_AIAnimateActivity.c:2
SCR_AIAnimation_Base
Definition
SCR_AIAnimation_Base.c:6
SCR_AIAnimationParameters
Definition
SCR_AIAnimationWaypoint.c:7
SCR_AIAnimationScript
Definition
SCR_AIAnimationWaypoint.c:55
SCR_AIAnimationScript::GetAnimationWorldTransform
void GetAnimationWorldTransform(IEntity rootEntity, int animationIndex, out vector transform[4])
Definition
SCR_AIAnimationWaypoint.c:117
SCR_AIAnimationScript::GetAnimationDuration
float GetAnimationDuration(int animationIndex)
Definition
SCR_AIAnimationWaypoint.c:127
SCR_AIAnimationScript::GetAnimationPosition
vector GetAnimationPosition(IEntity rootEntity, int animationIndex)
Definition
SCR_AIAnimationWaypoint.c:106
SCR_AIAnimationScript::GetAnimationActorName
string GetAnimationActorName()
Definition
SCR_AIAnimationWaypoint.c:63
SCR_AIAnimationScript::AddAnimationWaypointParameter
void AddAnimationWaypointParameter(notnull SCR_AIAnimationWaypointParameters animationWaypointParameter, int animationIndex)
Definition
SCR_AIAnimationWaypoint.c:75
SCR_AIAnimationScript::GetAnimationClass
SCR_AIAnimation_Base GetAnimationClass(int animationIndex)
Definition
SCR_AIAnimationWaypoint.c:135
SCR_AIAnimationScript::RemoveAnimationWaypointParameter
bool RemoveAnimationWaypointParameter(SCR_AIAnimationWaypointParameters animationWaypointParameter)
Definition
SCR_AIAnimationWaypoint.c:84
SCR_AIAnimationScript::SetAnimationActorName
void SetAnimationActorName(string actorName)
Definition
SCR_AIAnimationWaypoint.c:69
SCR_AIAnimationScript::m_aAgentAnimationParameters
ref array< ref SCR_AIAnimationWaypointParameters > m_aAgentAnimationParameters
Definition
SCR_AIAnimationWaypoint.c:60
SCR_AIAnimationScript::IsAnimationIndexValid
bool IsAnimationIndexValid(int animationIndex)
Definition
SCR_AIAnimationWaypoint.c:100
SCR_AIAnimationScript::GetParameters
SCR_AIAnimationWaypointParameters GetParameters(int animationIndex)
Definition
SCR_AIAnimationWaypoint.c:94
SCR_AIAnimationWaypointClass
Definition
SCR_AIAnimationWaypoint.c:2
SCR_AIAnimationWaypoint
Definition
SCR_AIAnimationWaypoint.c:149
SCR_AIAnimationWaypoint::m_OnAnimationBehaviorAction
ref ScriptInvokerBase< SCR_AIOnAnimationBehaviorAction > m_OnAnimationBehaviorAction
Definition
SCR_AIAnimationWaypoint.c:153
SCR_AIAnimationWaypoint::CreateWaypointState
override SCR_AIWaypointState CreateWaypointState(SCR_AIGroupUtilityComponent groupUtilityComp)
Definition
SCR_AIAnimationWaypoint.c:175
SCR_AIAnimationWaypoint::AddAnimationScript
void AddAnimationScript(notnull SCR_AIAnimationScript animationScript, int animationIndex=-1)
Definition
SCR_AIAnimationWaypoint.c:156
SCR_AIAnimationWaypoint::GetOnAnimationBehaviorAction
ScriptInvokerBase< SCR_AIOnAnimationBehaviorAction > GetOnAnimationBehaviorAction()
Definition
SCR_AIAnimationWaypoint.c:181
SCR_AIAnimationWaypoint::RemoveAnimationScript
bool RemoveAnimationScript(SCR_AIAnimationScript animationScript)
Definition
SCR_AIAnimationWaypoint.c:165
SCR_AIAnimationWaypointState
Definition
SCR_AIAnimationWaypoint.c:191
SCR_AIGroupUtilityComponent
Definition
SCR_AIGroupUtilityComponent.c:18
SCR_AIWaypointClass
Definition
SCR_AIWaypoint.c:2
SCR_AIWaypoint::SCR_AIWaypoint
void SCR_AIWaypoint(IEntitySource src, IEntity parent)
Definition
SCR_AIWaypoint.c:16
SCR_AIWaypointState
Definition
SCR_AIWaypointState.c:7
SCR_AIWaypointState::m_Utility
SCR_AIGroupUtilityComponent m_Utility
Definition
SCR_AIWaypointState.c:8
SCR_AIWaypointState::SCR_AIWaypointState
void SCR_AIWaypointState(notnull SCR_AIGroupUtilityComponent utility, SCR_AIWaypoint waypoint)
Definition
SCR_AIWaypointState.c:11
SCR_AIWaypointState::OnExecuteWaypointTree
void OnExecuteWaypointTree()
Definition
SCR_AIWaypointState.c:31
SCR_AIWaypointState::m_Waypoint
AIWaypoint m_Waypoint
Definition
SCR_AIWaypointState.c:9
SCR_Global
Definition
Functions.c:7
SCR_Global::IsEditMode
static bool IsEditMode()
Definition
Functions.c:1566
UIWidgets
Definition
attributes.c:40
vector
Definition
vector.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
AI
Group
SCR_AIAnimationWaypoint.c
Generated by
1.17.0