MZ Different Battle BGM depending on map or Troop

I really can't believe there is nothing like this out there.

It would be really cool to have a plugin that changes the battle BGM depending on a comment on either the map or the troop. So that when you are in a map in the sky for example battles have different bgm than in a level that is a volcano.

It's inconvenient to have to change bgm with an event so that when you leave the map it doesnt change it to every battle in different maps. you have to make sure you don't mess up or the player doesn't leave the map without changing the bgm.
You don't need a plugin for this, it is easily done with troop events. Make a Turn 0 troop event:
1) If you want the music based on the troop, just use the event command on tab 2, Play BGM.
2) If you want the music based on the map, do a Conditional Branch -> tab 4 Script -> $gameMap._mapId==X where X is the ID of the map, then add the same BGM command.

You can do as many conditionals as you want to have customized map music, and when you've done this once, you can simply copy and paste it between troops.

It's inconvenient to have to change bgm with an event so that when you leave the map it doesnt change it to every battle in different maps. you have to make sure you don't mess up or the player doesn't leave the map without changing the bgm.
Sorry, I just don't understand what you're saying here. If you have a BGM defined in your map properties, it will always automatically return to that when your battle is done, you don't have to make sure of anything.
it doesn't change immediately, you can listen to the first notes of the default before it changes to the other one.
Then just make the default blank in your database and include it in your troop event instead, after any conditionals. That's how I have several random battle themes in my game instead of one default.
You don't need a plugin for this, it is easily done with troop events. Make a Turn 0 troop event:
The BGM is initiated before the troop event fires.
The BGM is initiated before the troop event fires.
I think you typed this as I was writing my last response 🙂
ill try it 😛 thx

I tried again. I made sure the event was being written on turn 0.

i swear it doenst start immediately. It does 1 second of default bgm and then it stops. then it loads the song and starts after like 1 second

It could be a battle plugin interference maybe? the default song is played as the actors take their places on the field, then it changes.
It could be a battle plugin interference maybe? the default song is played as the actors take their places on the field, then it changes.
Read my last post again. You should not have any default song.
battle.png

The system cannot play what it doesn't have.

Your troop event will look something like this:
Code:
Conditional Branch -> map is your volcano
    Play BGM: the BGM you want in your volcano
end
Conditional Branch -> map is your unicorn pasture
    Play BGM: the BGM you want in your unicorn pasture
end
Play BGM: whatever you want the default for this troop to be
Ok that would definitely solve the issue. there would be a small delay but it would definitely solve the problem
there would be a small delay but it would definitely solve the problem
I guess? I don't notice any delay in my game, but then I did this almost as soon as I started on the project so I don't have a point of reference for when the default BGM is usually called.

Original thread: https://forums.rpgmakerweb.com/threads/different-battle-bgm-depending-on-map-or-troop.140202/