9 void InitTable(
string tableCategoryName,
string parameterName)
11 m_tableCategoryName = tableCategoryName;
12 m_parameterName = parameterName;
15 void LoadTable(
string soundLookupTableName)
17 string path =
"CfgSoundTables " + m_tableCategoryName +
" " + soundLookupTableName;
20 int soundCount =
GetGame().ConfigGetChildrenCount(
path);
22 for(
int i = 0; i < soundCount; i++)
24 string soundClassName;
25 GetGame().ConfigGetChildName(
path, i, soundClassName);
26 string soundClassPath =
path +
" " + soundClassName +
" ";
29 GetGame().ConfigGetText(soundClassPath + m_parameterName, parameter);
32 GetGame().ConfigGetTextArray(soundClassPath +
"soundSets", soundSetNames);
36 for(
int j = 0; j < soundSetNames.Count(); j++)
41 if(soundObjectBuilder != NULL)
42 soundObjectBuilders.Insert(soundObjectBuilder);
45 if(soundObjectBuilders.Count() > 0)
48 m_soundBuilders.Insert(parameter.Hash(), soundObjectBuilders);
57 if(soundObjects == NULL || soundObjects.Count() == 0)
61 else if (soundObjects.Count() == 1)
63 return soundObjects.Get(0);
67 int index =
Math.RandomInt(0, soundObjects.Count());
68 return soundObjects.Get(index);
73 private string m_tableCategoryName;
74 private string m_parameterName;
83 InitTable(
"CfgStepSoundTables",
"surface");
89 void AttachmentSoundLookupTable()
91 InitTable(
"CfgAttachmentSoundTables",
"category");
101 InitTable(
"CfgVoiceSoundTables",
"category");
120 InitTable(
"CfgImpactSoundTables",
"surface");
128 InitTable(
"CfgActionsSoundTables",
"category");
143 if(m_instance == NULL)
152 int soundSetNameHash = soundSetName.Hash();
161 m_pBuilders.Insert(soundSetNameHash, builder);
165 Print(
"AnimSoundObjectBuilderBank: Invalid sound set \"" + soundSetName +
"\".");
187 if(m_instance == NULL)
196 int tableNameHash = tableName.Hash();
202 table.LoadTable(tableName);
210 int tableNameHash = tableName.Hash();
216 table.LoadTable(tableName);
224 int tableNameHash = tableName.Hash();
230 table.LoadTable(tableName);