Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл DayZPlayerCfgSounds.c

См. исходные тексты.

Структуры данных

class  DayZPlayerTypeStepSoundLookupTable
 
class  DayZPlayerTypeVoiceSoundLookupTable
 

Функции

class DayZPlayerTypeStepSoundLookupTableImpl extends DayZPlayerTypeStepSoundLookupTable DayZPlayerTypeAttachmentSoundLookupTableImpl ()
 
void DayZPlayerTypeStepSoundLookupTableImpl ()
 
override SoundObjectBuilder GetSoundBuilder (int eventId, int pMovement, int pSurfaceHash, AnimBootsType pBoots)
 
static DayZPlayerTypeStepSoundLookupTableImpl GetInstance ()
 
override SoundObjectBuilder GetSoundBuilder (int eventId, string slotName, int attachmentHash)
 
class DayZPlayerTypeVoiceSoundLookupTableImpl extends DayZPlayerTypeVoiceSoundLookupTable DayZPlayerTypeSoundTableImpl ()
 
void DayZPlayerTypeVoiceSoundLookupTableImpl ()
 
override SoundObjectBuilder GetSoundBuilder (int eventId, int parameterHash)
 
override NoiseParams GetNoiseParams (int eventId)
 
override AnimSoundEvent GetSoundEvent (int event_id)
 
void DayZPlayerTypeRegisterSounds (DayZPlayerType pType)
 

Переменные

static ref DayZPlayerTypeStepSoundLookupTableImpl m_instance
 
autoptr map< int, ref StepSoundLookupTablem_pSoundTableInstances
 
autoptr map< int, StepSoundLookupTablem_pSoundTables
 
ref array< ref AnimSoundEventm_animSoundEvents
 

Функции

◆ DayZPlayerTypeAttachmentSoundLookupTableImpl()

106 {
109
110 string attachCfgPath = "CfgVehicles SurvivorBase AnimEvents Attachments ";
111 int attachCount = GetGame().ConfigGetChildrenCount(attachCfgPath);
112 for(int i = 0; i < attachCount; i++)
113 {
114 string defName;
115 GetGame().ConfigGetChildName(attachCfgPath, i, defName);
116 string defPath = attachCfgPath + defName + " ";
117
118 string slotName;
119 GetGame().ConfigGetText(defPath + "slot", slotName);
120
121 int id = GetGame().ConfigGetInt(defPath + "id");
122
123 string tableName;
124 GetGame().ConfigGetText(defPath + "soundLookupTable", tableName);
125
126 AttachmentSoundLookupTable table = m_pSoundTableInstances.Get(tableName.Hash());
127 if(table == NULL)
128 {
129 table = new AttachmentSoundLookupTable();
130 table.LoadTable(tableName);
131 m_pSoundTableInstances.Insert(tableName.Hash(), table);
132 }
133
134 m_pSoundTables.Insert((slotName + id).Hash(), table);
135 }
136 }
PlayerSpawnPreset slotName
autoptr map< int, StepSoundLookupTable > m_pSoundTables
Definition DayZPlayerCfgSounds.c:202
autoptr map< int, ref StepSoundLookupTable > m_pSoundTableInstances
Definition DayZPlayerCfgSounds.c:201
Definition EntityAI.c:95
proto native CGame GetGame()

Используется в DayZPlayerTypeRegisterSounds().

◆ DayZPlayerTypeRegisterSounds()

void DayZPlayerTypeRegisterSounds ( DayZPlayerType pType)
private

register events

load and register step sound lookup table

