Im looking for a way to change the music of a map permanently. if I use the change BMG command, the music turned back to the default one every time the map is reset.
How to keep BMG changed in a man
RPG Maker MV SupportWhat I do is I use a parallel process on the map to set the BGM for the map overall, and not the map properties. Then I use a switch or variable and a conditional branch to tell the engine which one to play.
Just be sure to end your parallel process with erase event, so it doesn't loop all of the time.
Just be sure to end your parallel process with erase event, so it doesn't loop all of the time.
As @bgillisp said, you probably want to create a "initialization" event somewhere on your map (preferably outside of the play-area) and set it to parallel process or even autorun.
I use these on all my maps to configure Map BGM, Battle BGM, Map Tint, various dynamic switches/variables etc.
That way you can create multiple pages on said "initialization" event to execute different functions depending on which page is active.
I use these on all my maps to configure Map BGM, Battle BGM, Map Tint, various dynamic switches/variables etc.
That way you can create multiple pages on said "initialization" event to execute different functions depending on which page is active.
I find initialization events (autorun once, then erase self) extremely useful in just about every map for things like this as well as many other functions. It's worth getting into the habit of using them.
I should point out one difference many do not know here:
Parallel process: Runs before the map is fully loaded.
Autorun: Runs after the map is fully loaded.
Using an autorun could introduce a (very) short delay in your music playing due to that.
Parallel process: Runs before the map is fully loaded.
Autorun: Runs after the map is fully loaded.
Using an autorun could introduce a (very) short delay in your music playing due to that.
OK, thanks for the help.
Well crap, now I'm going to have to go through all my initializer events to change this. Gee thanks a lot! 🙁
(No but really, thanks for the heads up on that. I wouldn't have suspected it, but I'm also not surprised by such a quirk.)
It might not really matter, I think the difference is like maybe 1 frame if that unless things are slow to load. I'd probably leave it unless you notice an odd delay.
Thanks for the info on the order of operations for parallel versus autorun @bgillisp, that's useful. Sometimes even a second delay can be jarring.
I use a parallel process for this as well- I like that approach because it enables you to easily have several BGM pieces queued up in the event, then have them play based on a switch at certain times throughout the arc of the game. I always name the event 'Jukebox'
I use a parallel process for this as well- I like that approach because it enables you to easily have several BGM pieces queued up in the event, then have them play based on a switch at certain times throughout the arc of the game. I always name the event 'Jukebox'

Original thread: https://forums.rpgmakerweb.com/threads/how-to-keep-bmg-changed-in-a-man.124742/