Override Change BGM/ME
Version: 1.0
Author: modern algebra
Date: July 12, 2010
Version History
- <Version 1.0> 07.12.2010 - Original Release
Description
This script will override the BGM or ME changes when you activate chosen switches. This is useful, for instance, if for a boss battle you want to start the battle music early and have it directly continue into the battle or if, for a certain battle where the enemy escapes after the battle, you don't want the Victory ME played.
It will also override bgm and me changes through event commands (since you can always turn the switch off immediately beforehand if you don't want it to apply), but it will not override BGMs or MEs in the Gameover scene, as I figure you would not have the opportunity to turn the switches if actors die in battle.
Features
- Allows you to prevent the BGM from changing when going into or out of battle by turning on an in-game switch
- Allows you to prevent MEs from playing by turning on an in-game switch
- Allows you to choose which switches control the above features
Instructions
The script is very easy to use. Simply paste it into its own slot above Main and below other default or custom scripts. Then, go to lines 48 and 49 to select which switches you want to use to prevent the BGM from changing or to prevent new MEs from playing, respectively. Then when you want to prevent the BGM from changing, simply turn the switch with the ID you chose on. To allow it to change again, turn that switch off. Same thing for preventing MEs from playing.
Script
#==============================================================================
# Override Change BGM/ME
# Version: 1.0
# Author: modern algebra (rmrk.net)
# Date: July 12, 2010
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
#
# This script will override the BGM or ME changes when you activate chosen
# switches. This is useful, for instance, if for a boss battle you want to
# start the battle music early and have it directly continue into the battle
# or if, for a certain battle where the enemy escapes after the battle, you
# don't want the Victory ME played.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Instructions:
#
# The script is very easy to use. Simply paste it into its own slot above
# Main and below other default or custom scripts. Then, go to lines 48 and 49
# to select which switches you want to use to prevent the BGM from changing
# or to prevent new MEs from playing, respectively. Then when you want to
# prevent the BGM from changing, simply turn the switch with the ID you chose
# on. To allow it to change again, turn that switch off. Same thing for
# preventing MEs from playing.
#==============================================================================
#==============================================================================
# *** RPG
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new constant - OVERRIDE_BGM_SWITCH_ID, OVERRIDE_ME_SWITCH_ID
# modified class - BGM
# aliased methods - self.stop, self.fade, play
# modified class - ME
# aliased method - play
#==============================================================================
module RPG
#==========================================================================
# Configuration
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# OVERRIDE_BGM_SWITCH_ID - set this to the ID of the switch that you
# want to use to prevent the BGM from changing.
# OVERRIDE_ME_SWITCH_ID - set this to the ID of the switch that you
# want to use to prevent MEs from playing
#
# Note that for both of theses it is the ID of the switch you want to use,
# so if it is 1, then turning the in-game switch with ID 1 on or off will
# turn that feature on or off.
#==========================================================================
OVERRIDE_BGM_SWITCH_ID = 1
OVERRIDE_ME_SWITCH_ID = 2
#==========================================================================
# ** BGM
#==========================================================================
class BGM
# ALiases
unless self.method_defined? (:odrna_mscovrde_ply_7uj2)
class << self
alias malgr_bgmovrid_stp_5th2 stop
alias maa_ovrridebgm_fde_2rt9 fade
end
alias odrna_mscovrde_ply_7uj2 play
end
class << self
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Stop
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def stop (*args)
malgr_bgmovrid_stp_5th2 (*args) unless $game_switches && $game_switches[OVERRIDE_BGM_SWITCH_ID] && !$scene.is_a? (Scene_Gameover)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Fade
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def fade (*args)
maa_ovrridebgm_fde_2rt9 (*args) unless $game_switches && $game_switches[OVERRIDE_BGM_SWITCH_ID] && !$scene.is_a? (Scene_Gameover)
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Play
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def play (*args)
odrna_mscovrde_ply_7uj2 (*args) unless $game_switches && $game_switches[OVERRIDE_BGM_SWITCH_ID] && !$scene.is_a? (Scene_Gameover)
end
end
#==========================================================================
# ** ME
#==========================================================================
class ME
# Aliases
unless self.method_defined? (:modrna_rideme_play_6fv1)
alias modrna_rideme_play_6fv1 play
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Play
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def play (*args)
modrna_rideme_play_6fv1 (*args) unless $game_switches && $game_switches[OVERRIDE_ME_SWITCH_ID] && !$scene.is_a? (Scene_Gameover)
end
end
end
Credit
Thanks
- Kail200x, for the request
Support
Please post in this topic at RMRK for support. Do not PM me, as then other people can't benefit from the answers.
Known Compatibility Issues
No known compatibility issues.