Is it Possible to Make Enemy Specific BGM?

Hey, I was wondering if there is some hidden setting that allows BGM to change to the random encounter ID? The desired effect is just having enemy specific music. I'd rather the butterflies not have the same battle music as the wolves. :')

Could I somehow make it location dependent as well? Like battles at the beginning half of the forest have certain music and battles at the back half of the forest have different music?

If you can't, is there some script anyone would be willing to point me in the direction of?
Location specific music you can simply set when entering a map using event command System Settings >>> Change Battle BGM on an autorun event.

As for troop specific BGM for random encounters... without a plugin I would suggest to have the default Battle BGM set to nothing and change it with troop events (EDIT: just use Play BGM)?
@werzaque that is not enough to work, because the battle bgm is a map property.
changing that property will not change the music directly as the engine only reads the bgm property on battlestart.

you'll need a script command to force the engine to update the battle bgm during battle (even if it is done on turn 0).
Unfortunately I don't know that command for MZ...
Hmmm?

That’s strange I think I have it implemented that way for boss battles… let me check.

EDIT: okay thanks for pointing that out, I checked my project and it's not "change battle bgm", it's simply "play bgm".

@Mr-Kangaroo so to summarize:

Location specific BGM: use Change Battle BGM upon map (or region) entry
Troop specific BGM: have a default Battle BGM of none, and use "Play BGM" at Turn 0 to play the BGM of your choice. Note that because this will play the BGM at turn 0, there will be a slight delay before the music starts playing.
Yeah, you don't need a script command for it, Play BGM is one of the regular event commands.

You would do exactly what @werzaque said - don't define the Battle Music in your database.

Then put a Turn 0 troop event into every troop that plays the music you want. That lets you have different boss music, randomize the music, etc.
@werzaque is correct: the override provided by Change Battle BGM persists for the rest of the playthrough. Reset to default with Change Battle BGM: (None). It does require you to run the command before battle starts, but as mentioned, that's OK for a location-specific setting or any battle started via event command.

A Play BGM command in a Turn 0 troop event will work, but it will only run after the opening messages (e.g. "Chicken has emerged!") are done.
A Play BGM command in a Turn 0 troop event will work, but it will only run after the opening messages (e.g. "Chicken has emerged!") are done.
I frankly forget that some people actually keep those 🤣
A Play BGM command in a Turn 0 troop event will work, but it will only run after the opening messages (e.g. "Chicken has emerged!") are done.
There indeed is a noticeable delay even without the "Chicken has emerged!" message.

I frankly forget that some people actually keep those
This got me searching and I frankly can't find where to turn it back on lol
There indeed is a noticeable delay even without the "Chicken has emerged!" message.
I think it's only noticeable with a point of comparison. This is how I'm implementing it in my project and I've never had a playtester share the feedback "battle music takes a long time to start" 😉

But either way is definitely viable.

This got me searching and I frankly can't find where to turn it back on lol
It's probably turned off in a battle engine or something that you're using. I have Yanfly's Battle Engine Core with Show Emerge Text off.
I have Yanfly's Battle Engine Core with Show Emerge Text off.
Thanks, there it is indeed. I was searching under Battle Log Settings.
I feel about 72.847% certain that someone released a MZ plugin for troop specific BGMs on this forum. It's not convenient for me to go searching for it right now, but I suspect that you can find it if you try.
@Arthran That is a very specific and very obscure degree of specificity.

Yes, I did make this post just to write the word "specificity." Ooh! I did it again! It makes me tingle. 😂
@Arthran That is a very specific and very obscure degree of specificity.

Yes, I did make this post just to write the word "specificity." Ooh! I did it again! It makes me tingle. 😂
My specificity has indeed been known to be rather specific now and again.
Thanks guys. I'm going to like this community.
Alright, so the solution sort of worked. But now when the encounter happens the music doesn't start until "Turn 0". It sort of takes away from the "encounter" aspect of the whole ordeal. Is there any way to get the music to start at the same time as the encounter? AKA before Turn 0?
Alright, so the solution sort of worked. But now when the encounter happens the music doesn't start until "Turn 0". It sort of takes away from the "encounter" aspect of the whole ordeal. Is there any way to get the music to start at the same time as the encounter? AKA before Turn 0?
Presumably by using the plugin that I previously mentioned.
Is there any way to get the music to start at the same time as the encounter? AKA before Turn 0?
1. Most verstatile: as @Arthran mentions, plugin
2. If you want to push the limits of vanilla MZ without resorting to plugins (something I can very much appreciate): have a short run-in sound (da-da-da-DAAAH... fade out) and set it to the default battle bgm.
Thanks, I'm going to upload a picture of the starting forest I made as well, I don't think I'm too great at map making so I'm willing to absorb all the tips I can. I think the town music actually fits the forest theme pretty well.

:')

Original thread: https://forums.rpgmakerweb.com/threads/is-it-possible-to-make-enemy-specific-bgm.161461/