Music Modding (Is it even possible?)

I've been spending quite a bit of time this week on modding, learning the ins and outs of adding a new race and faction. Everything has been going great except I have run into one little snag.

Try as I might, I cannot make heads or tails of the layeredmusic XML. It looked pretty straight forward when I first opened it. To add new music seemed like it would be a simple matter of creating a new layeredmusic group and then calling to it's ID in the faction configuration. 

That didn't work, so I did some snooping around in the raceconfig file and saw that the factions don't actually call to the layeredgroups. They call to something with a similar name, but I cannot find what they are calling to, anywhere.

For instance, Tarth calls to a music identifier named "Forest_Refuge". If you look through the layeredmusic file, you can find the forest refuge group, but nowhere is there an identifier that says "Forest_Refuge" that the raceconfig is calling to. 

Is this functionality hard coded? It would be simple enough for me to just use the existing music groups, or even replace the mp3s but I would like to be able to add new groups instead, as it would be more elegant and easier to expand upon. 

 

 

3,957 views 2 replies
Reply #1 Top

No idea.

Reply #2 Top

Ok, I've got the music partially figured out.

 

I will use Tarth as an example here...

Code: xml
  1. <LayeredMusicGroup InternalName="Theme_ForestRefuge_Full">
  2. <MusicLayer InternalName="BG">
  3. <FileName>Theme_ForestRefuge_BG</FileName>
  4. <Volume>100</Volume>
  5. </MusicLayer>
  6. <MusicLayer InternalName="MG">
  7. <FileName>Theme_ForestRefuge_MG</FileName>
  8. <Volume>100</Volume>
  9. </MusicLayer>
  10. <MusicLayer InternalName="FG">
  11. <FileName>Theme_ForestRefuge_FG</FileName>
  12. <Volume>100</Volume>
  13. </MusicLayer>
  14. </LayeredMusicGroup>

 

The important thing to note is the InternalName is broken into three parts. Theme ForestRefuge Full

When you call to the music group, you only call to the middle of the name. for instance, with Tarth you only call to "ForestRefuge". I tested this with a custom LayeredMusicGroup and I was able to use a custom song for the diplomacy window and when viewing the character sheet for my sovereign in game. I imagine it will work with any other triggered events that call to the music group, the ambient background music that plays during the game has remained unchanged.

I was really hoping to be able to change the ambient music for each faction, but it looks like it may not be tied to factions.

 

EDIT: Actually that is pretty much it in a nutshell. The ambient music is defined further down in the file. The above method works for any of the music.