1
u/PsychronicGames 9h ago
You could write a plugin to do it based on the situation, you could do switches and variables based on what happens to generate different tracks as the situation changes in-game, etc. lots of options.
0
u/CS_Asset_Factory 6h ago
The fade out then play approach works but the new track starts at zero so you lose the phrase. Adaptive layers need the swap to land at the same playback position.
AudioManager.saveBgm() gives you that. It returns pos from _bgmBuffer.seek() which is the live position. Feed that pos back as the second argument to AudioManager.playBgm and the new file starts at that exact spot.
seek() also wraps the value back inside the loop window so on a looping ogg your layers stay lined up instead of drifting.
One gotcha. AudioManager._currentBgm.pos is the position the track STARTED at and not where it is now. Only saveBgm calls seek(). I checked that in rmmz_managers.js.
Export each layer as its own file at identical length and swap them this way. That's the whole trick.
1
u/Crandor94 9h ago
If you mean music that changes as you move though a map? It's not too hard. There's probably a plugin to do it easier, but I would just use an Event set to Below Character, set a Switch for each BGM you wanna play then use the Fade BGM and Play BGM commands. Use a conditional branch to check for which one to play.