• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

How do custom soundtracks work?

Mouthwash

Escaped Lunatic
Joined
Sep 26, 2011
Messages
9,370
Location
Hiding
Do the soundtracks play in order or randomly? I'm having problems creating my own. Do the tracks play all the time or are there periods with only ambience?
 
Controlled by CIV4EraInfos.xml tags :
<iSoundtrackSpace>
<bFirstSoundtrackFirst>
<EraInfoSoundtracks>
<CitySoundscapes>
 
Controlled by CIV4EraInfos.xml tags :
<iSoundtrackSpace>
<bFirstSoundtrackFirst>
<EraInfoSoundtracks>
<CitySoundscapes>

What do those mean? Where exactly do I place my soundtracks to make them play the way I want? Do I have to have the same matching ones in sounds/soundtrack? I had to rename them because Windows 8 apparently forces you to have them in alphabetical order. Are they still going to work?
 
You can do this one of two ways.

1. You have the foldiers in your mod, or foldier, and have the xml that deal with audio music have references for each song

or

2. Use the "custom soundtrack" option in the options menu, click it, then browse and find the foldier where your music is located, the game will then play the songs in that foldier.
 
You can do this one of two ways.

1. You have the foldiers in your mod, or foldier, and have the xml that deal with audio music have references for each song

Is that easy to do for someone who is clueless about modding in any form?

2. Use the "custom soundtrack" option in the options menu, click it, then browse and find the foldier where your music is located, the game will then play the songs in that foldier.

Tried it. It appears to only allow me to select the ancient era soundtrack, and doesn't work anyway to boot.
 
To get you started on how to create a mod take a look at this Tutorial.
http://forums.civfanatics.com/showthread.php?t=262402
To create an in game soundtrack, you will need to create the soundtrack, this can be any length of time and should be a .mp3 file and place it in Assets\Sounds\Soundtrack\Classical (for the classical era).
Then edit these XML files.
AudioDefines.xml in Assets\XML\Audio declares the soundID and location
Code:
		<SoundData>
			<SoundID>SONG_ANCIENT_SOUNDTRACK_1</SoundID>
			<Filename>Sounds/Soundtrack/Classical/AncientSoundtrack1</Filename>
			<LoadType>STREAMED</LoadType>
			<bIsCompressed>1</bIsCompressed>
			<bInGeneric>1</bInGeneric>
		</SoundData>
in Audio2DScripts.xml
Code:
	<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>
		<iNotPlayPercent>0</iNotPlayPercent>
	</Script2DSound>
and finally, in CIV4EraInfos.xml
Code:
			<iSoundtrackSpace>0</iSoundtrackSpace>
			<bFirstSoundtrackFirst>0</bFirstSoundtrackFirst>
			<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>
 
If you are trying to mess with this in C2C, don't. It has some Python that does things for sound. If you just want to add tracks for an era all you need to do is put them in the Sounds/Soundtrack/EraNew folder where "EraNew" is the one for the era the music file goes with like AncientNew or ClassicalNew. When you start the game up it should automatically edit the XML for you and move the mp3 file into the non-New folder. This is done by the MusicUpdate.py file in the Python/AIAndy folder, if you were wondering.
 
If you are trying to mess with this in C2C, don't. It has some Python that does things for sound. If you just want to add tracks for an era all you need to do is put them in the Sounds/Soundtrack/EraNew folder where "EraNew" is the one for the era the music file goes with like AncientNew or ClassicalNew. When you start the game up it should automatically edit the XML for you and move the mp3 file into the non-New folder. This is done by the MusicUpdate.py file in the Python/AIAndy folder, if you were wondering.

I knew I was forgetting something. I'll just get the SVN because it's too much to fix manually.
 
Back
Top Bottom