At this point I would suggest you make a copy of the extracted
Music folder that has been created and place that copy somewhere else on your pc. It would be a good idea to create a folder from which you can do the entire editing process, preferably outside of your actual game files. This will just allow you to keep everything tidy. I would suggest you create two folders inside this new folder. One which will hold all the files you are editing and one for the music you intend on adding to the game. I would recommend you set up the first folder in such a way that you can simply drag and drop it into your Med 2 game files and it will just copy over and put all the files in the appropriate place. This will make things much easier later down the line. To do this make a yet another folder and name it
data. Place descr_sounds_music.txt and descr_sounds.txt in this folder and now also create a
Sounds folder. You will also need to make a folder called
world with another folder called
maps with another folder named
base. In that last folder you can place your copy of descr_sounds_music_types.txt. Remember that this part is optional but I can't emphasize enough on how much time this will save you. If you ignore this part then you will need to add all of the green text files back to the appropriate sections manually each time you edit them.
For all examples below I will use the Divide and Conquer submod for Third Age. Your files won't look exactly like this unless you are using that mod. The relevant files you will need for this part are as follows: The extracted Music.dat folder, descr_sounds_music.txt, descr_sounds_music_types.txt, and possibly descr_strat.txt.
So how do you actually add your music into the game?
- The first thing to do is to open up all the green text files listed above in notepad++. You can have all of them open at once which will prove very useful.
- You need to figure out the internal file name of the faction you're looking to modify. To do this, do a control+f search for the faction in question. Depending on the mod you're playing the internal file name might not have anything to do with the name of the faction in-game. For example: If I search for Mordor in Divide and Conquer's descr_strat.txt I will find first all of the resource entries for Mordor(bolded underlines added by me), but if I keep clicking "find next" eventually I find that they are actually listed as england.
Code:
;###########################
;##### Faction: Mordor #####
;###########################
faction england, fortified knud
ai_label default
;ai_label evil
denari 6000
denari_kings_purse 850
- Now that you have that information you need to find out which music_type your faction is listed under in descr_sounds_music_types.txt. So I will now control+f in this file for england and find that their are part of the eastern_european music group:
Code:
music_type eastern_european
regions Gorgoroth_Province Gorgoroth_South_Province East_Gorgoroth_Province Carnen_Province Udun_Province
regions Morgul_Vale_Province Morgai_Province Cirith_Province Orc_Province Nan_Curunir_Province Angsul_Province
regions High_Pass_Province Central_Mountains_Province East_Deep_Mirkwood_Province Brethil_Province
regions Grey_Mountains_Province Carn_Dum_Province Mt_Gram_Province Mt_Gundabad_Province Ettenmoors_Province
regions Litash_Province Grey_Foothills_Province Arthedain_Rammas_Province Isenmouthe_Province Rhudaur_Province
factions england poland france hre portugal
- Now let's find the relevant section of descr_sounds_music.txt. So, let's control+f in this file for music_type eastern_european. We will find that they are listed under the generic title of "Orcs" followed by a ton of other stuff:
Code:
; Orcs
music_type eastern_european
state MUSIC_BATTLE_BATTLE
event
folder data/sounds/Music
orcs_battle_01.mp3
orcs_battle_02.mp3
orcs_battle_03.mp3
orcs_battle_04.mp3
orcs_battle_05.mp3
orcs_battle_06.mp3
orcs_battle_07.mp3
orcs_battle_08.mp3
orcs_battle_09.mp3
orcs_battle_10.mp3
orcs_battle_11.mp3
neutral_battle_01.mp3
neutral_battle_02.mp3
neutral_battle_03.mp3
neutral_battle_04.mp3
neutral_battle_05.mp3
neutral_battle_06.mp3
neutral_battle_07.mp3
end
etc...
- The entries in this section determine which songs in the Music.dat folder will play for the factions listed under the music_type in question. It is broken down in several sections which I will explain in detail below. The major gist of it should be pretty obvious once you look at it. It's mainly broken down between battle and stratmap.
- You can now add your songs into the extracted Music folder. Make sure they are in mp3 or wav format! Non mp3 or wav format songs will simply not play in game. There will be silence in their place. Mp3 songs are going to be smaller (in regards to file size) than wav so it's pretty much always worthwhile to convert any songs to that format A free music file converter I personally recommend would be Switch Sound File Converter
- Now enter the text entry for each song you add to the extracted Music folder. For example we'll pretend we added a song called new_music_01.mp3:
Code:
music_type eastern_european
state MUSIC_BATTLE_BATTLE
event
folder data/sounds/Music
orcs_battle_01.mp3
orcs_battle_02.mp3
orcs_battle_03.mp3
orcs_battle_04.mp3
orcs_battle_05.mp3
orcs_battle_06.mp3
orcs_battle_07.mp3
orcs_battle_08.mp3
orcs_battle_09.mp3
orcs_battle_10.mp3
orcs_battle_11.mp3
new_music_01.mp3
- Make sure you include the ".mp3" part in every entry as it won't recognize your songs if you don't. Also, Make sure you hit save on each and every tab of your files open in notepad++ to ensure your changes carry over. However, ensure you don't save any edits to descr_strat.txt as that could potentially screw you over!
- After you're finished adding your music and editing the text files you are ready to copy and paste everything back into your actual game(assuming you've been working in a seperate file.
- Navigate back todata/sounds in your mod. You want to ensure that you only have the extracted Music folder in there. As stated before you should have put SFX.dat/SFX.idx and Voice.dat/Voice.idx back. Those files are fine. You do also want to delete the extracted effect_evt file as this needs to be rebuilt along with the Muisc folder.
- To rebuild the music launch the mod you are editing. It may or may not crash before getting to the main menu. This is fine. Quit after getting to the main menu if your game does make it that far, as you will crash if you try to load into a campaign at this point. If you go back to the data/sounds folder you will find that Music.dat/Music.idx and Events.dat/Events.idx have been completely rebuilt and now your music is in the game!
- Launch the game once again and bask in the glory of your own music.
What does each section in the descr_sounds_music.txt denote?
state MUSIC_BATTLE_BATTLE - Songs in this section play when your units actually engage the enemy on the battlemap
state MUSIC_BATTLE_MOBILIZE - These play when you give movement orders in a battle but haven't actually engaged the enemy yet
state MUSIC_BATTLE_TENSION - These songs play during the deployment phase and/or during a lull in the battle
state MUSIC_CAMPAIGN_LOADING - Plays during the loading screen between choosing your faction in the faction selection screen and the campaign map.
state MUSIC_CAMPAIGN_VICTORY - The song that will play after a campaign victory is achieved
state MUSIC_CAMPAIGN_DEFEAT - Plays if you manage to lose a campaign
state MUSIC_CREDITS1 delay 3 - Plays during the credits scene that will play after either campaign victory or defeat
state MUSIC_CREDITS2 - Not sure what the difference is between this one and the one above
state MUSIC_FRONTEND - This is the song that plays on the main menu. NOTE that you can have more than one song in this category! However, the game will pick one song that it will favor over the others. For example, if you make 3 songs in this category then the game will favor the second song over the other two. I couldn't tell you why, it's just the behavior I've observed in my testing. Also worth noting that you can make each music_type have it's own set of main menu music. However, I don't actually know how that works out in game as I've never tested that.
state MUSIC_PREBATTLE_SCROLL - The song that will play when the battle scroll is first initiated on the campaign map.
state MUSIC_RESULT_DRAW, MUSIC_RESULT_LOSE_AVERAGE, MUSIC_RESULT_LOSE_CLOSE, MUSIC_RESULT_LOSE_CRUSHING, MUSIC_RESULT_WIN_AVERAGE, MUSIC_RESULT_WIN_CLOSE, MUSIC_RESULT_WIN_CRUSHING - These are the songs that will play while the player is viewing the after battle report while still on the battlefield based on the outcome of the battle.
state MUSIC_RESULT_STRAT_DRAW, MUSIC_RESULT_STRAT_LOSE_AVERAGE, MUSIC_RESULT_STRAT_LOSE_CLOSE, MUSIC_RESULT_STRAT_LOSE_CRUSHING, MUSIC_RESULT_STRAT_WIN_AVERAGE, MUSIC_RESULT_STRAT_WIN_CLOSE, MUSIC_RESULT_STRAT_WIN_CRUSHING - These are the same as above except they play when you get back to the campaign map after a battle.
state MUSIC_STRATMAP_SUMMER - These songs will play during the Summer season on the campaign map
state MUSIC_STRATMAP_WINTER - These play during the Winter Season on the campaign map