Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Battle BGM Changing with Map

How do you change the background music of a battle scene according to the map you are in?  Like say a certain .mp3 plays when you're fighting on a beach, but a different battle music plays when you're on the mountains?
 
Use the command "Change Battle BGM" and change music whenever you are transferred to another map. For example, in the event that transfers the player from the beach to the mountains, you would add that command in.
 

Kraft

Sponsor

that or you could get really techincal and use variables that check the map ID of the player every couple seconds and if it is such and such, use so and so music, and if not, use that music... etc... in a parallel process event.

Thats just me though...  I peresonally generally like doing things like that because a lot of times I will forget to put things like that in the events that teleport the player and then it messes up XD
 
Kraft, your idea is what I need because what if the player goes to the mountains and the beach battle music plays?  Not really contextually appropriate I say.  Do you know how to do it?
 
Kraft's method is probably easier to organize, but will take a lot more time because once you make a lot of maps, you'll have to check every single ID just for a song (e.g. if you have 10 beach maps, you'll have to do 10 conditional branches). But it's your choice which method you want to use.

If you're going for Kraft's, create a Common Event and set it to Parallel Processing. Set the Trigger to any switch and turn that switch on at the beginning of the game.

Now, in the common event, use the command "Control Variables" and assign an unused variable to "Other- Map ID". Now create a Conditional Branch that checks if that variable is equal to 1. Let's say Map ID1 is a beach map, so use the command "Change Battle BGM: Beach.mp3".

Now you'll have to keep making Conditional Branches. Check if the variable is equal to every single map ID you've made, and then change the song to fit the setting. Copy-pasting and editing the numbers will help here. Once you're done, you can add a "Wait: x frames" to help lower lag.

Good luck with it jjangjae! :thumb:
 
Thanks I really appreciate it.  Work isn't much of a problem.  The database was hell to finish.  And because I appreciate you guys' help so much.  I think I'm going to put your names in the credits.
 
However, is it possible to have the conditional branch have an "else if" statement?  I know for sure that you can in C++ because I've been doing it for a while but can you for RPG Maker?
 
Yeah, by default the bottom box labeled "Set handling when conditions do not apply" should be checked. When you finish the command, there should be two branches, one for if conditions apply and one for "else".
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top