Stupid problem about unit sounds...

cool3a2

Deity
Joined
Mar 30, 2007
Messages
2,177
I wanted to add some mp3s as unique unit sounds for a new civ (for BtS). I actually know how this works, because I already done this for my Magyar mod and it works fine. Now I copied the file structure to my new mod plus all necessary files: Audio3DScripts.xml and AudioDefines.xml and all the mp3s. I also changed the CIV4CivilizationInfos.xml of my mod to make it refer to the new sound xml entries. Everything looks okay and I checked it several times for typing mistakes, but when I load the mod there is no sound at all, not even in the main menue of BtS. The mod itself plays fine... No crashes at all.

This mod is a modular one and I know sounds don't work if they are realized modular as well. I already kept the sound parts nonmodular to avoid problems, but I have still problems. I think I read some time ago that there is a trick (an extra file or just an entry in a file), but I can't find that page anymore. It was some article about modular mods for BtS when BtS was brand new.

Any hints?
 
I took a look at this again and I found out that the problem has to be related with the AudioDefines.xml file. If I remove it main menues sound plays well, if I put it back everything is mute. I also made some log files and it seems to me that the audio related files haven't been loaded for some reason. I couldn't find a typing mistake. Tomorow I'll post the xml entries I have added to the files.
 
Okay, I will give you a more detailed description about what I did and at the end I will post my xml entries.

In the mods Assets folder I created a Sounds and a XML folder. In Sounds I created the Units folder where I created the Huns folder. In the Units folder I put all the mp3s, called HunsOrder-XXX.mp3 and HunsSelect-XXX.mp3 (XXX stands for a 3 digit number fromm 000 to 009). In the XML folder mentioned above I created the folder Audio. There I copied the Audio3DScripts.xml and the AudioDefines.xml. So the Structur of the mod looks like this:
- Huns_moduler
- Huns_modular/Assets
- Huns_modular/Assets/Modules
(- more folders inside Modules that aren't relevant now)
- Huns_modular/Assets/Sounds
- Huns_modular/Assets/Sounds/Units
- Huns_modular/Assets/Sounds/Units/Huns
- Huns_modular/Assets/Audio

These are the additional entries in Audio3DScripts.xml:
Spoiler :
<Script3DSound>
<ScriptID>AS3D_HUNS_SELECT</ScriptID>
<SoundID>SND_HUNS_SELECT</SoundID>
<SoundType>GAME_SPEECH</SoundType>
<iMinVolume>100</iMinVolume>
<iMaxVolume>100</iMaxVolume>
<iPitchChangeDown>0</iPitchChangeDown>
<iPitchChangeUp>0</iPitchChangeUp>
<bLooping>0</bLooping>
<iMinTimeDelay>0</iMinTimeDelay>
<iMaxTimeDelay>0</iMaxTimeDelay>
<StartPosition>NONE</StartPosition>
<EndPosition>NONE</EndPosition>
<iMinVelocity>0</iMinVelocity>
<iMaxVelocity>0</iMaxVelocity>
<iMinDistanceFromListener>0</iMinDistanceFromListener>
<iMaxDistanceFromListener>0</iMaxDistanceFromListener>
<iMinDistanceForMaxVolume>500</iMinDistanceForMaxVolume>
<iMaxDistanceForMaxVolume>1000</iMaxDistanceForMaxVolume>
<iMinCutoffDistance>7000</iMinCutoffDistance>
<iMaxCutoffDistance>7000</iMaxCutoffDistance>
<bTaperForSoundtracks>0</bTaperForSoundtracks>
<iLengthOfSound>0</iLengthOfSound>
<fMinDryLevel>1.0</fMinDryLevel>
<fMaxDryLevel>1.0</fMaxDryLevel>
<fMinWetLevel>0.5</fMinWetLevel>
<fMaxWetLevel>0.5</fMaxWetLevel>
<iNotPlayPercent>0</iNotPlayPercent>​
</Script3DSound>
<Script3DSound>
<ScriptID>AS3D_HUNS_ORDER</ScriptID>
<SoundID>SND_HUNS_ORDER</SoundID>
<SoundType>GAME_SPEECH</SoundType>
<iMinVolume>100</iMinVolume>
<iMaxVolume>100</iMaxVolume>
<iPitchChangeDown>0</iPitchChangeDown>
<iPitchChangeUp>0</iPitchChangeUp>
<bLooping>0</bLooping>
<iMinTimeDelay>0</iMinTimeDelay>
<iMaxTimeDelay>0</iMaxTimeDelay>
<StartPosition>NONE</StartPosition>
<EndPosition>NONE</EndPosition>
<iMinVelocity>0</iMinVelocity>
<iMaxVelocity>0</iMaxVelocity>
<iMinDistanceFromListener>0</iMinDistanceFromListener>
<iMaxDistanceFromListener>0</iMaxDistanceFromListener>
<iMinDistanceForMaxVolume>500</iMinDistanceForMaxVolume>
<iMaxDistanceForMaxVolume>1000</iMaxDistanceForMaxVolume>
<iMinCutoffDistance>7000</iMinCutoffDistance>
<iMaxCutoffDistance>7000</iMaxCutoffDistance>
<bTaperForSoundtracks>0</bTaperForSoundtracks>
<iLengthOfSound>0</iLengthOfSound>
<fMinDryLevel>1.0</fMinDryLevel>
<fMaxDryLevel>1.0</fMaxDryLevel>
<fMinWetLevel>0.5</fMinWetLevel>
<fMaxWetLevel>0.5</fMaxWetLevel>
<iNotPlayPercent>0</iNotPlayPercent>​
</Script3DSound>

The properties should be correct since I copied the from my Magyar mod where I use the same mp3 files and don't have any problems. All I've changed are the first two lines of each <Script3DSound>-entry.

These are the additional entries in AudioDefines.xml:
Spoiler :
<SoundData>
<SoundID>SND_HUNS_SELECT</SoundID>
<Filename>Sounds/Units/Huns/HunsSelect</Filename>
<LoadType>DYNAMIC_RES</LoadType>
<bIsCompressed>1</bIsCompressed>
<bInGeneric>1</bInGeneric>​
</SoundData>
<SoundData>
<SoundID>SND_HUNS_ORDER</SoundID>
<Filename>Sounds/Units/Huns/HunsOrder</Filename>
<LoadType>DYNAMIC_RES</LoadType>
<bIsCompressed>1</bIsCompressed>
<bInGeneric>1</bInGeneric>​
</SoundData>

Also copied from my Magyar mod. Only the first two lines of each <SoundData> entry have been changed.

Last but not least: in Huns_CIV4CivilizationInfos.xml I changed the <CivilizationSelectionSound> and <CivilizationActionSound> entries the following way:
Spoiler :
<CivilizationSelectionSound>AS3D_HUNS_SELECT</CivilizationSelectionSound>
<CivilizationActionSound>AS3D_HUNS_ORDER</CivilizationActionSound>


I really hope somebody can help me now.

EDIT: Those empty lines in my xml-listings are not in my xml files. They have been created during formating the text.
 
OK i took a look at it, and found your problem, you cant put your info you put into the Audio file first, place them after the tut, and all works ok.

I hope you dont mind but in my Huns that i made i have over fifteen units included!!
 
I see... In my magyar mod I have my sounds at the begining and all works fine. Anyway, I am sure you are right. I will try it out. Thank you for your hint. :goodjob:

I am also interested in these units. I would at least take graphics for early units, but only if they don't look too asian.

EDIT: It worked! I will update the tutorial to avoid others have the same problem. Thank you again, strategyonly!
 
I see... In my magyar mod I have my sounds at the begining and all works fine. Anyway, I am sure you are right. I will try it out. Thank you for your hint. :goodjob:

I am also interested in these units. I would at least take graphics for early units, but only if they don't look too asian.

EDIT: It worked! I will update the tutorial to avoid others have the same problem. Thank you again, strategyonly!

I just used some older mongol units and some ASIAN units, LOL
And your welcome, have a nice day.;)
 
I just sent you a pm, you can ignore it then. Nevertheless thank you for your offer.
 
Back
Top Bottom