I can't get unit sounds to work.

nokmirt

Emperor
Joined
Feb 14, 2009
Messages
5,088
Location
Iowa USA
Where in my mod should I put the XML file that contains the following? Would it be the Assets/Sound folder?

Code:
<GameData>
	<Audio_Sounds>
		<Row>
			<SoundID>SND_UNIT_WOLF_ATTACK_VOX</SoundID>
			<Filename>wolfattackvox</Filename>
			<LoadType>DynamicResident</LoadType>
		</Row>
		<Row>
			<SoundID>SND_UNIT_WOLF_DEATH_VOX</SoundID>
			<Filename>wolfdeathvox</Filename>
			<LoadType>DynamicResident</LoadType>
		</Row>
		<Row>
			<SoundID>SND_UNIT_WOLF_FORTIFY_VOX</SoundID>
			<Filename>wolffortifyvox</Filename>
			<LoadType>DynamicResident</LoadType>
		</Row>
		<Row>
			<SoundID>SND_UNIT_WOLF_HOWL</SoundID>
			<Filename>wolfhowl</Filename>
			<LoadType>DynamicResident</LoadType>
		</Row>
	</Audio_Sounds>
	<Audio_3DSounds>
		<Row>
			<ScriptID>AS3D_UNIT_WOLF_ATTACK_VOX</ScriptID>
			<SoundID>SND_UNIT_WOLF_ATTACK_VOX</SoundID>
			<SoundType>GAME_SFX</SoundType>
			<MinVolume>35</MinVolume>
			<MaxVolume>60</MaxVolume>
		</Row>
		<Row>
			<ScriptID>AS3D_UNIT_WOLF_DEATH_VOX</ScriptID>
			<SoundID>SND_UNIT_WOLF_DEATH_VOX</SoundID>
			<SoundType>GAME_SFX</SoundType>
			<MinVolume>35</MinVolume>
			<MaxVolume>60</MaxVolume>
		</Row>
		<Row>
			<ScriptID>AS3D_UNIT_WOLF_FORTIFY_VOX</ScriptID>
			<SoundID>SND_UNIT_WOLF_FORTIFY_VOX</SoundID>
			<SoundType>GAME_SFX</SoundType>
			<MinVolume>20</MinVolume>
			<MaxVolume>35</MaxVolume>
		</Row>
		<Row>
			<ScriptID>AS3D_UNIT_WOLF_HOWL</ScriptID>
			<SoundID>SND_UNIT_WOLF_HOWL</SoundID>
			<SoundType>GAME_SFX</SoundType>
			<MinVolume>35</MinVolume>
			<MaxVolume>60</MaxVolume>
		</Row>
	</Audio_3DSounds>
</GameData>

I have all the Wav files set VFS=True. I am not sure they have to be in a certain folder or not.
 
I was curious with this also and found that "New sounds cannot be added, unless your new sound file replaces an existing sound file"

and I found this also for example

Edit: Also, there is a table called "UnitGameplay2DScripts" which has columns UnitType (e.g. UNIT_ARCHER) and SelectionSound (eg. AS2D_SELECT_ARCHER). Maybe you can find out what files the AS2D points to?

Edit2: In Assets/Sounds/XML you can find a file called Audio2DScripts.xml which has info on these AS2Ds. For example:

Code:
<Script2DSound>
<ScriptID>AS2D_SELECT_ARCHER</ScriptID>
<SoundID>SND_SELECT_ARCHER</SoundID>
<SoundType>GAME_SFX</SoundType>
<iMinVolume>50</iMinVolume>
<iMaxVolume>50</iMaxVolume>
</Script2DSound>
Now it looks like it is just a matter of figuring out what SND_SELECT_ARCHER is.

Edit 3: In the same folder (Assets/Sounds/XML) there's a file called AudioDefines.xml which lists stuff like the following:

Code:
<SoundData>
<SoundID>SND_SELECT_ARCHER</SoundID>
<Filename>SelectArcher</Filename>
<bDontCache/>
<bOnlyLoadOneVariationEachTime/>
<LoadType>DYNAMIC_RES</LoadType>
</SoundData>

So it looks like the file name is SelectArcher.something, though I'm not sure if it's an .mp3 or a .wav or whatever.

Edit 4: If you extract the .fpk files, then in Resource/Common you can find a file called "selectarcher.wav". I am almost 100% sure this is the one. Anyway, if you want to make it so that when you click on an archer it makes some crazy noise, then take that noise file, add it to your modbuddy project, and set VFS = true. That should work.
 
I was curious with this also and found that "New sounds cannot be added, unless your new sound file replaces an existing sound file"
It should be possible to add new sounds provided you update the appropriate tags in your fx_triggers_<your_custom_unit>.ftsxml file. It works for weapon sound effects so in theory it should also work for the rest.

I am not sure they have to be in a certain folder or not.
No it does not seem to matter when using VFS to import the file. Also make sure you have reload audio system ticked and the extras that onmy6 said.
 
It should be possible to add new sounds provided you update the appropriate tags in your fx_triggers_<your_custom_unit>.ftsxml file. It works for weapon sound effects so in theory it should also work for the rest.


No it does not seem to matter when using VFS to import the file. Also make sure you have reload audio system ticked and the extras that onmy6 said.

I got it to work. Thanks guys!
 
Back
Top Bottom