326{
327 GetGame().ProfilerStart("DayZPlayerTypeRegisterSounds");
329 pType.RegisterStepEvent("Step", 0.2);
330
331 pType.RegisterSoundEvent("Sound", -1);
332 pType.RegisterSoundEvent("SoundWeapon", 0.2);
333 pType.RegisterSoundEvent("SoundVoice", -1);
334 if(!GetGame().IsDedicatedServer())//attachments don't generate noise, so we can ignore them on server
335 pType.RegisterSoundEvent("SoundAttachment", 0.2);
336
337
339 pType.RegisterVoiceSoundLookupTable(voiceTable2);
340
341 if(!GetGame().IsDedicatedServer())//sounds are unnecessary on server
342 {
343 pType.RegisterParticleEvent("Particle", -1);
346 pType.RegisterStepSoundLookupTable(stepTable);
347
349 pType.RegisterAttachmentSoundLookupTable(attachTable);
350
351
352
354 pType.RegisterSoundTable(soundTable);
355
356 //DayZPlayerTypeSoundVoiceTableImpl voiceTable = new DayZPlayerTypeSoundVoiceTableImpl();
357 //pType.RegisterSoundVoiceTable(voiceTable);
358 }
359 GetGame().ProfilerStop("DayZPlayerTypeRegisterSounds");
360}
class DayZPlayerTypeStepSoundLookupTableImpl extends DayZPlayerTypeStepSoundLookupTable DayZPlayerTypeAttachmentSoundLookupTableImpl()
Definition DayZPlayerCfgSounds.c:105
class DayZPlayerTypeVoiceSoundLookupTableImpl extends DayZPlayerTypeVoiceSoundLookupTable DayZPlayerTypeSoundTableImpl()
Definition DayZPlayerCfgSounds.c:250
void DayZPlayerTypeVoiceSoundLookupTableImpl()
Definition DayZPlayerCfgSounds.c:251
void DayZPlayerTypeStepSoundLookupTableImpl()
Definition DayZPlayerCfgSounds.c:106

Перекрестные ссылки DayZPlayerTypeAttachmentSoundLookupTableImpl(), DayZPlayerTypeSoundTableImpl(), DayZPlayerTypeStepSoundLookupTableImpl(), DayZPlayerTypeVoiceSoundLookupTableImpl() и GetGame().

Используется в DayZPlayerTypeUtils::DayZPlayerTypeCreate().

◆ DayZPlayerTypeSoundTableImpl()

251 {
253
254 string soundsCfgPath = "CfgVehicles SurvivorBase AnimEvents Sounds ";
255
256 int soundCount = GetGame().ConfigGetChildrenCount(soundsCfgPath);
257 for(int i = 0; i < soundCount; i++)
258 {
259 string soundName;
260 GetGame().ConfigGetChildName(soundsCfgPath, i, soundName);
261 string soundPath = soundsCfgPath + soundName + " ";
263 if(soundEvent.IsValid())
265 }
266 }
ref array< ref AnimSoundEvent > m_animSoundEvents
Definition DayZPlayerCfgSounds.c:291

Используется в DayZPlayerTypeRegisterSounds().

◆ DayZPlayerTypeStepSoundLookupTableImpl()

