8 string stepsCfgPath =
"CfgVehicles SurvivorBase AnimEvents Steps ";
9 int stepsCount =
GetGame().ConfigGetChildrenCount(stepsCfgPath);
10 for(
int i = 0; i < stepsCount; i++)
13 GetGame().ConfigGetChildName(stepsCfgPath, i, stepName);
14 string stepPath = stepsCfgPath + stepName +
" ";
15 int id =
GetGame().ConfigGetInt(stepPath +
"id");
18 GetGame().ConfigGetText(stepPath +
"soundLookupTable", tableName);
25 table.LoadTable(tableName);
26 m_pSoundTableInstances.Insert(tableName.Hash(), table);
28 m_pSoundTables.Insert(
id, table);
39 if(soundBuilder == NULL)
44 soundBuilder.AddVariable(
"walk", 1);
45 soundBuilder.AddVariable(
"run", 0);
46 soundBuilder.AddVariable(
"sprint", 0);
50 soundBuilder.AddVariable(
"walk", 0);
51 soundBuilder.AddVariable(
"run", 1);
52 soundBuilder.AddVariable(
"sprint", 0);
56 soundBuilder.AddVariable(
"walk", 0);
57 soundBuilder.AddVariable(
"run", 0);
58 soundBuilder.AddVariable(
"sprint", 1);
62 soundBuilder.AddVariable(
"walk", 0);
63 soundBuilder.AddVariable(
"run", 0);
64 soundBuilder.AddVariable(
"sprint", 0);
69 soundBuilder.AddVariable(
"bare", 1);
70 soundBuilder.AddVariable(
"sneakers", 0);
71 soundBuilder.AddVariable(
"boots", 0);
75 soundBuilder.AddVariable(
"bare", 0);
76 soundBuilder.AddVariable(
"sneakers", 1);
77 soundBuilder.AddVariable(
"boots", 0);
81 soundBuilder.AddVariable(
"bare", 0);
82 soundBuilder.AddVariable(
"sneakers", 0);
83 soundBuilder.AddVariable(
"boots", 1);
91 if(m_instance == NULL)
110 string attachCfgPath =
"CfgVehicles SurvivorBase AnimEvents Attachments ";
111 int attachCount =
GetGame().ConfigGetChildrenCount(attachCfgPath);
112 for(
int i = 0; i < attachCount; i++)
115 GetGame().ConfigGetChildName(attachCfgPath, i, defName);
116 string defPath = attachCfgPath + defName +
" ";
121 int id =
GetGame().ConfigGetInt(defPath +
"id");
124 GetGame().ConfigGetText(defPath +
"soundLookupTable", tableName);
126 AttachmentSoundLookupTable table = m_pSoundTableInstances.Get(tableName.Hash());
129 table =
new AttachmentSoundLookupTable();
130 table.LoadTable(tableName);
131 m_pSoundTableInstances.Insert(tableName.Hash(), table);
134 m_pSoundTables.Insert((
slotName +
id).Hash(), table);
145 if(soundBuilder == NULL)
153 if(m_instance == NULL)
167class DayZPlayerTypeVoiceSoundLookupTableImpl
extends DayZPlayerTypeVoiceSoundLookupTable
169 void DayZPlayerTypeVoiceSoundLookupTableImpl()
177 string cfgPath =
"CfgVehicles SurvivorBase AnimEvents SoundVoice ";
178 int childCount =
GetGame().ConfigGetChildrenCount(cfgPath);
180 for(
int i = 0; i < childCount; i++)
183 GetGame().ConfigGetChildName(cfgPath, i, defName);
184 string defPath = cfgPath + defName +
" ";
186 int id =
GetGame().ConfigGetInt(defPath +
"id");
189 GetGame().ConfigGetText(defPath +
"soundLookupTable", tableName);
195 table.LoadTable(tableName);
196 m_pSoundTableInstances.Insert(tableName.Hash(), table);
199 if(
GetGame().ConfigGetText(defPath +
"noise", noiseName))
203 table.SetNoiseParam(np);
207 m_pSoundTables.Insert(
id, table);
218 if(soundBuilder == NULL)
230 return table.GetNoiseParam();
233 static DayZPlayerTypeVoiceSoundLookupTableImpl GetInstance()
235 if(m_instance == NULL)
236 m_instance =
new DayZPlayerTypeVoiceSoundLookupTableImpl();
241 private static ref DayZPlayerTypeVoiceSoundLookupTableImpl m_instance;
248class DayZPlayerTypeSoundTableImpl
extends DayZPlayerTypeAnimTable
250 private static ref DayZPlayerTypeSoundTableImpl m_instance;
253 void DayZPlayerTypeSoundTableImpl()
257 string soundsCfgPath =
"CfgVehicles SurvivorBase AnimEvents Sounds ";
259 int soundCount =
GetGame().ConfigGetChildrenCount(soundsCfgPath);
260 for(
int i = 0; i < soundCount; i++)
263 GetGame().ConfigGetChildName(soundsCfgPath, i, soundName);
264 string soundPath = soundsCfgPath + soundName +
" ";
265 AnimSoundEvent soundEvent =
new AnimSoundEvent(soundPath);
266 if(soundEvent.IsValid())
267 m_AnimSoundEvents.Set(soundEvent.m_iID, soundEvent);
273 return m_AnimSoundEvents.Get(event_id);
276 static DayZPlayerTypeSoundTableImpl GetInstance()
278 if(m_instance == null)
279 m_instance =
new DayZPlayerTypeSoundTableImpl();
319void DayZPlayerTypeRegisterSounds(DayZPlayerType pType)
321 GetGame().ProfilerStart(
"DayZPlayerTypeRegisterSounds");
323 pType.RegisterStepEvent(
"Step", 0.2);
325 pType.RegisterSoundEvent(
"Sound", -1);
326 pType.RegisterSoundEvent(
"SoundWeapon", 0.2);
327 pType.RegisterSoundEvent(
"SoundVoice", -1);
328 if(!
GetGame().IsDedicatedServer())
329 pType.RegisterSoundEvent(
"SoundAttachment", 0.2);
332 DayZPlayerTypeVoiceSoundLookupTableImpl voiceTable2 = DayZPlayerTypeVoiceSoundLookupTableImpl.GetInstance();
333 pType.RegisterVoiceSoundLookupTable(voiceTable2);
335 if(!
GetGame().IsDedicatedServer())
337 pType.RegisterParticleEvent(
"Particle", -1);
340 pType.RegisterStepSoundLookupTable(stepTable);
343 pType.RegisterAttachmentSoundLookupTable(attachTable);
347 DayZPlayerTypeSoundTableImpl soundTable = DayZPlayerTypeSoundTableImpl.GetInstance();
348 pType.RegisterSoundTable(soundTable);
353 GetGame().ProfilerStop(
"DayZPlayerTypeRegisterSounds");