View Full Version : Question: How to add music to new eras of the techtree


Sword_Of_Geddon
Jul 20, 2007, 09:15 AM
Lets say you want music for a future era. How do you add it in so it plays?

Sword_Of_Geddon
Jul 20, 2007, 03:41 PM
Honestly nobody knows how to do this?

Sword_Of_Geddon
Jul 21, 2007, 01:03 PM
:( I am shocked that nobody knows anything about the musical aspect of the game.

snipperrabbit!!
Jul 21, 2007, 01:48 PM
I know a little. I believe there is a folder for each era where you drop the mp3 files. I can't recall the path atm. It will need some XML editing obviously.

snarko
Jul 21, 2007, 02:01 PM
Sounds like you've already added the era in CIV4EraInfos.xml. Here's an example from vanilla, this is for classical era:
<EraInfoSoundtracks>
<EraInfoSoundtrack>AS2D_ANCIENT_SOUNDTRACK_1</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_ANCIENT_SOUNDTRACK_2</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_ANCIENT_SOUNDTRACK_3</EraInfoSoundtrack>
<EraInfoSoundtrack>AS2D_ANCIENT_SOUNDTRACK_4</EraInfoSoundtrack>
</EraInfoSoundtracks>

AS2D_ANCIENT_SOUNDTRACK_1 etc are defined in Audio2DScripts.xml (audio directory). Here's what the first ancient soundtrack looks like
<Script2DSound>
<ScriptID>AS2D_ANCIENT_SOUNDTRACK_1</ScriptID>
<SoundID>SONG_ANCIENT_SOUNDTRACK_1</SoundID>
<SoundType>GAME_MUSIC</SoundType>
<iMinVolume>70</iMinVolume>
<iMaxVolume>70</iMaxVolume>
<iPitchChangeDown>0</iPitchChangeDown>
<iPitchChangeUp>0</iPitchChangeUp>
<iMinLeftPan>-1</iMinLeftPan>
<iMaxLeftPan>-1</iMaxLeftPan>
<iMinRightPan>-1</iMinRightPan>
<iMaxRightPan>-1</iMaxRightPan>
<bLooping>0</bLooping>
<iMinTimeDelay>0</iMinTimeDelay>
<iMaxTimeDelay>0</iMaxTimeDelay>
<bTaperForSoundtracks>0</bTaperForSoundtracks>
<iLengthOfSound>0</iLengthOfSound>
<fMinDryLevel>1.0</fMinDryLevel>
<fMaxDryLevel>1.0</fMaxDryLevel>
<fMinWetLevel>0.0</fMinWetLevel>
<fMaxWetLevel>0.0</fMaxWetLevel>
</Script2DSound>
Only thing I'm going to explain (because it's the only thing I understand :p) is the <SoundID> tag. This tag reference to AudioDefines.xml, which is where you actually tell it what file it should look at. Like this
<SoundData>
<SoundID>SONG_ANCIENT_SOUNDTRACK_1</SoundID>
<Filename>Sounds/Soundtrack/Classical/AncientSoundtrack1</Filename>
<LoadType>STREAMED</LoadType>
<bIsCompressed>1</bIsCompressed>
<bInGeneric>1</bInGeneric>
</SoundData>

...and then of course you'll need the sound file where you say it'll be. mp3 and wav should work.

Note: I've never actually done this so I don't know for sure if this will work or not. But what else would these things be used for?

Sword_Of_Geddon
Jul 21, 2007, 02:15 PM
Thanks for your help the future era owns you its thanks