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.

Don't stop the music when starting a battle

Zelos

Member

Is there any way to prevent the music from stopping when a battle begins?
What I wanted to do is making a small cutscene and start some music while the characters talk. After the scene the battle should start, and I want the same song to play, but not from the beginning.
Sure, I could just cut it, but the pause when the battle starts really sucks. Basically I just want to remove the Battle Start SE for that one battle. Setting it to none doesn't do what I want. Is there any way or do I need a script change for this?

edit: I'm using RPGXP.
 

poccil

Sponsor

To do this, edit the method call_battle in the Scene_Map class.  Put the following code in a new script section just before the last one.

Code:
class Scene_Map
  def call_battle
    $game_temp.battle_calling = false
    $game_temp.menu_calling = false
    $game_temp.menu_beep = false
    $game_player.make_encounter_count
    $game_temp.map_bgm = $game_system.playing_bgm
    if !$game_switches[10] # Change 10 to the switch for keeping current music
      $game_system.bgm_stop
    end
    $game_system.se_play($data_system.battle_start_se)
    if !$game_switches[10] # Change 10 to the switch for keeping current music
      $game_system.bgm_play($game_system.battle_bgm)
    end
    $game_player.straighten
    $scene = Scene_Battle.new
  end
end

Change 10 in the code above to the number of a switch to use for keeping the current music.

After installing the script, set switch 10 (or the switch number you chose) to ON before the battle.  You can set it to OFF after the battle is over.
 

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