How do I set the music for a civilization?

Nagol Strache

Chieftain
Joined
Jan 14, 2016
Messages
18
I have been looking around different files, but I can't seem to find anything in the base game's files that say which music (peace, war, ambient) goes to which civ. I would like to add custom music for the civ I'm working on, but for now I'm fine with using Denmark's. This is the same civ as the one in my previous post.
 
There's Kael's Modders Guide for new modders in this forum. It is a bit outdated, but many core functions may still work as normal. You might want to take a look at it.

Regarding your question, the vanilla civilizations belong to a specific group which are sorted by Continents. If you simply want to assign your civ to such a group, you should set the value of <SoundtrackTag> to a civ whose music you want to use. If you're using custom ambient music, you must assign them in Folders (Peace, Either or War) and set the data scripts in either XML or SQL.

If you're looking for the Civ V XML Sound files, they can be located here: C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization V\assets\Sounds\XML

In case you'll need to know how the Audio Script is coded:

XML for Leader Music, (for ambient music, remove the LEADER_MUSIC and put _(Number, without Brackets, for music that should play in both peace and war times, replace PEACE with EITHER)
Code:
	<Audio_Sounds>
		<Row>
			<SoundID>SND_LEADER_MUSIC_YOURCIV_PEACE</SoundID>
			<Filename>YourCivLeaderPeace</Filename>
			<LoadType>Streamed or DynamicResident</LoadType>
		</Row>
		<Row>
			<SoundID>SND_LEADER_MUSIC_YOURCIV_WAR</SoundID>
			<Filename>YourCivLeaderWar</Filename>
			<LoadType>Streamed or DynamicResident</LoadType>
		</Row>
	</Audio_Sounds>
	<Audio_2DSounds>
		<Row>
			<ScriptID>AS2D_LEADER_MUSIC_YOURCIV_PEACE</ScriptID>
			<SoundID>SND_LEADER_MUSIC_YOURCIV_PEACE</SoundID>
			<SoundType>GAME_MUSIC</SoundType>
			<MaxVolume>60</MaxVolume>
			<MinVolume>60</MinVolume>
			<IsMusic>True</IsMusic>
		</Row>
		<Row>
			<ScriptID>AS2D_LEADER_MUSIC_YOURCIV_WAR</ScriptID>
			<SoundID>SND_LEADER_MUSIC_YOURCIV_WAR</SoundID>
			<SoundType>GAME_MUSIC</SoundType>
			<MaxVolume>60</MaxVolume>
			<MinVolume>60</MinVolume>
			<IsMusic>True</IsMusic>
		</Row>
	</Audio_2DSounds>

SQL is different, but follows the same rules, so just make sure you don't forget the air quotes while typing info in the SQL rule (but there's no True value, so you must set the value on "1":
Code:
INSERT INTO Audio_Sounds
			(SoundID,				Filename,		LoadType)
VALUES			('SND_LEADER_MUSIC_YOURCIV_PEACE',	'YourCivLeaderPeace',	'Streamed or DynamicResident'),
			('SND_LEADER_MUSIC_YOURCIV_WAR',	'YourCivLeaderWar',	'Streamed or DynamicResident');

INSERT INTO Audio_2DSOUNDS
			(ScriptID,					SoundID,
			SoundType,		MaxVolume,		MinVolume,		IsMusic)
VALUES			('AS2D_LEADER_MUSIC_YOURCIV_PEACE',		'SND_LEADER_MUSIC_YOURCIV_PEACE',
			'GAME_MUSIC',		60,			60,			1),
			('AS2D_LEADER_MUSIC_YOURCIV_WAR',		'SND_LEADER_MUSIC_YOURCIV_WAR',
			'GAME_MUSIC',		60,			60,			1);

EDIT: Oh well, AgressiveWimp was faster, and I forgot to refer to set the Event on "OnModActivated", the Action to "UpdateDatabase" and the File to your XML file.
 
I followed the XML route to adding music and after following Leugi's tutorial I still seem to be having trouble.

HTML:
<GameData>
	<!--Khazgrim Music-->
	<Audio_Sounds>
		<Row>
			<SoundID>SND_LEADER_MUSIC_KHAZGRIM_PEACE</SoundID>
			<Filename>Dwarf Battle Music - Dwarven Mine</Filename>
			<LoadType>DynamicResident</LoadType>
		</Row>
		<Row>
			<SoundID>SND_LEADER_MUSIC_KHAZGRIM_WAR</SoundID>
			<Filename>Epic Dwarf Music - Dwarven Axes</Filename>
			<LoadType>DynamicResident</LoadType>
		</Row>
	</Audio_Sounds>
	<!--Khazgrim Music For Audio Scripts-->
	<Audio_2DSounds>
		<Row>
			<ScriptID>AS2D_LEADER_MUSIC_KHAZGRIM_PEACE</ScriptID>
			<SoundID>SND_LEADER_MUSIC_KHAZGRIM_PEACE</SoundID>
			<SoundType>GAME_MUSIC</SoundType>
			<MinVolume>120</MinVolume>
			<MaxVolume>120</MaxVolume>
			<IsMusic>true</IsMusic>
		</Row>
		<Row>
			<ScriptID>AS2D_LEADER_MUSIC_KHAZGRIM_WAR</ScriptID>
			<SoundID>SND_LEADER_MUSIC_KHAZGRIM_WAR</SoundID>
			<MinVolume>80</MinVolume>
			<MaxVolume>80</MaxVolume>
			<IsMusic>true</IsMusic>
		</Row>
	</Audio_2DSounds>
</GameData>

The database log doesn't have any problems, so am I missing a step somewhere?

Another thing I forgot to ask is how do you set the music set, like European, Asian, Native American for example.
 
I followed the XML route to adding music and after following Leugi's tutorial I still seem to be having trouble.

HTML:
<GameData>
	<!--Khazgrim Music-->
	<Audio_Sounds>
		<Row>
			<SoundID>SND_LEADER_MUSIC_KHAZGRIM_PEACE</SoundID>
			<Filename>Dwarf Battle Music - Dwarven Mine</Filename>
			<LoadType>DynamicResident</LoadType>
		</Row>
		<Row>
			<SoundID>SND_LEADER_MUSIC_KHAZGRIM_WAR</SoundID>
			<Filename>Epic Dwarf Music - Dwarven Axes</Filename>
			<LoadType>DynamicResident</LoadType>
		</Row>
	</Audio_Sounds>
	<!--Khazgrim Music For Audio Scripts-->
	<Audio_2DSounds>
		<Row>
			<ScriptID>AS2D_LEADER_MUSIC_KHAZGRIM_PEACE</ScriptID>
			<SoundID>SND_LEADER_MUSIC_KHAZGRIM_PEACE</SoundID>
			<SoundType>GAME_MUSIC</SoundType>
			<MinVolume>120</MinVolume>
			<MaxVolume>120</MaxVolume>
			<IsMusic>true</IsMusic>
		</Row>
		<Row>
			<ScriptID>AS2D_LEADER_MUSIC_KHAZGRIM_WAR</ScriptID>
			<SoundID>SND_LEADER_MUSIC_KHAZGRIM_WAR</SoundID>
			<MinVolume>80</MinVolume>
			<MaxVolume>80</MaxVolume>
			<IsMusic>true</IsMusic>
		</Row>
	</Audio_2DSounds>
</GameData>

The database log doesn't have any problems, so am I missing a step somewhere?

Another thing I forgot to ask is how do you set the music set, like European, Asian, Native American for example.

You forgot to put the <SoundType>GAME_MUSIC</SoundType> line in the War Music Row (it's quite easy to miss that, and if one thing fails in XML, it is completely discarded until you fix the error).

For ambient music, set the <SoundtrackTag> in your Civilization XML to a Civ whose music you want to use(Example being <SoundtrackTag>Austria<SoundtrackTag> for European Music, Arabia for Middle East/African Music etc.).
 
Thanks guys! I added the <SoundType> tag to the war music and added the Sweden soundtrack to the civ, but it still didn't work. I randomly decided to change the names of the war and peace music to KhazgrimPeace and KhazgrimWar, and the music works fine now! I just need to tone down the volume on the Peace music and it should be good. :)
 
Back
Top Bottom