So, this tutorial assumes you know how to add a new civilization with a new leader to the game and thus know how to use Modbuddy properly.
Now that the Fall Patch is here, we can finally add music to a mod!. The process is quite simple, as it only requires some xml'ing.
Tools you'll need
Step 1: Import the Music with VFS=True
So, first thing to do is import the new music you want to your mod through Modbuddy. Place both files (you'll need a Peace music and a War music) wherever you feel more comfortable. Don't forget to set VFS=True in their properties.
MP3 or OGG should work... However, for some strange reason, my OGGs never work, so I use MP3.
Step 2: AudioDefine!
You'll need to add a new SoundID for your new music. The new database tables made for the Fall Patch DO NOT FOLLOW THOSE OF THE INSTALLATION FOLDERS. They have a different (and nice) structure:
This is an example code from my Mapuche mod, we're adding leader music to Lautaro, the Mapuche leader.
In the code we're doing 2 things. First, we define what files to use. Then we're also defining where to use them (and also using a sound existant in the core game files for the ambience)
Audio_Sound!
First, we define which Audio sound File to use (bold blue part). The loadtype is important, as we're telling the Mod that the new sound will be loaded not at launch of the game, but at launch of the mod.
As you may see, the way it references the file "LautaroWar" is without its extension or path.
Check the SoundID (bold green part) There's not (yet) any specificality of the name, so name it what you want. I usually use that name structure as is the one Civ 5 uses and so its easier to remember.
Audio_2DSounds
Then we have the Audio_2DSounds (note, if you're making an ambience sound like a sound for a unit you'll have to use Audio_3DSounds instead).
Now, the most important step here is the Bolded part. The way Firaxis links a ScriptID with a leader is by hard checking the Leader Type and comparing it with the ScriptID.
So... If we have <Type>LEADER_LAUTARO</Type> on our Leaders database, our ScriptIDs have to be <ScriptID>AS2D_LEADER_MUSIC_LAUTARO_PEACE</ScriptID> and so forth for War and Ambience sounds. That's what makes all of this work
Important Tags of the Audio Scripts.
So, I'll not cover all of the tags here, but I'll cover the most important and basic ones:
Step 3: UpdateDatabase
Just like when doing civs, leaders and units, you must set your new XML to Update the Database with ModBuddy.
To do this, go to your Mod properties, and in the "Actions" tab you'll see an "Add" button. Click it and set the Event to "OnModActivated", the action to "UpdateDatabase", and the File to your xml file.
Step 4: Test
Test, and Enjoy! (or, if it didn't work, repair, test and Enjoy!)
And there; now you only have to suffer because your mod's filesize is far too big for our happy site, but you got custom leader music!
Important questions
Is there a way of doing this through SQL
I think there is, its as simple as using sql everywhere, however I have not tested this yet, so yeah.
Well, that's it, hope you enjoy this!
Now that the Fall Patch is here, we can finally add music to a mod!. The process is quite simple, as it only requires some xml'ing.
Tools you'll need
- Modbuddy
- Music for your new Leader
Step 1: Import the Music with VFS=True
So, first thing to do is import the new music you want to your mod through Modbuddy. Place both files (you'll need a Peace music and a War music) wherever you feel more comfortable. Don't forget to set VFS=True in their properties.
MP3 or OGG should work... However, for some strange reason, my OGGs never work, so I use MP3.
Step 2: AudioDefine!
You'll need to add a new SoundID for your new music. The new database tables made for the Fall Patch DO NOT FOLLOW THOSE OF THE INSTALLATION FOLDERS. They have a different (and nice) structure:
Code:
<GameData>
<Audio_Sounds>
<!--Lautaro Music-->
<Row>
[B][COLOR="Green"]<SoundID>SND_LEADER_MUSIC_LAUTARO_PEACE</SoundID>[/COLOR][/B]
[B][COLOR="Blue"]<Filename>LautaroPeace</Filename>[/COLOR][/B]
<LoadType>DynamicResident</LoadType>
</Row>
<Row>
[B][COLOR="Green"]<SoundID>SND_LEADER_MUSIC_LAUTARO_WAR</SoundID>[/COLOR][/B]
[B][COLOR="Blue"]<Filename>LautaroWar</Filename>[/COLOR][/B]
<LoadType>DynamicResident</LoadType>
</Row>
<!--Lautaro Music-->
</Audio_Sounds>
<Audio_2DSounds>
<!--Lautaro Music For Audio Scripts-->
<Row>
<ScriptID>AS2D_[B]LEADER_[/B]MUSIC_[B]LAUTARO_[/B]PEACE</ScriptID>
[B][COLOR="Green"]<SoundID>SND_LEADER_MUSIC_LAUTARO_PEACE</SoundID>[/COLOR][/B]
<SoundType>GAME_MUSIC</SoundType>
<MinVolume>120</MinVolume>
<MaxVolume>120</MaxVolume>
<IsMusic>true</IsMusic>
</Row>
<Row>
<ScriptID>AS2D_[B]LEADER_[/B]MUSIC_[B]LAUTARO[/B]_WAR</ScriptID>
[B][COLOR="Green"]<SoundID>SND_LEADER_MUSIC_LAUTARO_WAR</SoundID>[/COLOR][/B]
<SoundType>GAME_MUSIC</SoundType>
<MinVolume>80</MinVolume>
<MaxVolume>80</MaxVolume>
<IsMusic>true</IsMusic>
</Row>
<Row>
<ScriptID>AS2D_AMBIENCE_[B]LEADER_LAUTARO[/B]_AMBIENCE</ScriptID>
[COLOR="Green"]<SoundID>SND_AMBIENCE_COAST_BED</SoundID>[/COLOR]
<SoundType>GAME_SFX</SoundType>
<Looping>true</Looping>
<MinVolume>60</MinVolume>
<MaxVolume>60</MaxVolume>
</Row>
<!--Lautaro Music-->
</Audio_2DSounds>
</GameData>
This is an example code from my Mapuche mod, we're adding leader music to Lautaro, the Mapuche leader.
In the code we're doing 2 things. First, we define what files to use. Then we're also defining where to use them (and also using a sound existant in the core game files for the ambience)
Audio_Sound!
First, we define which Audio sound File to use (bold blue part). The loadtype is important, as we're telling the Mod that the new sound will be loaded not at launch of the game, but at launch of the mod.
As you may see, the way it references the file "LautaroWar" is without its extension or path.
Check the SoundID (bold green part) There's not (yet) any specificality of the name, so name it what you want. I usually use that name structure as is the one Civ 5 uses and so its easier to remember.
Audio_2DSounds
Then we have the Audio_2DSounds (note, if you're making an ambience sound like a sound for a unit you'll have to use Audio_3DSounds instead).
Now, the most important step here is the Bolded part. The way Firaxis links a ScriptID with a leader is by hard checking the Leader Type and comparing it with the ScriptID.
So... If we have <Type>LEADER_LAUTARO</Type> on our Leaders database, our ScriptIDs have to be <ScriptID>AS2D_LEADER_MUSIC_LAUTARO_PEACE</ScriptID> and so forth for War and Ambience sounds. That's what makes all of this work
Important Tags of the Audio Scripts.
So, I'll not cover all of the tags here, but I'll cover the most important and basic ones:
- ScriptID: Defines the name of the Audio Script. As said before, this is hardcoded for both leaders and civ soundtracks, so be careful with the name.
- SoundID: Links the Script with an Audio define. Simply use the same SoundID. For using SoundIDs that already exist ingame, check "Assets/Sounds/XML/" or "Assets/DLC/Expansion2/Sounds/XML" files, so you can find the SoundIDs you need. (like with my ambience sound)
- SoundType: This one is not always used, but I use it just in case. Check the core files for more sound types (as far as I know, if you're doing a Great Work sound it doesn't need any Soundtype)
- MinVolume and MaxVolume: These ones are useful since our music will not necessarily be in the right volume. The default volume is 100, so if in your first test the volume is right, then you don't even need to add these ones. (lower than 100, means lower volume, higher than 100, means louder)
- IsMusic: This one's necessary so the game recognizes your file as part of the sound track, and so it will taper it down when, for example, you meet a city-state.
- TaperSoundtrackVolume: We're not using this one here, but if you are making Great Works this one is necessary. Its the volume of the music when this sound is playing, so you'll usually not use it or set it to 0.0 so the music cuts while playing the Great Work sound.
Step 3: UpdateDatabase
Just like when doing civs, leaders and units, you must set your new XML to Update the Database with ModBuddy.
To do this, go to your Mod properties, and in the "Actions" tab you'll see an "Add" button. Click it and set the Event to "OnModActivated", the action to "UpdateDatabase", and the File to your xml file.
Step 4: Test
Test, and Enjoy! (or, if it didn't work, repair, test and Enjoy!)
And there; now you only have to suffer because your mod's filesize is far too big for our happy site, but you got custom leader music!
Important questions
Is there a way of doing this through SQL
I think there is, its as simple as using sql everywhere, however I have not tested this yet, so yeah.
Well, that's it, hope you enjoy this!