DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
DayZAnimEvents.c
См. документацию.
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
104enum 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
118enum AnimBackType
119{
120 None = -1,
121 Small = 161213437,
122 Military = 1935514591,
123 Outdoor = 574855932,
124 Ghillie = 602194810
125}
126
127enum AnimRangedWeaponType
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;
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 {
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 {
200 }
201
202 SoundObjectBuilder GetSoundBuilderEx(int paramHash = 0)
203 {
204 if (m_Table && paramHash)
205 {
206 return m_Table.GetSoundBuilder(paramHash);
207 }
209 }
210
211 SoundObject GetSoundObject(vector position)
212 {
213 GetSoundBuilderEx().AddEnvSoundVariables(position);
214 return GetSoundBuilderEx().BuildSoundObject();
215 }
216}
217
218class AnimSoundVoiceEvent
219{
220 int m_iID;
222 ref SoundParams m_SoundParams;
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 {
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 {
266 }
267
268 SoundObject GetSoundObject(vector position)
269 {
270 m_SoundObjectBuilder.AddEnvSoundVariables(position);
272 }
273}
274
275class AnimStepEvent
276{
277 int m_iID;
278 string m_sSoundLookupTableName;
279 StepSoundLookupTable m_soundLookupTable;
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 {
298 m_NoiseParams.Load(noiseName);
299 }
300 }
301 }
302
303 SoundObjectBuilder GetSoundBuilder(int surfaceHash)
304 {
305 return m_soundLookupTable.GetSoundBuilder(surfaceHash);
306 }
307}
308
309class 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
324class 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
355class 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}
proto bool IsValid()
Checks if the ScriptCaller is valid.
Определения CfgPlayerSpawnDataJson.c:134
bool m_IsValid
Определения CatchingContextBase.c:17
class AnimSoundObjectBuilderBank AnimSoundLookupTableBank()
Определения DayZAnimEventMaps.c:179
class AttachmentSoundLookupTable extends SoundLookupTable m_NoiseParams
class SoundLookupTable StepSoundLookupTable()
Определения DayZAnimEventMaps.c:81
SoundObjectBuilder GetSoundBuilder(int parameterHash)
Определения DayZAnimEventMaps.c:131
void SoundLookupTable()
Определения DayZAnimEventMaps.c:82
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
Определения DayZAnimEvents.c:98
@ Boots
Определения DayZAnimEvents.c:101
@ Sneakers
Определения DayZAnimEvents.c:100
enum AnimBootsType WoolShirt
enum AnimBootsType LeatherJacket
enum AnimBootsType HeavyJacket
class NoiseSystem NoiseParams()
Определения Noise.c:15
static AnimSoundObjectBuilderBank GetInstance()
Определения DayZAnimEventMaps.c:141
proto native float ConfigGetFloat(string path)
Get float value from config on path.
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
SoundObjectBuilder GetSoundBuilder(int parameterHash)
Определения DayZAnimEventMaps.c:53
ref SoundObjectBuilder m_SoundObjectBuilder
Определения dayzplayer.c:0
proto native CGame GetGame()
@ None
Определения EnWorld.c:73
class AbstractSoundScene SoundObjectBuilder(SoundParams soundParams)
void SoundObject(SoundParams soundParams)
class SoundObject SoundParams(string name)
proto native SoundObject BuildSoundObject(SoundObjectBuilder soundObjectbuilder)
proto int ToLower()
Changes string to lowercase. Returns length.