How to keep BMG changed in a man

shizuruteru

Villager
Member
Joined
Apr 4, 2020
Messages
9
Reaction score
0
First Language
english
Primarily Uses
RMMV
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.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
What 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.
 

ScorchedGround

Blizzards most disappointed fan
Veteran
Joined
Apr 12, 2020
Messages
331
Reaction score
482
First Language
German
Primarily Uses
RMMV
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.
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,526
Reaction score
1,418
First Language
English
Primarily Uses
RMMV
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.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
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.
 

shizuruteru

Villager
Member
Joined
Apr 4, 2020
Messages
9
Reaction score
0
First Language
english
Primarily Uses
RMMV
OK, thanks for the help.
 

Aesica

undefined
Veteran
Joined
May 12, 2018
Messages
1,526
Reaction score
1,418
First Language
English
Primarily Uses
RMMV
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.
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.)
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
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.
 

akoniti

Veteran
Veteran
Joined
Mar 4, 2020
Messages
85
Reaction score
64
First Language
English
Primarily Uses
RMMV
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' :LZSsmile:
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,882
Messages
1,017,230
Members
137,607
Latest member
Maddo
Top