Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
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 
98 {
102 }
103 
104 enum AnimUpperBodyType
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 
118 enum AnimBackType
119 {
120  None = -1,
121  Small = 161213437,
122  Military = 1935514591,
123  Outdoor = 574855932,
124  Ghillie = 602194810
125 }
126 
127 enum AnimRangedWeaponType
128 {
129  None = 5727960,
130  Rifle = 219116654,
131  Shotgun = 1836650908
132 }
133 
134 class AnimSoundEvent
135 {
136  int m_iID;
138  ref SoundParams m_SoundParams;
139  autoptr NoiseParams m_NoiseParams;
140  bool m_IsValid = false;
141  SoundLookupTable m_Table;
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 
175 
176  if ( GetGame().IsServer() )
177  {
178  string noiseName;
179  if (GetGame().ConfigGetText(soundPath + "noise", noiseName))
180  {
181  m_NoiseParams = new NoiseParams();
182  m_NoiseParams.Load(noiseName);
183  m_IsValid = true;
184  }
185  else
186  {
187  //Print("AnimSoundEvent: \"" + soundPath + "\" doesn't have defined \"noise\"");
188  }
189  }
190  }
191 
192  bool IsValid()
193  {
194  return m_IsValid;
195  }
196 
198  {
199  return m_SoundObjectBuilder;
200  }
201 
202  SoundObjectBuilder GetSoundBuilderEx(int paramHash = 0)
203  {
204  if (m_Table && paramHash)
205  {
206  return m_Table.GetSoundBuilder(paramHash);
207  }
208  return m_SoundObjectBuilder;
209  }
210 
211  SoundObject GetSoundObject(vector position)
212  {
213  GetSoundBuilderEx().AddEnvSoundVariables(position);
214  return GetSoundBuilderEx().BuildSoundObject();
215  }
216 }
217 
218 class AnimSoundVoiceEvent
219 {
220  int m_iID;
222  ref SoundParams m_SoundParams;
223  autoptr NoiseParams m_NoiseParams;
224  bool m_IsValid = false;
225 
226  void AnimSoundVoiceEvent(string soundPath)
227  {
228  m_iID = GetGame().ConfigGetInt(soundPath + "id");
229 
230  if ( !GetGame().IsDedicatedServer() )
231  {
232  string soundSetName;
233  GetGame().ConfigGetText(soundPath + "soundSet", soundSetName);
234  m_SoundParams = new SoundParams(soundSetName);
235  if ( m_SoundParams.IsValid() )
236  {
237  m_SoundObjectBuilder = new SoundObjectBuilder(m_SoundParams);
238  m_IsValid = true;
239  }
240  }
241 
242  if ( GetGame().IsServer() )
243  {
244  string noiseName;
245  if (GetGame().ConfigGetText(soundPath + "noise", noiseName))
246  {
247  m_NoiseParams = new NoiseParams();
248  m_NoiseParams.Load(noiseName);
249  m_IsValid = true;
250  }
251  else
252  {
253  //Print("AnimSoundVoiceEvent: \"" + soundPath + "\" doesn't have defined \"noise\"");
254  }
255  }
256  }
257 
258  bool IsValid()
259  {
260  return m_IsValid;
261  }
262 
264  {
265  return m_SoundObjectBuilder;
266  }
267 
268  SoundObject GetSoundObject(vector position)
269  {
270  m_SoundObjectBuilder.AddEnvSoundVariables(position);
271  return m_SoundObjectBuilder.BuildSoundObject();
272  }
273 }
274 
275 class AnimStepEvent
276 {
277  int m_iID;
278  string m_sSoundLookupTableName;
279  StepSoundLookupTable m_soundLookupTable;
280  autoptr NoiseParams m_NoiseParams;
281 
282  void AnimStepEvent(string stepPath)
283  {
284  m_iID = GetGame().ConfigGetInt(stepPath + "id");
285 
286  if ( !GetGame().IsDedicatedServer() )
287  {
288  GetGame().ConfigGetText(stepPath + "soundLookupTable", m_sSoundLookupTableName);
289  m_soundLookupTable = StepSoundLookupTable.Cast( AnimSoundLookupTableBank.GetInstance().GetStepTable(m_sSoundLookupTableName) );
290  }
291 
292  if ( GetGame().IsServer() )
293  {
294  string noiseName;
295  if (GetGame().ConfigGetText(stepPath + "noise",noiseName))
296  {
297  m_NoiseParams = new NoiseParams();
298  m_NoiseParams.Load(noiseName);
299  }
300  }
301  }
302 
303  SoundObjectBuilder GetSoundBuilder(int surfaceHash)
304  {
305  return m_soundLookupTable.GetSoundBuilder(surfaceHash);
306  }
307 }
308 
309 class AnimDamageEvent
310 {
311  int m_iID;
312  autoptr AnimDamageParams m_DamageParams;
313 
314  void AnimDamageEvent(string damagePath)
315  {
316  m_iID = GetGame().ConfigGetInt(damagePath + "id");
317 
318  string damageName;
319  GetGame().ConfigGetText(damagePath + "damage", damageName);
320  m_DamageParams = new AnimDamageParams(damageName);
321  }
322 }
323 
324 class AnimDamageParams
325 {
326  string m_sName;
327  string m_sBoneName;
328  string m_sAmmoName;
329  float m_fRadius;
330  float m_fDuration;
331  bool m_bInvertTeams;
332 
333  static const string DAMAGE_CFG_CLASS = "CfgDamages ";
334  void AnimDamageParams(string damageName)
335  {
336  m_sName = damageName;
337  string damagePath = DAMAGE_CFG_CLASS + damageName + " ";
338 
339  GetGame().ConfigGetText(damagePath + "bone", m_sBoneName);
340  GetGame().ConfigGetText(damagePath + "ammo", m_sAmmoName);
341  m_fRadius = GetGame().ConfigGetFloat(damagePath + "radius");
342  m_fDuration = GetGame().ConfigGetFloat(damagePath + "duration");
343 
344  m_bInvertTeams = false;
345  string str_invert_teams_cfg;
346  GetGame().ConfigGetText(damagePath + "invertTeams", str_invert_teams_cfg);
347  str_invert_teams_cfg.ToLower();
348  if (str_invert_teams_cfg == "true")
349  {
350  m_bInvertTeams = true;
351  }
352  }
353 }
354 
355 class AnimEffectParams
356 {
357  string m_sName;
358 
359  static const string EFFECT_CFG_CLASS = "CfgEffects ";
360  void AnimEffectParams(string effectName)
361  {
362  m_sName = effectName;
363  string effectPath = EFFECT_CFG_CLASS + effectName + " ";
364  //TODO load params
365  }
366 }
GetSoundBuilder
SoundObjectBuilder GetSoundBuilder(int parameterHash)
Definition: dayzanimeventmaps.c:51
GetGame
proto native CGame GetGame()
Outdoor
enum AnimBootsType Outdoor
None
enum AnimBootsType None
Definition: dayzanimevents.c:99
Sneakers
@ Sneakers
Definition: dayzanimevents.c:100
m_NoiseParams
class AttachmentSoundLookupTable extends SoundLookupTable m_NoiseParams
ChemlonDress
enum AnimBootsType ChemlonDress
SoundObject
class SoundObjectBuilder SoundObject(SoundParams soundParams)
Military
enum AnimBootsType Military
SoundObjectBuilder
void SoundObjectBuilder(SoundParams soundParams)
TShirt
enum AnimBootsType TShirt
StepSoundLookupTable
class SoundLookupTable StepSoundLookupTable()
Definition: dayzanimeventmaps.c:81
IsValid
proto bool IsValid()
Checks if the ScriptCaller is valid.
Definition: cfgplayerspawndatajson.c:134
AnimBootsType
AnimBootsType
Definition: dayzanimevents.c:97
SoundParams
Definition: sound.c:100
vector
Definition: enconvert.c:105
NoiseParams
class ObjectSpawnerHandler NoiseParams
NylonJacket
enum AnimBootsType NylonJacket
Coat
enum AnimBootsType Coat
Boots
@ Boots
Definition: dayzanimevents.c:101
HeavyJacket
enum AnimBootsType HeavyJacket
m_SoundObjectBuilder
private ref SoundObjectBuilder m_SoundObjectBuilder
Definition: dayzplayer.c:165
AnimSoundLookupTableBank
class AnimSoundObjectBuilderBank AnimSoundLookupTableBank()
Definition: dayzanimeventmaps.c:179
SoundObjectBuilder
Definition: sound.c:45
SoundLookupTable
Definition: dayzanimeventmaps.c:2
Chainmail
enum AnimBootsType Chainmail
WoolShirt
enum AnimBootsType WoolShirt
LeatherJacket
enum AnimBootsType LeatherJacket
Ghillie
enum AnimBootsType Ghillie
Small
enum AnimBootsType Small