DayZ 1.24
Loading...
Searching...
No Matches
DayZAnimEvents.c
Go to the documentation of this file.
1/*enum AnimSurfaces
2 {
3 cp_concrete1,
4 cp_concrete2,
5
6 cp_dirt,
7
8 cp_broadleaf_dense1,
9 cp_broadleaf_dense2,
10 cp_broadleaf_sparse1,
11 cp_broadleaf_sparse2,
12
13 cp_conifer_common1,
14 cp_conifer_common2,
15 cp_conifer_moss1,
16 cp_conifer_moss2,
17
18 cp_grass,
19 cp_grass_tall,
20
21 cp_gravel,
22 cp_rock,
23
24 asphalt_ext,
25 asphalt_int,
26
27 asphalt_destroyed_ext,
28 asphalt_destroyed_int,
29
30 concrete_ext,
31 concrete_int,
32
33 stone_ext,
34 stone_int,
35
36 gravel_large_ext,
37 gravel_large_int,
38
39 gravel_small_ext,
40 gravel_small_int,
41
42 sand_ext,
43 sand_int,
44
45 dirt_ext,
46 dirt_int,
47
48 rubble_large_ext,
49 rubble_large_int,
50
51 rubble_small_ext,
52 rubble_small_int,
53
54 trash_ext,
55 trash_int,
56
57 grass_dry_ext,
58 grass_dry_int,
59
60 metal_thick_ext,
61 metal_thick_int,
62
63 metal_thin_ext,
64 metal_thin_int,
65
66 metal_thin_mesh_ext,
67 metal_thin_mesh_int,
68
69 asphalt_felt_ext,
70 asphalt_felt_int,
71
72 ceramic_tiles_ext,
73 ceramic_tiles_int,
74
75 lino_ext,
76 lino_int,
77
78 textile_carpet_ext,
79 textile_carpet_int,
80
81 wood_parquet_ext,
82 wood_parquet_int,
83
84 wood_planks_ext,
85 wood_planks_int,
86
87 concrete_stairs_ext,
88 concrete_stairs_int,
89
90 metal_stairs_ext,
91 metal_stairs_int,
92
93 wood_planks_stairs_ext,
94 wood_planks_stairs_int
95 }*/
96
103
105{
106 None = 4107064,//string hash, because we can't make compile time constant
107 NylonJacket = 1228024514,
108 TShirt = 1690896446,
109 WoolShirt = 1060939383,
110 HeavyJacket = 1544363355,
111 LeatherJacket = 2008520095,
112 Coat = 3549415,
113 ChemlonDress = -1491825621,
114 Ghillie = 602194810,
115 Chainmail = -563873622,
116}
117
118enum AnimBackType
119{
120 None = -1,
121 Small = 161213437,
122 Military = 1935514591,
123 Outdoor = 574855932,
124 Ghillie = 602194810
125}
126
128{
129 None = 5727960,
130 Rifle = 219116654,
131 Shotgun = 1836650908
132}
133
134class AnimSoundEvent
135{
136 int m_iID;
138 ref SoundParams m_SoundParams;
140 bool m_IsValid = false;
142
143
144 void AnimSoundEvent(string soundPath)
145 {
146 m_iID = GetGame().ConfigGetInt(soundPath + "id");
147
148#ifndef SERVER
149
150 string soundSetName;
151 if (GetGame().ConfigGetText(soundPath + "soundSet", soundSetName))
152 {
153 m_SoundParams = new SoundParams(soundSetName);
154 if (m_SoundParams.IsValid())
155 {
156 m_SoundObjectBuilder = new SoundObjectBuilder(m_SoundParams);
157 m_IsValid = true;
158 }
159 }
160
161 string tableName;
162 if (GetGame().ConfigGetText(soundPath + "soundLookupTable", tableName))
163 {
164 m_Table = AnimSoundLookupTableBank.GetInstance().GetActionTable(tableName);
165 if (m_Table)
166 {
167 m_IsValid = true;
168 //Print("Found lookup table '"+tableName +"' for anim event-----------------------------------------> " + m_iID);
169 }
170 }
171#endif
172
173
174 if (GetGame().IsServer())
175 {
176 string noiseName;
177 if (GetGame().ConfigGetText(soundPath + "noise", noiseName))
178 {
181 m_IsValid = true;
182 }
183 else
184 {
185 //Print("AnimSoundEvent: \"" + soundPath + "\" doesn't have defined \"noise\"");
186 }
187 }
188 }
189
190 bool IsValid()
191 {
192 return m_IsValid;
193 }
194
196 {
198 }
199
201 {
202 if (m_Table && paramHash)
203 return m_Table.GetSoundBuilder(paramHash);
205 }
206
208 {
209 GetSoundBuilderEx().AddEnvSoundVariables(position);
210 return GetSoundBuilderEx().BuildSoundObject();
211 }
212}
213
215{
216 int m_iID;
218 ref SoundParams m_SoundParams;
220 bool m_IsValid = false;
221
222 void AnimSoundVoiceEvent(string soundPath)
223 {
224 m_iID = GetGame().ConfigGetInt(soundPath + "id");
225
226 if (!GetGame().IsDedicatedServer())
227 {
228 string soundSetName;
229 GetGame().ConfigGetText(soundPath + "soundSet", soundSetName);
230 m_SoundParams = new SoundParams(soundSetName);
231 if (m_SoundParams.IsValid())
232 {
233 m_SoundObjectBuilder = new SoundObjectBuilder(m_SoundParams);
234 m_IsValid = true;
235 }
236 }
237
238 if (GetGame().IsServer())
239 {
240 string noiseName;
241 if (GetGame().ConfigGetText(soundPath + "noise", noiseName))
242 {
245 m_IsValid = true;
246 }
247 else
248 {
249 //Print("AnimSoundVoiceEvent: \"" + soundPath + "\" doesn't have defined \"noise\"");
250 }
251 }
252 }
253
254 bool IsValid()
255 {
256 return m_IsValid;
257 }
258
260 {
262 }
263
265 {
266 m_SoundObjectBuilder.AddEnvSoundVariables(position);
267 return m_SoundObjectBuilder.BuildSoundObject();
268 }
269}
270
271class AnimStepEvent
272{
273 int m_iID;
277
278 void AnimStepEvent(string stepPath)
279 {
280 m_iID = GetGame().ConfigGetInt(stepPath + "id");
281
282 if (!GetGame().IsDedicatedServer())
283 {
284 GetGame().ConfigGetText(stepPath + "soundLookupTable", m_sSoundLookupTableName);
286 }
287
288 if (GetGame().IsServer())
289 {
290 string noiseName;
291 if (GetGame().ConfigGetText(stepPath + "noise", noiseName))
292 {
295 }
296 }
297 }
298
300 {
301 return m_soundLookupTable.GetSoundBuilder(surfaceHash);
302 }
303}
304
305class AnimDamageEvent
306{
307 int m_iID;
309
310 void AnimDamageEvent(string damagePath)
311 {
312 m_iID = GetGame().ConfigGetInt(damagePath + "id");
313
314 string damageName;
315 GetGame().ConfigGetText(damagePath + "damage", damageName);
317 }
318}
319
321{
322 string m_sName;
323 string m_sBoneName;
324 string m_sAmmoName;
325 float m_fRadius;
326 float m_fDuration;
327 bool m_bInvertTeams;
328
329 static const string DAMAGE_CFG_CLASS = "CfgDamages ";
330 void AnimDamageParams(string damageName)
331 {
333 string damagePath = DAMAGE_CFG_CLASS + damageName + " ";
334
335 GetGame().ConfigGetText(damagePath + "bone", m_sBoneName);
336 GetGame().ConfigGetText(damagePath + "ammo", m_sAmmoName);
337 m_fRadius = GetGame().ConfigGetFloat(damagePath + "radius");
338 m_fDuration = GetGame().ConfigGetFloat(damagePath + "duration");
339
340 m_bInvertTeams = false;
342 GetGame().ConfigGetText(damagePath + "invertTeams", str_invert_teams_cfg);
343 str_invert_teams_cfg.ToLower();
344 if (str_invert_teams_cfg == "true")
345 m_bInvertTeams = true;
346 }
347}
348
350{
351 string m_sName;
352
353 static const string EFFECT_CFG_CLASS = "CfgEffects ";
354 void AnimEffectParams(string effectName)
355 {
357 string effectPath = EFFECT_CFG_CLASS + effectName + " ";
358 //TODO load params
359 }
360}
proto bool IsValid()
Checks if the ScriptCaller is valid.
class AnimSoundObjectBuilderBank AnimSoundLookupTableBank()
class AttachmentSoundLookupTable extends SoundLookupTable m_NoiseParams
class SoundLookupTable StepSoundLookupTable()
SoundObjectBuilder GetSoundBuilder(int parameterHash)
enum AnimBootsType NylonJacket
enum AnimBootsType TShirt
enum AnimBootsType Chainmail
enum AnimBootsType Small
enum AnimBootsType Ghillie
enum AnimBootsType Outdoor
enum AnimBootsType ChemlonDress
enum AnimBootsType Military
enum AnimBootsType Coat
AnimBootsType
@ Boots
@ Sneakers
enum AnimBootsType WoolShirt
enum AnimBootsType None
enum AnimBootsType LeatherJacket
enum AnimBootsType HeavyJacket
class NoiseSystem NoiseParams()
Definition Noise.c:15
class SoundObjectBuilder SoundObject(SoundParams soundParams)
void SoundObjectBuilder(SoundParams soundParams)
ref SoundObjectBuilder m_SoundObjectBuilder
Definition dayzplayer.c:0
proto native CGame GetGame()