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.

Help with making the map BGM carry over into battle.

Before anyone says anything! I've seen the current thread about it and it's not what I'm looking for!

Basically, I'd like to make it so I can turn a boolean on and off accordingly so that, depending on this, the map BGM music continues over the battle BGM/ME instead of it changing. I've already made it so it continues over all the time by, as suggested in an earlier thread, putting a "#" in front of 2 lines in Scene_Map.

However, I'd liek to make it so that this "phasing out" is conditional based on my setup. I tried to do as follows:

if $battle_music_switch = 1
$game_system.bgm_stop
# Play battle start SE
end
$game_system.se_play($data_system.battle_start_se)
if $battle_music_switch = 1
# Play battle BGM
$game_system.bgm_play($game_system.battle_bgm)
end

Then, on the map where I wished for the Map BGM to carry over I made it so the variable $battle_music_switch was = 0 in an autorun event on the map by selecting the Script Event Command and typing $battle_music_switch = 0.

I thought this would work but to no avail. Any ideas how I could accomplish this?
 
Figured it out. Needed to put if $battle_music_switch == 1 instead. Not sure why I need to put an additional == though but whatever the hell works!

And instead I put $game.switches[number] == true...just found that in another thread and thought it more appropriate.

Thanks anyways, can close this !
 
Aqueous;293138 said:
Figured it out. Needed to put if $battle_music_switch == 1 instead. Not sure why I need to put an additional == though but whatever the hell works!

And instead I put $game.switches[number] == true...just found that in another thread and thought it more appropriate.

Thanks anyways, can close this !

The reason for this is that in programming, writing x = y basically says the following: set x equal to y. The statement $battle_music_switch = 1 is not a boolean expression, what it's doing there is SETTING $battle_music_switch to 1. The correct way to denote "is x equal to y?" is the following (x == y). Just make sure you understand the distinction :)
 

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