Save-Point
Ending Battle Music Fix - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Archives (https://www.save-point.org/forum-105.html)
+--- Forum: Creation Asylum Archives (https://www.save-point.org/forum-90.html)
+---- Forum: Scripts & Code Snippets (https://www.save-point.org/forum-92.html)
+----- Forum: RPG Maker XP Code (https://www.save-point.org/forum-93.html)
+------ Forum: Enhancement/Modification Scripts (https://www.save-point.org/forum-98.html)
+------ Thread: Ending Battle Music Fix (/thread-6552.html)



Ending Battle Music Fix - Sephirothtds - 05-11-2007

Ending Battle Music Fix
by Sephirothtds
May 11 2007

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Well this is a small fix to an annoying thing RPG Maker XP does when battles ends.

This script stops map music from begining while you are viewing the result window at the end of the battle.

Code:
#==============================================================================
# TDS End Battle Music Fix
# Version: 1.0
# This script aliases the start_phase5 method and the update_phase5 method of
# Scene_Battle (part 2).
#==============================================================================
#------------------------------------------------------------------------------
# This script stops map music from begining after the winning sound completes
# playing.
#==============================================================================

#==============================================================================
# ** Scene_Battle (part 2)
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Start After Battle Phase
  #--------------------------------------------------------------------------
  alias tds_music_fix_start_phase5 start_phase5
  def start_phase5
    tds_music_fix_start_phase5
    # Stops Playing Audio
    Audio.bgm_stop    
  end
  #--------------------------------------------------------------------------
  # * Frame Update (after battle phase)
  #--------------------------------------------------------------------------
  alias tds_music_fix_update_phase5 update_phase5  
  def update_phase5  
   tds_music_fix_update_phase5
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Battle ends
      battle_end(0)
      # Return to BGM before battle started
      $game_system.bgm_play($game_temp.map_bgm)      
    end  
  end
end