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 BM on vx

e

Sponsor

In RMVX, open up the script editor and select the script Scene_Map.

On line 214 (provided you haven't added any other scripts), or in the method def call_battle, you'll see:

Code:
RPG::BGM.stop

Simply comment out the line.

The resulting method would be :

Code:
  #--------------------------------------------------------------------------
  # * Switch to Battle Screen
  #--------------------------------------------------------------------------
  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
    #RPG::BGM.stop
    RPG::BGS.stop
    Sound.play_battle_start
    #$game_system.battle_bgm.play
    $game_temp.next_scene = nil
    $scene = Scene_Battle.new
  end

That'll make it so the BGM will not stop in between the battle and the map.

Then you'll notice another line is commented out :

Code:
$game_system.battle_bgm.play

That would start the battle BGM, but since you want it to be the same, then obviously it shouldn't be re-started.
 
thanks alot  :grin:. not trying to be picky ><' but i noticed that the music loops after a battle scene, sry new to codeing Dxx.

I tried commenting out the

        $game_temp.map_bgm.play
        $game_temp.map_bgs.play
In End battle, in the scene_battle script
 

e

Sponsor

What do you mean it loops? Like you win, it plays the victorious battle sound, and then when you go back to the map it restarts?

To fix this, you'll need to open up the script editor, and in the script Scene_Battle, find :
Code:
#--------------------------------------------------------------------------
  # * End Battle
  #     result : Results (0: win, 1: escape, 2:lose)
  #--------------------------------------------------------------------------
  def battle_end(result)
    if result == 2 and not $game_troop.can_lose
      call_gameover
    else
      $game_party.clear_actions
      $game_party.remove_states_battle
      $game_troop.clear
      if $game_temp.battle_proc != nil
        $game_temp.battle_proc.call(result)
        $game_temp.battle_proc = nil
      end
      unless $BTEST
        $game_temp.map_bgm.play
        $game_temp.map_bgs.play
      end
      $scene = Scene_Map.new
      @message_window.clear
      Graphics.fadeout(30)
    end
    $game_temp.in_battle = false
  end

See the line :

Code:
$game_temp.map_bgm.play

Comment it out by adding a # in front.

Then you'll need to find the method Victory Processing and replace it with :

Code:
#--------------------------------------------------------------------------
  # * Victory Processing
  #--------------------------------------------------------------------------
  def process_victory
    @info_viewport.visible = false
    @message_window.visible = true
    #RPG::BGM.stop
    RPG::BGM.last.volume = 0
    $game_system.battle_end_me.play
    unless $BTEST
      #$game_temp.map_bgm.play
      RPG::BGM.last.volume = 100
      $game_temp.map_bgs.play
    end
    display_exp_and_gold
    display_drop_items
    display_level_up
    battle_end(0)
  end

Basically, I commented out the BGM's stop execution so that it won't stop; instead, I set the volume to 0 (so it doesn't interfere with the battle won sound) and once that's done, I set it back to 100. In theory, it shouldn't loop.
 
etheon":2btkscof said:
What do you mean it loops? Like you win, it plays the victorious battle sound, and then when you go back to the map it restarts?

To fix this, you'll need to open up the script editor, and in the script Scene_Battle, find :
Code:
#--------------------------------------------------------------------------
  # * End Battle
  #     result : Results (0: win, 1: escape, 2:lose)
  #--------------------------------------------------------------------------
  def battle_end(result)
    if result == 2 and not $game_troop.can_lose
      call_gameover
    else
      $game_party.clear_actions
      $game_party.remove_states_battle
      $game_troop.clear
      if $game_temp.battle_proc != nil
        $game_temp.battle_proc.call(result)
        $game_temp.battle_proc = nil
      end
      unless $BTEST
        $game_temp.map_bgm.play
        $game_temp.map_bgs.play
      end
      $scene = Scene_Map.new
      @message_window.clear
      Graphics.fadeout(30)
    end
    $game_temp.in_battle = false
  end

See the line :

Code:
$game_temp.map_bgm.play

Comment it out by adding a # in front.

Then you'll need to find the method Victory Processing and replace it with :

Code:
#--------------------------------------------------------------------------
  # * Victory Processing
  #--------------------------------------------------------------------------
  def process_victory
    @info_viewport.visible = false
    @message_window.visible = true
    #RPG::BGM.stop
    RPG::BGM.last.volume = 0
    $game_system.battle_end_me.play
    unless $BTEST
      #$game_temp.map_bgm.play
      RPG::BGM.last.volume = 100
      $game_temp.map_bgs.play
    end
    display_exp_and_gold
    display_drop_items
    display_level_up
    battle_end(0)
  end

Basically, I commented out the BGM's stop execution so that it won't stop; instead, I set the volume to 0 (so it doesn't interfere with the battle won sound) and once that's done, I set it back to 100. In theory, it shouldn't loop.




Awsome xDDD it works thank you so much
 

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