IEMod / IEMod.pw

A mod for Pillars of Eternity
31 stars 19 forks source link

Adding new music? #60

Open GregRos opened 9 years ago

GregRos commented 9 years ago

While playing around with Pillars of Eternity, did you notice how things like battle music/main menu music/etc work? I've really wanted to add more music to the game. We can probably borrow some of the music they use in mods for other RPGs, if we ask nicely and give credit.

tjayharvey commented 9 years ago

It looks like the in-game music is mostly controlled by the AreaMusic class, which has properties for Normal, Combat, and additional tracks for script-related use. This is attached to the MapData, so it's probably just a subproperty of the map/region you're currently in. There's also a UICharacterCreationMusicPlayer (for music played during Character Creation and possibly during level-up). Both of these appear to use strings to refer to the tracks to be played. They look in one of the game's local directories (data/audio/mus), so you wouldn't just be able to replace the string settings with new ones, there will probably have to be some code that looks both in the game's directory and IEMod's directory.

The FrontEndTitleManager is probably responsible for the intro screen, but it's less clear how it gets its Audio Clip, and there's also a UIInterstitialManager, which I imagine is for the between act screens.

It looks like there's a bunch of handy functions in the Scripts class for playing certain kinds of music (though, not, apparently the combat music), so the first thing you might want to do is hook up console commands to them so you can play arbitrary music, test the area music, etc.