• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

unmerged(453370)

Private
1 Badges
Feb 17, 2012
24
0
  • Crusader Kings II
Adding Own Music Mini-Tutorial (no modding skills required)

So, after downloading the different music mods around here I kinda figured out how they worked, and it was so simple that I figured I should try to add some of my own favourite songs to the game - and, surprisingly, it worked! This made me realise that modding the music in this game is something anyone can do (I'm not particularily tech-savvy), so, I thought, why not share the method.

It's possible many of you already know how to do this, or that someone else posted this somewhere else, but the worst that could happen in such a case is that I wasted my time, so why not.

Right, mini-tutorial:

1) Start by finding the main folder for Crusader Kings II. There are two folders, the one where most of the game is stored and the one that has save data and such. You want the former. In my case, it was located in C:\Program Files (x86)\Steam\Steamapps\common\crusader kings ii, although the precise location might vary. The folder should contain several sub-folders, like "achievements", "DLC", "launcher", and the one we want, "music".

2) Open the "music" sub-folder. You will see a number of files with the .ogg-extension, like "akingisdead.ogg", "asimplesongforcommoners.ogg", "coeurdelion.ogg" and several others. You will also see a .txt-file, called "songs.txt". I'd recommend you back up the "songs.txt"-file - it's not crucial that you do so, but there's a chance it might be useful if something goes wrong later. Also, I would probably change the name of the "songs.txt"-file that remained in your "music"-folder (to anything you want, it doesn't matter what it's named, although I'd use only lowercase letters and numbers, no symbols or space; haven't tested it, but doing so might mess with the programming), so you won't run any risk of files overwriting each other later.

3) Find some song you want to use in the game from your reportoire of music. Seeing as all the files for the game are in .ogg-format, though, it's probably best to convert your file to .ogg before you try using it. Fortunately, this is easy, as there are many converters out there. You could use google and search for "convert to .ogg" as I did, or you could, for example, use this site: http://audio.online-convert.com/convert-to-ogg (I used that one myself, but I will make no guarantees about how safe it is, though it worked fine for me).

4) Take your newly converted .ogg-file and put it into the "music"-subfolder from earlier. Again, I note that it is probably safest to change its name to something consisting of only lowercase letters and numbers, no spaces or funny symbols; I don't know for sure that doing so would be a problem, but it pays to be safe I guess.

5) Open the .txt-file. You will note that it looks something like this:

Code:
[COLOR="#FFFFFF"]song = {
	name = "akingisdead.ogg"
	
	chance = {
		modifier = {
			factor = 1
		}		
	}
}



song = {
	name = "asimplesongforcommoners.ogg"
	
	chance = {
		modifier = {
			factor = 1
		}		
	}
}[/COLOR]

and so on. Each of the "song = ... name = ..." and so ons represent an instruction to play one song. The simplest thing to do is simply to copy one of these blocks of text. You want to copy everything from "song" to the last of the three "}"'s at the end. Then, just swap the song name you copied with the name of the song you want to add (leaving it with an .ogg-extension).

An example - say you were adding a song originally named "Crusader's Paradox", a MP3-file (no such song exists AFAIK, I just needed some name ;) ). After converting it to .ogg, change it's name to "crusadersparadox", making sure it has an .ogg-extension. Then edit the .txt-file as I said, getting a result like this

Code:
[COLOR="#FFFFFF"]song = {
	name = "akingisdead.ogg"
	
	chance = {
		modifier = {
			factor = 1
		}		
	}
}



song = {
	name = "asimplesongforcommoners.ogg"
	
	chance = {
		modifier = {
			factor = 1
		}		
	}
}

song = {
	name = "crusadersparadox.ogg"
	
	chance = {
		modifier = {
			factor = 1
		}		
	}
}[/COLOR]

If this was the entire .txt-file at this point, then when you play Crusader Kings, the game will play the three songs "asimplesongforcommoners", "akingisdead" and "crusadersparadox" in a random loop, each popping up equally often statistically speaking. Obviously, as there are more songs on the list, you'd get all of them, as well as your new song, and you are now ready to enjoy Crusader Kings with your own custom soundtrack! Enjoy!



I guess I can add a few "advanced" points as well, for those who want to tweak a bit:

There's nothing wrong with having multiple .txt-files, so you could, say, make a separate .txt-file for each song or group of songs if so inclined. The game will still choose randomly from all the .txt-files, so you won't "lose any songs" this way. I think I read somewhere that the game will go through the different .txt-files in alphabetic order (though shuffling the contents within each one), but this doesn't seem to be the case for me - anyone got a comment?

The "chance = { modifier = { factor = 1 (...)"-part can be tweaked to change how often a particular song crops up. If for some reason you don't want a song to play at all, change "1" to "0". If you want it to play twice as often as other songs, change "1" to "2"; if you want it three times as often, "1" to "3" and so on. The number should be an integer; I don't believe the coding accepts fractions (so you couldn't get it to play, say, half as often as other songs, although you could change the factor of all other songs to 2 and leave that one song's factor as 1), but I might be mistaken. Hey, I'm no computer expert, I don't run the risk of crashing my pc/game and then being unable to fix it! :eek:o

You can tweak the code even further, although now we're kinda in modding terrain. It's possible to get it to play only when you have a certain culture, a certain religion, if you're at war or at peace and so on. I haven't really toyed so much with this, but, say, if you wanted the aforementioned "crusadersparadox.ogg" to only play when you're at war, then its code would have to look something like this:

Code:
[COLOR="#FFFFFF"]song = {
	name = "crusadersparadox.ogg"
	
	chance = {
		modifier = {
			factor = 0
			war = no
		}	
		modifier = {
			factor = 1
			war = yes
		}		
	}
}[/COLOR]

The song now has a 0 chance of being played while you're not at war (i.e. it will never play when at peace), and will play equally often as other songs when you are at war.

Well, that's about it. Those with the skills to tweak this further are free to do so, and it would be nice if you shared your results with the rest of us.

Hope that this might be slightly useful, and, if someone already made a better guide somewhere, then I defer to them and apologise for the disturbance.

Anyhow, go and enjoy Crusader Kings with your new soundtrack!

As a final note, personally, I found some pieces from the anime Horizon in the Middle of Nowhere to fit shockingly well with the game, but that might just be my opinion.:eek:o
 
Last edited:
Thanks so much for this. Trying to figure out why my songs were still playing during peace was driving me mad. Such a simple solution after all xD. Any suggestions on figuring out if that particular code works? I think using nextsong in console overrides those commands
 
Last edited:
Sorry, I'm no modder, I just emulated what I found in the existing music folder/what other people had used as code for their music-mods. I don't even use the console myself XD.

But, glad to see that my post was useful to someone. I suspect the wierd title made people skip the post - better remember not to start a thread at four in the night again, to ensure that the title isn't a non seqitur :eek:o
 
Thanks for this. I hadn't really looked into how the sound system worked. It'd be cool to have music change as your character changes location. You could march an army from northern France to the Levant and hear the music shift as the army progresses.

I don't have any of the music DLCs. Could someone post a snippet on what modifiers they use to control music?
 
Edit: It's ok I got my answer in the modding quick questions thread.

Hey thanks for this thread.

I have been able to add some custom music to the game for the ASOIAF mod by adding a music folder to the mod folder and adding some .ogg music files and adding a songs.txt to change the modifiers for the songs as so
Code:
 song = {
	name = "thekingsarrival.ogg"
	
	chance = {
		modifier = {
			factor = 1
		}		
	}
}

However all of the songs from the vanilla game are still being played along with my new songs when I use the mod. I tried changing the factor for them as so

Code:
 song = {
	name = "akingisdead.ogg"
	
	chance = {
		modifier = {
			factor = 0
		}		
	}
}



song = {
	name = "asimplesongforcommoners.ogg"
	
	chance = {
		modifier = {
			factor = 0
		}		
	}
}

This didn't change anything however and the vanilla songs are still played. Does anyone know what I have to do to change it so the vanilla songs are not played and only the custom songs I want are played when using the mod???
 
Last edited:
Edit: It's ok I got my answer in the modding quick questions thread.

Hey thanks for this thread.

I have been able to add some custom music to the game for the ASOIAF mod by adding a music folder to the mod folder and adding some .ogg music files and adding a songs.txt to change the modifiers for the songs as so
Code:
 song = {
	name = "thekingsarrival.ogg"
	
	chance = {
		modifier = {
			factor = 1
		}		
	}
}

However all of the songs from the vanilla game are still being played along with my new songs when I use the mod. I tried changing the factor for them as so

Code:
 song = {
	name = "akingisdead.ogg"
	
	chance = {
		modifier = {
			factor = 0
		}		
	}
}



song = {
	name = "asimplesongforcommoners.ogg"
	
	chance = {
		modifier = {
			factor = 0
		}		
	}
}

This didn't change anything however and the vanilla songs are still played. Does anyone know what I have to do to change it so the vanilla songs are not played and only the custom songs I want are played when using the mod???


I just successfully modded my Game of Thrones mod to play the full first season soundtrack. It's a simple fix: create a new music folder inside the Game of Thrones mod folder. When you load the mod, that's the only music folder it'll look at and play from.

So now I've got GOT only and none of the (admittingly awesome) stuff from vanilla when I load up my GOT mod.
 
I just successfully modded my Game of Thrones mod to play the full first season soundtrack. It's a simple fix: create a new music folder inside the Game of Thrones mod folder. When you load the mod, that's the only music folder it'll look at and play from.

So now I've got GOT only and none of the (admittingly awesome) stuff from vanilla when I load up my GOT mod.

That's strange cos that's what I did initially but the game would mix in the Vanilla music (which I agree is awesome) with the GoT music I had added. I found I had to go to the .mod file for the GoT mod and add a line of code reading
Code:
replace path = "music"
that fixed the issue for me.
 
I modded my songs.txt file and converted everything to .ogg

One Game of Thrones song plays and stops around the middle and Crusader Kings 2 songs start playing.

This is how my file looks like.

ong = {
name = "abirdwithoutfeathers.ogg"

chance = {
modifier = {
factor = 1
}
}
}



song = {
name = "agoldencrown.ogg"

chance = {
modifier = {
factor = 1
}
}
}

song = {
name = "aravenfromkingslanding.ogg"

chance = {
modifier = {
factor = 1
}
}
}



song = {
name = "awaitthekingsjustice.ogg"

chance = {
modifier = {
factor = 1
}
}
}

song = {
name = "blackofhair.ogg"

chance = {
modifier = {
factor = 1
}
}
}

song = {
name = "hornsofhattinandaftermath.ogg"

chance = {
modifier = {
factor = 1
}
}
}



song = {
name = "dontdiewithacleansword.ogg"

chance = {
modifier = {
factor = 1
}
}
}

song = {
name = "finale.ogg"

chance = {
modifier = {
factor = 1
}

}
}

song = {
name = "fireandblood.ogg"

chance = {
modifier = {
factor = 1
}

}
}

song = {
name = "gameofthrones.ogg"

chance = {
modifier = {
factor = 1
}

}
}

song = {
name = "goodbyebrither.ogg"

chance = {
modifier = {
factor = 1
}
}
}

song = {
name = "houseoftheundying.ogg"

chance = {
modifier = {
factor = 1
}
}
}

song = {
name = "iamherssheismine.ogg"

chance = {
modifier = {
factor = 1
}
}
}

song = {
name = "iwillkeepyousafe.ogg"

chance = {
modifier = {
factor = 1
}
}
}

song = {
name = "jonshonor.ogg"

chance = {
modifier = {
factor = 1

}
}
}

song = {
name = "killthemall.ogg"

chance = {
modifier = {
factor = 1
}

}
}


song = {
name = "kingofthenorth.ogg"

chance = {
modifier = {
factor = 1
}

}
}



song = {
name = "loveintheeyes.ogg"

chance = {
modifier = {
factor = 1
}

}
}


song = {
name = "maintitle.ogg"

chance = {
modifier = {
factor = 1
}

}
}


song = {
name = "motherofdragons.ogg"

chance = {
modifier = {
factor = 1
}

}
}


song = {
name = "northofthewall.ogg"

chance = {
modifier = {
factor = 1
}

}
}


song = {
name = "onemoredrinkbeforethewar.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "paytheironprice.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "pyatpree.ogg"

chance = {
modifier = {
factor = 1
}
}

}


