Page 1 of 2 12 LastLast
Results 1 to 20 of 22

Thread: El Monstero's Definitive Guide to Modding Med 2's Music

  1. #1
    El Monstero29's Avatar Semisalis
    Join Date
    Sep 2013
    Location
    St. Louis, USA
    Posts
    436

    Default El Monstero's Definitive Guide to Modding Med 2's Music

    Hello fellow Med 2 modders!

    The aim of this tutorial is to gather together all available information on the subject of adding and modifying Med 2's music. Currently, there is no single guide one can follow to learn how to do everything that is possible. As it stands, finding all the relevant information that's out there can be quite frustrating and time consuming. I aim to change that I intend to make this guide as easy to follow, clear, and concise as possible. I will start from the most basic steps on up to the more advanced stuff. Feel free to skip ahead to sections you find relevant to your needs.

    Before we start I will thank all those that have come before me and shared their knowledge and findings on these matters such as Trajan, Gigantus, and Space_Ed. Without them this guide would not exist. I will link to all my sources at the end. Credit where credit is due.

    This stuff can get pretty complicated so in order to hopefully make it a little bit less confusing to someone coming into this with no prior knowledge of Med 2 modding I have created a legend for the various meanings behind the differently colored text used throughout this guide:

    Legend

    Green text - refers to text files
    Red text - refers to .dat and .idx files
    Dark blue text - refers to music_type
    White text - refers to region names
    Courier New font- refers to file paths and names
    Bolded/underlined text - refers to example factions



    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Section 1: Finding the appropriate files

    Spoiler Alert, click show to read: 
    First thing's first. How do you find the music and associated text files?

    Steam Version:

    1. Go to your Steam library and find Med 2.
    2. Right click Med 2 and select "properties" at the bottom of the drop down menu that opens.
    3. In the new menu that pops up click the "Local Files" tab and then "Browse Local Files." This will pull up Med 2's main directory. Ex. C:\Steam Library\steamapps\common\Medieval II Total War
    4. From the main directory, you would navigate to the "mods" folder and choose which ever mod you are editing.
    5. Once the appropriate mod has been chosen you need to navigate to data/sounds. The files you need are Music.dat/Music.idx and Events.dat/Events.idx. The other file you will need is located in the data folder: descr_sounds_music.txt.
    6. If you plan on making faction specific music then you will need descr_sounds.txt, found in the data folder. You will also need to navigate to data/world/maps/base and find descr_sounds_music_types.txt. Another file that may prove to be very useful to have on hand is descr_strat.txt, located in data/world/maps/campaign/imperial_campaign.
    7. Go ahead and create a backup of all of the text files you plan to edit before you do anything else. The sound extractor I will link below will make a backup of your sounds folder, but it's still a good idea to make another backup somewhere else you can access easily just in case.
    8. Use Notepad++(https://notepad-plus-plus.org/download/v7.5.4.html) to edit those text files. Never use the regular version of notepad to edit these things! Your game WILL crash constantly afterwards!


    Disc Version:
    Ideally, you will remember which drive you installed the game on. Once you locate the appropriate drive the game will most likely be in a location similar to this: C:\Programs\SEGA\Medieval II Total War

    From there simply follow the instructions above starting at step 4.


    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Section 2: Extracting the music

    Spoiler Alert, click show to read: 
    I suggest you use Withwnar's "Sound Extractor v1.2" to extract the music. It is very easy to use and is a welcome upgrade to the original XIDX tool. I will copy and paste his instructions on how to use this tool below. However, you will need to download the tool itself from his page. You may want to throw some rep his way while you're there


    Instructions
    These instructions use the Third Age mod as an example only:
    • TATW mod folder = something like C:\Programs\SEGA\Medieval II Total War\mods\Third_Age

    Use the appropriate folder for the mod you are running this for. Or the root installation folder if you are running this for vanilla (e.g. C:\Programs\SEGA\Medieval II Total War).

    NOTE: you will need a fair amount of free hard drive space! Go to the mod's sounds folder (e.g. C:\Programs\SEGA\Medieval II Total War\mods\Third_Age\data\sounds) and get the sum total of all of the *.dat and *.idx files (select them all, right click > Properties). You will need about twice that amount of free space. e.g. If the total is 400MB then you will need 800MB of free space: probably a bit more.

    Instructions:
    1. Download the attachment and extract it to the mod folder:
      • NOTE: Extract it such that it extracts directly into the folder (e.g. "Extract Here") rather than into a new subfolder (e.g. "Extract to SoundExtractor...")
      • There should now be a SoundExtractor folder under the mod folder. e.g. C:\Programs\SEGA\Medieval II Total War\mods\Third_Age\SoundExtractor
      • i.e. SoundExtractor.bat should be located here: {mod folder}\SoundExtractor\SoundExtractor.bat, not here: {mod folder}\SoundExtractor\SoundExtractor\SoundExtractor.bat

    2. Run (double-click) SoundExtractor.bat
      • NOTE: For Vista/Windows7/later users you might need to run it as an administrator: right click > Run as administrator

    3. A command window opens and shows you the progress: it will tell you when it has finished
    4. Now you may install the files for the submod that this SoundExtractor is being used for. Do not start the game until the submod is installed.

    After it has finished you should see this in the sounds folder:
    • Music, SFX and Voice subfolders
    • A "backup" subfolder with today's date: inside that are dat/idx files
    • No dat/idx files in this sounds folder


    Once you have finished installing the submod (not this SoundExtractor: the submod that this SoundExtractor is being used for) start the campaign. This will rebuild the dat/idx files in the sounds folder - this is what the game uses. The other folders are now no longer needed so you may delete them (freeing up a lot of hard drive space). i.e. You may delete the Music, SFX and Voice subfolders and the "backup" subfolder. NOTE: if you are merging multiple submods then read below before deleting anything: you might still need them.


    For our purposes you may as well just copy and paste the backup copies of SFX.dat/SFX.idx and Voice.dat/Voice.idx from the backup folder that was created in the sounds folder and put them back. You can delete the extracted version of these files as they are not relevant to what we're doing. You can also choose to ignore them for now. They will be taken care of the first time you load the game up as mentioned in Withwnar's instructions.


    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Section 3: Adding your own music into the game

    Spoiler Alert, click show to read: 
    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?

    1. 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.
    2. 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
    3. 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
    4. 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...
    5. 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.
    6. 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
    7. 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
    8. 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!
    9. 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.
    10. 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.
    11. 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!
    12. 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



    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Section 4: Creating faction specific music

    Spoiler Alert, click show to read: 
    You know how to add music into the game, but what if you want to split up the various music_types? What if you want every faction to have their own separate playlist? Can these things be achieved? Absolutely!

    You will need all of the files that have been mentioned thus far for this process: the extracted Music file, descr_sounds_music.txt, descr_sounds.txt, descr_sounds_music_types.txt, and descr_strat.txt. If you need help locating these files refer to section one of the guide.


    1. You will need to know the internal file name of the faction in question. This can be found in the descr_strat.txt file. For detailed instructions on this refer back to Section 3 of the guide.
    2. With the true name of the faction in hand you must now refer to descr_sounds_music_types.txt. You want to first remove that faction from whatever music_type it is currently a part of. I will use Mordor(with the internal file name of england) from the Divide and Conquer submod as my example once again.
      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
    3. So, I will remove england from that list but I also need to remove the regions associated with Mordor from that section. These regions are marked in white in the above example You will need to refer to descr_strat.txt once again for this information. So after I finish that the entry will look like this:
      Code:
      music_type eastern_european
      
          regions 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 Rhudaur_Province
      
          factions poland france hre portugal
    4. I will now create a totally new section at the bottom of descr_sounds_music_types.txt for Mordor. We need to create a new music_type, which I will very creatively name mordor. We also need to re-add all those regions we just deleted from the old entry. Finally, don't forget to add the "factions" section at the bottom of your new entry. It should look something like this:
      Code:
      music_type mordor
      
          regions Gorgoroth_Province Gorgoroth_South_Province East_Gorgoroth_Province Carnen_Province Udun_Province
          regions Morgul_Vale_Province Morgai_Province Cirith_Province Orc_Province Isenmouthe_Province
          
          factions england
    5. Next you need to open up descr_sounds.txt and add the new music_type to the list. Control+f is the easiest way to find it although you can just scroll down too, it's quite close to the top. This is what it should look like after you're done:
      Code:
      ;################################
      ;##### SOUNDS - MUSIC TYPES #####
      ;################################
      
      music_types_enum northern_european eastern_european southern_european middle_eastern mesoamerican greek gondor milan mordor
    6. Almost done! Next you need to create a new section in descr_sounds_music.txt. In this case, I will simply use the music_type eastern_european as a template and copy/paste that entry into the bottom of the document. I must simply remember to swap out music_type eastern_european with music_type mordor. Like so:
      Code:
       music_type mordor
              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...
    7. Now all that's left is to add your music to this new faction like we did in Section 3. That's it!



    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Section 5: Known limitations and (not so) frequently asked questions

    Spoiler Alert, click show to read: 
    1. There DOES NOT appear to be a limit to the amount of music you can have. I currently have a music.dat file that is 2.05gbs and everything works as intended!

    2. One limitation is that each region of the campaign map can only have one music_type associated with it in the descr_sounds_music_types.txt file. Meaning that only one set of battle music of one music_type can play in a single region no matter which faction the player is in control of.

    (not so)F.A.Q.


    When should I rebuild the Music.dat and Music.idx file?
    You need to rebuild both Music.dat/idx and Events.dat/idx anytime you make a change in the relevant text files. Failing to do so will mean your most recent changes aren't carried over into the game.

    Do I need to rebuild Events.dat and the idx file everytime I rebuild Music.dat? Yes.
    Are spaces, indents, and other bits of formatting important? YES! Messing up any formatting anywhere can and will cause you problems. Whether those problems manifest right away isn't alway guaranteed, but generally you should try to be as precise and clean with your formatting as you possibly can.

    How many songs can I include in Music.dat? In my testing I managed to get up to 344 songs with no problems. So long as you stay under the size limit mentioned above you'll be fine.

    Does the bitrate(kbps) of the music matter? Not that I can tell. I ended up using songs that were all over the place in terms of bitrate anywhere from 160 to 246kbps. The only thing to keep in mind is that higher bitrate equals larger file size, but also better audio quality.

    Can I add a single region to multiple music_types? No.

    Can I name my music_types anything I want? Yes, you could create a music_type potato_salad if you wanted. So long as you make sure you are consistent with your naming scheme in all the relevant files.

    I'll add any other questions here if you guys have any


    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Section 6: Resources and credits

    Spoiler Alert, click show to read: 
    Royalty Free Music courtesy of GrnEyedDvl
    Remixed Medieval Music courtesty of Reimu Hakurei

    Sources for this guide:
    Trajan's OG guide
    Space_Ed's Faction specific music guide
    Special shoutout to Gigantus for the dozens upon dozens of helpful comments he's made over the years that are scattered all about!
    Another shoutout to Withwnar for exemplary excellence in expanding our knowledge on this subject!


    That's all she wrote! Hopefully this guide will still be useful even if the game is closing in on 12 years old.... At least now you won't have to read through several different threads and page after page of comments to get answers to your questions.

    Enjoy and good luck out there!
    Last edited by El Monstero29; July 04, 2020 at 08:48 PM.

  2. #2
    Ngugi's Avatar TATW & Albion Local Mod
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    10,687

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    Good job

    A note, I'd propse you switch pink for dark blue, green or purple or something, so its not so hard to read.

    Kingdom of Lindon preview video out





    DCI: Last Alliance
    - WIP Second Age mod | DCI: Tôl Acharn - mighty Dúnedain Counter Invasions |
    Additional Mercenary Minimod - more mercs; for TATW and DCI | Family Tree minimods - lore improvements | Remade Event Pictures - enhance cultures trough images |
    Favorite TATW compilation: Withwnars Submod Collection
    Patron of Mank, Kiliç Alì, FireFreak111, MIKEGOLF & Arachir Galudirithon, Earl of Memory

  3. #3
    El Monstero29's Avatar Semisalis
    Join Date
    Sep 2013
    Location
    St. Louis, USA
    Posts
    436

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    Done

  4. #4
    Araval's Avatar Protector Domesticus
    Join Date
    Nov 2010
    Location
    Tartu, Estonia
    Posts
    4,754

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    Good work with gathering all that information together!

    Some things I noticed:
    1) sections 1-4 are called stections in headlines;
    2) in section 4 point 4. Mordor's internal name england should be used in your example;
    3) I don't think it's necessary to use font size 1 in section 1 point 5. and in section 3 points 10.-12.

  5. #5
    El Monstero29's Avatar Semisalis
    Join Date
    Sep 2013
    Location
    St. Louis, USA
    Posts
    436

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    Fixed those dumb typos. I also took to heart your other suggestions. I changed my example to match the internal name as you suggest. The only reason I used the font was consistency more than anything else I'll leave it for now, but I may come back and change it later.

    Thanks for the feedback guys

  6. #6
    Araval's Avatar Protector Domesticus
    Join Date
    Nov 2010
    Location
    Tartu, Estonia
    Posts
    4,754

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    You're welcome!

    I meant this way:
    Code:
    music_type englandmordor
    
        regions Gorgoroth_Province Gorgoroth_South_Province East_Gorgoroth_Province Carnen_Province Udun_Province
        regions Morgul_Vale_Province Morgai_Province Cirith_Province Orc_Province Isenmouthe_Province
        
        factions mordorengland

  7. #7
    El Monstero29's Avatar Semisalis
    Join Date
    Sep 2013
    Location
    St. Louis, USA
    Posts
    436

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    Ok I see what you mean. I changed it as you suggest, but I don't know, I think that might make it a little more confusing. Oh well, I'll leave it as is now.

  8. #8
    Araval's Avatar Protector Domesticus
    Join Date
    Nov 2010
    Location
    Tartu, Estonia
    Posts
    4,754

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    I didn't mean you should use the red crossed out text, I just used it to make my point clearer. I'm sorry if I have been confusing.

  9. #9
    El Monstero29's Avatar Semisalis
    Join Date
    Sep 2013
    Location
    St. Louis, USA
    Posts
    436

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    Ahh, ok. It could just be me being dense too. Fixed!

  10. #10
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    Nice tutorial, thanks.

    2. Another limitation is that faction specific battle music will actually play for all factions in the regions you allocate to it in the descr_sounds_music_types.txt. Meaning that in my Mordor example above, any battle songs that I set aside as specific to the regions that Mordor starts with will play for any faction that fights in those regions. This is a weird little quirk of Med 2's engine. Something to keep in mind. I don't know of anyway around this.
    The "regions" lines are optional. As I understand it: if the battle's region is present in this file then the music_type it is assigned to is used, otherwise the player faction's music_type is used. I haven't tested that but there's some discussion here: http://www.twcenter.net/forums/showt...1#post14568785

    i.e. It's an override. By default use the player faction's music_type BUT for any specific region(s) you can say "regardless of who is fighting who here, play music of this music_type instead". I suppose it's for a bit of variety and atmosphere, a different feel as you fight in different parts of the world.

    Defining those regions lists based on the starting owners is a logical way to do it but it does not need to be that way. e.g. You could make it so that any region in or around the Mordor area plays that music, to reflect the creepiness of the general location, even if the Mordor faction does not own it at campaign start.

  11. #11
    El Monstero29's Avatar Semisalis
    Join Date
    Sep 2013
    Location
    St. Louis, USA
    Posts
    436

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    Quote Originally Posted by Withwnar View Post
    Nice tutorial, thanks.



    The "regions" lines are optional. As I understand it: if the battle's region is present in this file then the music_type it is assigned to is used, otherwise the player faction's music_type is used. I haven't tested that but there's some discussion here: http://www.twcenter.net/forums/showt...1#post14568785

    i.e. It's an override. By default use the player faction's music_type BUT for any specific region(s) you can say "regardless of who is fighting who here, play music of this music_type instead". I suppose it's for a bit of variety and atmosphere, a different feel as you fight in different parts of the world.

    Defining those regions lists based on the starting owners is a logical way to do it but it does not need to be that way. e.g. You could make it so that any region in or around the Mordor area plays that music, to reflect the creepiness of the general location, even if the Mordor faction does not own it at campaign start.
    That is extremely interesting! I will test that right away! Let's see if we can't get a definitive answer one way or the other.

  12. #12
    El Monstero29's Avatar Semisalis
    Join Date
    Sep 2013
    Location
    St. Louis, USA
    Posts
    436

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    Unfortunately, it doesn't seem to have any effect when I delete the region entries from descr_sounds_music_type and rebuild everything. I just did a test with a faction that I've given totally unique battle music. I started a campaign as them, gathered together my starting troops and moved them via console command to go fight in another faction's starting domain. The battle music that played in the battles I initiated were all that other faction's music_type.

    My guess is that it selects the battle music for each region based on their entries in descr_strat unless overridden in the DSMT. I think this is why slave needs to be given a music_type. Otherwise, I assume, nothing would play in the regions that start off as slave-held.
    Last edited by El Monstero29; February 04, 2018 at 06:14 AM.

  13. #13
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    My guess is that it selects the battle music for each region based on their entries in descr_strat unless overridden in the DSMT.
    Or who currently owns it perhaps.

    Yeah, that it uses the player's own faction's music_type was guesswork on my part too. It wouldn't be a difficult thing to find out for sure, just time consuming, and the answer probably doesn't make any difference to anyone's plans. If a region is missing from this file then music still plays - that's the main thing.

  14. #14
    El Monstero29's Avatar Semisalis
    Join Date
    Sep 2013
    Location
    St. Louis, USA
    Posts
    436

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    I tested a little bit further and it seems you can actually just put every region into every music_type's entry in the DSMT and thus allow your current faction's battle music to play anywhere! Or you can exclude some regions and thus allow the original music to play instead.

    I just made a quick and dirty copy/paste of all the regions into Khand's entry in the DSMT:
    Spoiler Alert, click show to read: 
    Code:
    music_type khand
    
        regions Harad_Province Far_Khand_Province West_Khand_Province Khand_Province Near_Harad_Province
        regions Harondor_Province
        regions Rhawburg_Province Scorched_Province Erech_Province
        regions Adorn_Province Gap_of_Rohan_Province Suduri_Province
        regions Weather_Hills_Province Pukel_Province
        regions Cardolan_Province Arthedain_Province Lake_Evendim_Province Staddle_Province Emyn_Beraid_Province
        regions Minhiriath_Province Druwaith_Iaur_Province Lond_Angren_Province Borderlands_Province Wrakyaburg_Province
        regions Wold_Province Border_Province Evendim_Province East_Cardolan_Province Far_Low_Anduin_Province Celduin_Far_East_Province
        regions Rhovanion_Province North_Rhovanion_Province 
        regions Mitheithel_Province Wilderland_Province West_Wold_Province Dagorlad_Province
        regions Lone_lands_Province Tirith_Thoron_Province Lonehills_Province Athilin_Province
        regions Forodwaith_Province Wildlands_Province Oiolad_Province Celduin_Far_Province Far_Rhovanion_Province Angle_Province Far_Arthedain_Province
        regions Nurunk_Province Logathavuld_Province Metraith_Province Wilishar_Province Girithlin_Province
        regions Wintirion_Province Faerdor_Province Rhaglaw_Province Forochel_Province Lune_Province Tharbad_Province
        regions Celduin_North_Province Centre_Rhovanion_Province Central_Minhiriath_Province Fortriu_Province
        regions Far_Harad_Province Haradwaith_Province Southern_Rhun_Province
        regions Amrun_Province Gobel_Ancalimon_Province Shafra_Province Northern_Harondor_Province Southharondor_Province
        regions Mistrand_Province Morad_Province Rhun_Province Kelepar_Province Eastrhun_Province North_Khand_Province
        regions Near_Rhun_Province North_Rhun_Province Far_Desert
        regions Chelkar_Province South_Logathavuld_Province Pezarsan_Province Farest_Rhun_Province
        regions Bree_Province Bywater_Province Eastfarthing_Province Shire_Province Southfarthing_Province 
        regions Dunland_Province Dunland_Hills_Province Duneard_Province Enedwaith_Province Talsir_Province North_Enedwaith_Province South_Enedwaith_Province
        regions Lower_Anduin_Vale_Province Anduin_Vale_Province Gladden_Fields_Province Lowest_Anduin_Vale_Province North_Gladden_Fields_Province West_Anduin_Province
        regions Central_Vale_Province Woodsmen_Province
        regions Umbar_Province South_Umbar_Province Erelond_Province
        regions Dale_Province Celduin_Province Celduin_East_Province Esgaroth_Province
        regions South_Dorwinion_Province Dorwinion_Province Uldonavan_Province
        regions Kings_Land_Province Helms_Deep_Province East_Emnet_Province West_Emnet_Province Eastfold_Province
        regions Westfold_Province
        regions Anorien_Province Lossarnach_Province Belfalas_Province Lebennin_Province West_Lebennin_Province Methrast_Province
        regions Anfalas_Province Lamedon_Province Tarnost_Province Pinnath_Gelin_Province Fanuilond_Province
        regions Ethring_Province Harondor_Province Cair_Andros_Province West_Osgiliath_Province East_Osgiliath_Province
        regions Andrast_Province Ithilien_Province South_Ithilien_Province North_Ithilien_Province Tolfalas_Province Anorien_Fields_Province
        regions Barad_Harn_Province Amon_Eithel_Province Anduin_Straits_Province Andrast_Cape_Province Pukel_Gap_Province
        regions Imladris_Province Harlindon_Province Mithlond_Province Forlindon_Province Edhellond_Province Lune_land_Province
        regions Elven_Mirkwood_Province Lothlorien_Province Celebrant_Province Central_Mirkwood_Province West_Mirkwood_Province
        regions New_Mirkwood_Province Eregion_Province South_Mithlond_Province
        regions East_Mirkwood_Province South_Elven_Mirkwood_Province Lune_North_Province Hollin_Province Middle_Mirkwood_Province
        regions Erebor_Province Iron_Hills_Province Ered_Luin_Province Nan_i_Naugrim_Province South_Ered_Luin_Province
        regions East_Moria_Province West_Moria_Province
        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 khand


    It worked! Thank you for the lead, Withwnar. I'll edit the OP.

  15. #15
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    If another faction - some other music_type - also has one of those regions then do they get their own music there too, or do they get the khand music?

  16. #16
    El Monstero29's Avatar Semisalis
    Join Date
    Sep 2013
    Location
    St. Louis, USA
    Posts
    436

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    Hmm, it would seem that Khand's music is now playing for everyone. Damn. Thought I was onto something there.

  17. #17
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    Yeah, I reckon the game is simply scanning through this file until it finds the region and bases its music_type on that - faction doesn't enter into it here. If the region is in this file multiple times then it's a question of which one does it use. I don't know but would hazard a guess that it's either the first or last one. It doesn't matter though because clearly having it in there more than once serves no purpose other than to confuse ourselves, e.g. region X is under music_type Y so why is that music not playing? (Answer: because it's also under music_type Z.)

  18. #18
    Frunk's Avatar Form Follows Function
    Artifex

    Join Date
    Jun 2009
    Location
    Gold Coast
    Posts
    6,506

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    Time for a sticky.

  19. #19
    El Monstero29's Avatar Semisalis
    Join Date
    Sep 2013
    Location
    St. Louis, USA
    Posts
    436

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    Quote Originally Posted by Frunk View Post
    Time for a sticky.
    Thank you kindly!

  20. #20
    leo.civil.uefs's Avatar É nóis que vôa bruxão!
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    3,135

    Default Re: El Monstero's Definitive Guide to Modding Med 2's Music

    I've read this thread carefully and tried many things to get battle music culture(type) specific, but no success. It really seems impossible.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •