For getting started it might be helpfull for you to read a general tutorial on how to mod the xmls, like the ones linked n the
mod utility thread.
Once you got the idea how appending works, modding the music is relatively easy.
1. Create an
audio folder, and create a
music folder within it. Thats where you place the music you want to add. If you want to replace existing music you can do that by naming your new tracks like the original files.
2. Create a
data folder in the same directory where you created your
audio folder.
3. Create a
sounds.xml.append text document within that folder. This document will tell the game how to handle the tracks you added. The game music is configured via a track list. For the CE Aditional Music Addon it looks like this:
Code: Select all
<track>
<name>deepspace</name>
<explore>bp_MUS_DeepspaceEXPLORE.ogg</explore>
<combat>bp_MUS_DeepspaceBATTLE.ogg</combat>
</track>
<track>
<name>colonial</name>
<explore>bp_MUS_ColonialEXPLORE.ogg</explore>
<combat>bp_MUS_ColonialBATTLE.ogg</combat>
</track>
<track>
<name>void</name>
<explore>bp_MUS_VoidEXPLORE.ogg</explore>
<combat>bp_MUS_VoidBATTLE.ogg</combat>
</track>
<track>
<name>zoltan</name>
<explore>bp_MUS_ZoltanEXPLORE.ogg</explore>
<combat>bp_MUS_ZoltanBATTLE.ogg</combat>
</track>
<track>
<name>cosmos</name>
<explore>bp_MUS_CosmosEXPLORE.ogg</explore>
<combat>bp_MUS_CosmosBATTLE.ogg</combat>
</track>
<track>
<name>title</name>
<explore>bp_MUS_TitleScreen.ogg</explore>
</track>
<track>
<name>laststand</name>
<explore>bp_MUS_LastStand.ogg</explore>
</track>
<track>
<name>hyperspace</name>
<explore>bp_MUS_HyperspaceEXPLORE.ogg</explore>
<combat>bp_MUS_HyperspaceBATTLE.ogg</combat>
</track>
<track>
<name>light</name>
<explore>bp_MUS_LightEXPLORE.ogg</explore>
<combat>bp_MUS_LightBATTLE.ogg</combat>
</track>
<track>
<name>overpass</name>
<explore>bp_MUS_OverpassEXPLORE.ogg</explore>
<combat>bp_MUS_OverpassBATTLE.ogg</combat>
</track>
<track>
<name>polimers</name>
<explore>bp_MUS_PolymersEXPLORE.ogg</explore>
<combat>bp_MUS_PolimersBATTLE.ogg</combat>
</track>
<track>
<name>reality</name>
<explore>bp_MUS_RealityEXPLORE.ogg</explore>
<combat>bp_MUS_RealityBATTLE.ogg</combat>
</track>
<track>
<name>zombie</name>
<explore>bp_MUS_ZombieEXPLORE.ogg</explore>
<combat>bp_MUS_ZombieBATTLE.ogg</combat>
</track>
<track>
<name>cans</name>
<explore>bp_MUS_CansEXPLORE.ogg</explore>
<combat>bp_MUS_CansBATTLE.ogg</combat>
</track>
</music>
As you can see it contains the original music and the tracks added by the addon. You list should contain the original music and your custom tracks. Coppy the vanilla tracklist into the append file. You can get it by extracting the game data, its stored in the orginal
sounds.xml file.
4. Copy a
<track> capsule and change the <name> tag to your liking.
5. change the
<explore> and
<combat> tags to the file names of the songs you added. If you remove the
<combat> tag the track will simply play its
<explore> variant all the time. (Note:
<explore> and
<combat> tracks must always have the same length in seconds to work correctly together.) Now the game knows that your music exists.
6. But it does not yet know when to play it. What music is played in which sector is handled via the
sector_data.xml.append file. Create this file and put it into your
data folder.
7. For demonstrations sake, I'll assume you want your tracks to be played in Rock controlled sectors. Copy the vanilla entry for the Rock controlled sector into your
sector_data.xml.append.
Code: Select all
<sectorDescription name="ROCK_SECTOR" minSector="1" unique="false">
<nameList>
<name>Rock Controlled Sector</name>
</nameList>
<trackList>
<track>rock</track>
<track>wasteland</track>
</trackList>
<rarityList>
<blueprint name="engi" rarity="0"/>
<blueprint name="mantis" rarity="0"/>
<blueprint name="energy" rarity="3"/>
<blueprint name="slug" rarity="0"/>
<blueprint name="rock" rarity="1"/>
<blueprint name="human" rarity="2"/>
<blueprint name="BOMB_LOCK" rarity="4"/>
</rarityList>
<!--<event name="STORE" min="2" max="4"/>-->
<startEvent>START_BEACON_ROCK</startEvent>
<event name="STORE_ROCK" min="2" max="2"/>
<event name="NOTHING_ROCK" min="2" max="3"/>
<event name="DISTRESS_BEACON_ROCK" min="1" max="2"/>
<event name="HOSTILE_ROCK" min="6" max="8"/>
<event name="BOARDERS_ROCK" min="1" max="2"/>
<event name="ITEMS" min="1" max="2"/>
<event name="QUESTS_ROCK" min="0" max="1"/>
<event name="NEUTRAL_ROCK" min="7" max="8"/>
</sectorDescription>
The
<trackList> capsule in the
<sectorDescription> is what tells the game which music to play in this sector.
8. Add
<track> with the name you used for your music in
sounds.xml.append to the sectors where you want your music to be played. The tracks will be played in the order you put them in the
<trackList>. Once all the songs are played the game will start from the beginning of the list again.
9. Compress your
data and
audio folders into a single file and rename the file ending to
.ftl. Patch it in with SMM and your music should be played in the respective sectors. Done.
Some more hints:
- I tried to be comprehensive but it might also help to simply look at how other mods (for example the Aditional Music Addon) did this, by extracting the mod file and, well, looking at the files.
I generally found that a lot of the xml stuff is to some degree self-explanatory.
- My example is very intrusive. For example it will completely overwrite any changes made to the Rock sector blueprint by other mods. That is bad for compatibility. The new SMM offers some advanced functionalities that probably would allow to inject the new tracks into the existing sector blueprint and into the generally music tracklist. I'm not an expert on this.
Hope that works for you. Happy modding.