void DayZPlayerTypeStepSoundLookupTableImpl ( )
106 {
109
110 string attachCfgPath = "CfgVehicles SurvivorBase AnimEvents Attachments ";
111 int attachCount = GetGame().ConfigGetChildrenCount(attachCfgPath);
112 for(int i = 0; i < attachCount; i++)
113 {
114 string defName;
115 GetGame().ConfigGetChildName(attachCfgPath, i, defName);
116 string defPath = attachCfgPath + defName + " ";
117
118 string slotName;
119 GetGame().ConfigGetText(defPath + "slot", slotName);
120
121 int id = GetGame().ConfigGetInt(defPath + "id");
122
123 string tableName;
124 GetGame().ConfigGetText(defPath + "soundLookupTable", tableName);
125
126 AttachmentSoundLookupTable table = m_pSoundTableInstances.Get(tableName.Hash());
127 if(table == NULL)
128 {
129 table = new AttachmentSoundLookupTable();
130 table.LoadTable(tableName);
131 m_pSoundTableInstances.Insert(tableName.Hash(), table);
132 }
133

Перекрестные ссылки GetGame(), m_pSoundTableInstances, m_pSoundTables и slotName.

Используется в DayZPlayerTypeRegisterSounds().

◆ DayZPlayerTypeVoiceSoundLookupTableImpl()

void DayZPlayerTypeVoiceSoundLookupTableImpl ( )
251 {
253
254 string soundsCfgPath = "CfgVehicles SurvivorBase AnimEvents Sounds ";
255
256 int soundCount = GetGame().ConfigGetChildrenCount(soundsCfgPath);
257 for(int i = 0; i < soundCount; i++)
258 {
259 string soundName;
260 GetGame().ConfigGetChildName(soundsCfgPath, i, soundName);
261 string soundPath = soundsCfgPath + soundName + " ";
263 if(soundEvent.IsValid())
265 }
266 }
267
269 {
270 for(int i = 0; i < m_animSoundEvents.Count(); i++)
271 {
273 if(soundEvent.m_iID == event_id)
274 {
275 return soundEvent;
276 }
277 }
278
279 return NULL;
280 }
281
283 {
284 if(m_instance == NULL)
286
287 return m_instance;
288 }
289
override AnimSoundEvent GetSoundEvent(int event_id)
Definition DayZPlayerCfgSounds.c:268
static DayZPlayerTypeStepSoundLookupTableImpl GetInstance()
Definition DayZPlayerCfgSounds.c:192
static ref DayZPlayerTypeStepSoundLookupTableImpl m_instance
Definition DayZPlayerCfgSounds.c:200

Перекрестные ссылки GetGame() и m_animSoundEvents.

Используется в DayZPlayerTypeRegisterSounds().

◆ GetInstance()

static DayZPlayerTypeSoundTableImpl GetInstance ( )
static
193 {
195 table.LoadTable(tableName);
196 m_pSoundTableInstances.Insert(tableName.Hash(), table);
197
198 string noiseName;
void PlayerVoiceLookupTable()
Definition DayZAnimEventMaps.c:99

Перекрестные ссылки GetGame(), m_pSoundTableInstances и PlayerVoiceLookupTable().

◆ GetNoiseParams()

override NoiseParams GetNoiseParams ( int eventId)

◆ GetSoundBuilder() [1/3]

override SoundObjectBuilder GetSoundBuilder ( int eventId,
int parameterHash )

◆ GetSoundBuilder() [2/3]

override SoundObjectBuilder GetSoundBuilder ( int eventId,
int pMovement,
int pSurfaceHash,
AnimBootsType pBoots )
139 {
141 if(table == NULL)
142 return NULL;
143
145 if(soundBuilder == NULL)
146 return NULL;
147
148 return soundBuilder;
149 }
150
152 {
153 if(m_instance == NULL)
155
156 return m_instance;
157 }
158
162}
163
164
165
166
168{
170 {
171 // this produces 2 maps:
172 // 1) map where the key is 'ID' of anim event and the value is sound lookup table
173 // 2) map of unique lookup table instances where the table name hash is a key, and a lookup table is the value
176
177 string cfgPath = "CfgVehicles SurvivorBase AnimEvents SoundVoice ";
178 int childCount = GetGame().ConfigGetChildrenCount(cfgPath);
179 //Print("childCount:" + childCount);
180 for(int i = 0; i < childCount; i++)
181 {
182 string defName;
183 GetGame().ConfigGetChildName(cfgPath, i, defName);
184 string defPath = cfgPath + defName + " ";
185
186 int id = GetGame().ConfigGetInt(defPath + "id");
187
188 string tableName;
189 GetGame().ConfigGetText(defPath + "soundLookupTable", tableName);
190
Definition DayZPlayerCfgSounds.c:168
void DayZPlayerTypeVoiceSoundLookupTableImpl()
Definition DayZPlayerCfgSounds.c:169
Definition DayZAnimEventMaps.c:3
Definition Sound.c:46

◆ GetSoundBuilder() [3/3]

override SoundObjectBuilder GetSoundBuilder ( int eventId,
string slotName,
int attachmentHash )
139 {
141 if(table == NULL)
142 return NULL;
143
145 if(soundBuilder == NULL)
146 return NULL;
147
148 return soundBuilder;
149 }

Перекрестные ссылки m_pSoundTables и slotName.

◆ GetSoundEvent()

override AnimSoundEvent GetSoundEvent ( int event_id)
private
269 {
270 for(int i = 0; i < m_animSoundEvents.Count(); i++)
271 {
273 if(soundEvent.m_iID == event_id)
274 {
275 return soundEvent;
276 }
277 }
278
279 return NULL;
280 }

Перекрестные ссылки m_animSoundEvents.

Переменные

◆ m_animSoundEvents

ref array<ref AnimSoundEvent> m_animSoundEvents
private

◆ m_instance

static ref DayZPlayerTypeSoundTableImpl m_instance
staticprivate

◆ m_pSoundTableInstances

◆ m_pSoundTables