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.

BGM -> Battle?

How can I make it so that the current BGM plays even during battles in a place without the track starting over? I know how to do it normally (change Battle BGM) but that causes the track to start again when the battle starts/ends. I would like to know how to do it so that the track plays normally, from map screen, through the battle transition, and then through the battle.

This is on RMVX btw.
 
I believe a lot of people have asked this question before.

I'm no scripter, but I think trying to do something like that would take a lot of work. It sounds pretty simple, but I've heard that it can get pretty complicated, and I don't think anyone's done it before. Correct me if I'm wrong here, but I don't know if it's even possible.

Of course, you'd need an actual person who scripts to tell you. Anyway, if you do find someone who can help you, let me know, because I'd like to have this as well!  :smile:
 

poccil

Sponsor

In RPGVX, edit the call_battle method of Scene_Map and the process_victory method of Scene_Map. Put the following code in a new script section, after all other scripts in the Materials section.  Change the 10 below to the number of a switch to use.

Code:
class Scene_Map
  def call_battle
    @spriteset.update
    Graphics.update
    $game_player.make_encounter_count
    $game_player.straighten
    $game_temp.map_bgm = RPG::BGM.last
    $game_temp.map_bgs = RPG::BGS.last
    # Change 10 to any switch number
    if !$game_switches[10]
      RPG::BGM.stop
    end
    RPG::BGS.stop
    Sound.play_battle_start
    # Change 10 to any switch number
    if !$game_switches[10]
      $game_system.battle_bgm.play
    end
    $game_temp.next_scene = nil
    $scene = Scene_Battle.new
  end
end
class Scene_Battle
  def process_victory
    @info_viewport.visible = false
    @message_window.visible = true
    if !$game_switches[10]
      RPG::BGM.stop
      $game_system.battle_end_me.play
      unless $BTEST
        $game_temp.map_bgm.play
        $game_temp.map_bgs.play
      end
    else
      unless $BTEST
        $game_temp.map_bgs.play
      end
    end
    display_exp_and_gold
    display_drop_items
    display_level_up
    battle_end(0)
  end
end

After installing the script, set switch 10 (or the switch number you chose) to ON.  As long as that switch is ON, the currently playing music will linger during and after a battle.  (The battle end ME will be suppressed as well.  If this is not desired, move the line "$game_system.battle_end_me.play" just above the line "if !$game_switches[10]" near it.)
 

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