song = {
name = "qarth.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "smallpackofwolves.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "standandfight.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "theassassinsdagger.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "thekingsarrival.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "thekingsroad.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "thenightswatch.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "theoldgodsandthenew.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "thingsidoforlove.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "threeblasts.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "tovaesdothrak.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "valarmorghulis.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "victorydoesnotmakeusconquerors.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "warrioroflight.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "whatisdeadmayneverdie.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "thepointyend.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "therainsofcastemere.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "thethroneismine.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "thewall.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "whenthesunrisesinthewest.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "wildfire.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "youwinoryoudie.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "winteriscoming.ogg"

chance = {
modifier = {
factor = 1
}
}
}


song = {
name = "youllbequeensomeday.ogg"

chance = {
modifier = {
factor = 1
}
}
}
 
That's strange cos that's what I did initially but the game would mix in the Vanilla music (which I agree is awesome) with the GoT music I had added. I found I had to go to the .mod file for the GoT mod and add a line of code reading
Code:
replace path = "music"
that fixed the issue for me.

Might be a stupid question but where exactly do you find that file? The exact path and where do I put that line? I, too, have the problem with vanilla music playing although I have added new music folder to GOT mod folder and modified the text file.
 
I modded my songs.txt file and converted everything to .ogg

One Game of Thrones song plays and stops around the middle and Crusader Kings 2 songs start playing.

This is how my file looks like.



song = {
name = "hornsofhattinandaftermath.ogg"

chance = {
modifier = {
factor = 1
}
}
}

}

I found a solution. First of all, check your text file again. With a quick glance I noticed you have at least one vanilla song listed, Horns of Hattin and Aftermath.

Then, when you start playing, in the screen where you must tick GOT mod, untick your potential DLC song packs. I noticed that they were the songs that were playing during my game. When I unticked them, they were not playing anymore, just my custom GOT music!

Notice that this doesn't prevent the vanilla opening theme when the game loads. I think it is coded somewhere else, maybe in the vanilla music folder. Perhaps you can just replace (temporarily) the vanilla opening theme with GOT theme there, just make sure to rename it same as vanilla theme (and change its name to something else).

I didn't do the last part, because honestly the vanilla opening theme is just so awesome. And I still get the (by no means less awesome) GOT main theme playing occasionally when I play the mod.

I hope you get it right. I must say the feel is totally different and unique, especially with the more eerie songs like Valar Morghulis, Pyat Pree etc. When they play when I play the War of the Usurper, they give the events very mysterious and threatening atmosphere, which is brilliant because I still don't know the whole story what happened there and why, back in Robert's rebellion (only read the first 3 books by far).

PM me if you still can't get it right.
 
I found a solution. First of all, check your text file again. With a quick glance I noticed you have at least one vanilla song listed, Horns of Hattin and Aftermath.

Then, when you start playing, in the screen where you must tick GOT mod, untick your potential DLC song packs. I noticed that they were the songs that were playing during my game. When I unticked them, they were not playing anymore, just my custom GOT music!

Notice that this doesn't prevent the vanilla opening theme when the game loads. I think it is coded somewhere else, maybe in the vanilla music folder. Perhaps you can just replace (temporarily) the vanilla opening theme with GOT theme there, just make sure to rename it same as vanilla theme (and change its name to something else).

I didn't do the last part, because honestly the vanilla opening theme is just so awesome. And I still get the (by no means less awesome) GOT main theme playing occasionally when I play the mod.

I hope you get it right. I must say the feel is totally different and unique, especially with the more eerie songs like Valar Morghulis, Pyat Pree etc. When they play when I play the War of the Usurper, they give the events very mysterious and threatening atmosphere, which is brilliant because I still don't know the whole story what happened there and why, back in Robert's rebellion (only read the first 3 books by far).

PM me if you still can't get it right.

Thanks a lot! i think got it right. I ll playtest and report. I wish we could get the rights for the soundtrack for this mod. Anybody by chance a friend with the Music Composer? We could bring out a mini mod where all the songs are included. I even added war songs to war factors. So War like songs play when war is going on...
 
Somehow i still get occasional abortinh soundtrack changes. Soundtracks ending in the middle but no more ck ost. Any ideas?