Lomexi's Battle Theme Adjuster
Version 1.10 by Dean 'Lomexi' Lynch [mroan_brolli@hotmail.com]
Release Date: 6th April 2008
Version History 1.10
- Fixed a problem where the user was unable to continue new Map BGM after
a Boss Type Battle. (See: Possibilties)
- Fixed minor problem where the Battle Test window would not close after
the battle had ended.
- Fixed a problem where if the player escaped during a Boss Type Battle,
the BGM would continue. This was likely to be undesirable.
(See: Possibilties)
1.00
- Initial Release.
Features: - Turn Battle BGM and Victory ME ON or OFF.
- Able to continue with current (usually map) BGM throughout battles.
- Support for long Victory ME's. (Think Final Fantasy 7, 8, 9 and 10).
- If Battle BGM is off, yet Victory ME is on, the current BGM will continue
from where it paused after the Victory ME has finished.
- With a little imagination, you can give your battles a more atmospheric feel.
Possibilities: 1. Regular Battles
- These are battles; event processed or random encounters where both Battle
BGM and Victory ME play and continue back to map BGM.
Battle BGM Switch ON
Victory ME Switch ON
Map BGM Switch ON
2. Hurry! Battles
- These battles will have no Battle BGM or Victory ME. Instead, if the
user wishes, a bgm can be played and go un-disturbed until it needs to
end.
Battle BGM Switch OFF
Victory ME Switch OFF
Map BGM Switch OFF
3. Hurry! Battles #2
- These battles will play Victory ME but have no Battle BGM. The Hurry BGM
will play up untill Victory ME, then resume when the battle ends.
Battle BGM Switch OFF
Victory ME Switch ON
Map BGM Switch OFF
4. Boss Type Battle
- These are battles where the enemy BGM is played before the battle
processing event. This BGM will play all the way up untill the enemy
is defeated (Victory ME) or the player escapes.
Battle BGM Switch OFF
Victory ME Switch ON
Map BGM Switch ON
There are several other possibilities, these are just the ones that stick
out.
Important: - BY DEFAULT BOTH BATTLE BMG AND VICTORY ME ARE OFF. THIS IS TO AVOID
CONFUSION WHEN USING GAME SWITCHES.
- Changing default Battle BGM or Victory ME using game events will NOT
disrupt this script.
Instructions: - Place above main.
- Edit the config module to select which switches control the script.
- Switches are edited using game events.
- Please, play the demo and study the events for a clearer view on how this
script works.
Authors Notes: - This is my very first script. I consider myself a novice.
Demo:Demo!Script:CODE
#==============================================================================
# ¦ [RMVX] Lomexi's Battle Theme Adjuster
#------------------------------------------------------------------------------
# Version 1.10
# by Dean 'Lomexi' Lynch [mroan_brolli@hotmail.com]
# Release Date: 6th April 2008
#
# Version History:
# 1.10
# - Fixed a problem where the user was unable to continue new Map BGM after
# a Boss Type Battle. (See: Possibilties)
# - Fixed minor problem where the Battle Test window would not close after
# the battle had ended.
# - Fixed a problem where if the player escaped during a Boss Type Battle,
# the BGM would continue. This was likely to be undesirable.
# (See: Possibilties)
#
#
# 1.00
# - Initial Release.
#
# Features:
# - Turn Battle BGM and Victory ME ON or OFF.
# - Able to continue with current (usually map) BGM throughout battles.
# - Support for long Victory ME's. (Think Final Fantasy 7, 8, 9 and 10)
# - With a little imagination, can give your battles a more atmospheric feel.
# - If Battle BGM is off, yet Victory ME is on, the current BGM will continue
# from where it stopped after the Victory ME has finished.
#
# Possibilities:
# 1. Regular Battles
# - These are battles; event processed or random encounters where both Battle
# BGM and Victory ME play and continue back to map BGM.
# Battle BGM Switch ON
# Victory ME Switch ON
# Map BGM Switch ON
#
# 2. Hurry! Battles
# - These battles will have no Battle BGM or Victory ME. Instead, if the
# user wishes, a bgm can be played and go un-disturbed until it needs to
# end.
# Battle BGM Switch OFF
# Victory ME Switch OFF
# Map BGM Switch OFF
#
# 3. Hurry! Battles #2
# - These battles will play Victory ME but have no Battle BGM. The Hurry BGM
# will play up untill Victory ME, then resume when the battle ends.
# Battle BGM Switch OFF
# Victory ME Switch ON
# Map BGM Switch OFF
#
# 4. Boss Type Battle
# - These are battles where the enemy BGM is played before the battle
# processing event. This BGM will play all the way up untill the enemy
# is defeated (Victory ME) or the player escapes.
# Battle BGM Switch OFF
# Victory ME Switch ON
# Map BGM Switch ON
#
# There are several other possibilities, these are just the ones that stick
# out.
#
#
# Important:
# - BY DEFAULT BOTH BATTLE BMG AND VICTORY ME ARE OFF. THIS IS TO AVOID
# CONFUSION WHEN USING GAME SWITCHES.
# - Changing default Battle BGM or Victory ME using game events will NOT
# disrupt this script.
#
# Instructions:
# - Edit the config module to select which switches control the script.
# - Switches are edited using game events.
# - Please, play the demo and study the events for a clearer view on how this
# script works.
#
# Authors Notes:
# - This is my very first script. I consider myself a novice.
#==============================================================================
#==============================================================================
# Config Module
#==============================================================================
module THEME_CONFIG
BATTLE_BGM_SWITCH = 1 #Game switch to configure Battle BGM.
# Setting game switch ON plays Battle BGM defined under system in the Database.
VICTORY_ME_SWITCH = 2 #Game switch to configure Victory ME.
# Setting game switch ON plays Victory ME defined under system in the Database.
CONT_DEFAULT_MAP_BGM_SWITCH = 3 #Game switch to configure "New BGM".
# Setting game switch ON plays default Map BGM after a battle where the BGM was
# changed before the battle had started.
end
#==============================================================================
# Scene Map
#==============================================================================
class Scene_Map < Scene_Base
#============================================================================
# Call Battle
#============================================================================
def call_battle
@spriteset.update
Graphics.update
$game_player.make_encounter_count
$game_player.straighten
if $game_switches[THEME_CONFIG::BATTLE_BGM_SWITCH] == true
$game_temp.map_bgm = RPG::BGM.last
$game_temp.map_bgs = RPG::BGS.last
RPG::BGM.stop
RPG::BGS.stop
$game_system.battle_bgm.play
Sound.play_battle_start
$game_temp.next_scene = nil
$scene = Scene_Battle.new
else
$game_temp.map_bgm = RPG::BGM.last
$game_temp.map_bgs = RPG::BGS.last
Sound.play_battle_start
$game_temp.next_scene = nil
$scene = Scene_Battle.new
end
end
end
#==============================================================================
# Scene Battle
#==============================================================================
class Scene_Battle < Scene_Base
#============================================================================
# Battle End
#============================================================================
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
if $game_switches[THEME_CONFIG::BATTLE_BGM_SWITCH] == true
$game_temp.map_bgm.play
$game_temp.map_bgs.play
end
RPG::ME.fade(800)
$scene = Scene_Map.new
@message_window.clear
Graphics.fadeout(60)
RPG::ME.stop
end
$game_temp.in_battle = false
end
#============================================================================
# Battle Victory
#============================================================================
def process_victory
@info_viewport.visible = false
@message_window.visible = true
if $game_switches[THEME_CONFIG::VICTORY_ME_SWITCH] == true
if $game_switches[THEME_CONFIG::CONT_DEFAULT_MAP_BGM_SWITCH] == true
$game_map.autoplay
end
$game_temp.map_bgm = RPG::BGM.last
$game_system.battle_end_me.play
$game_temp.map_bgm.play
$game_temp.map_bgs.play
display_exp_and_gold
display_drop_items
display_level_up
battle_end(0)
else
display_exp_and_gold
display_drop_items
display_level_up
battle_end(0)
end
end
#============================================================================
# Process Escape
#============================================================================
def process_escape
@info_viewport.visible = false
@message_window.visible = true
text = sprintf(Vocab::EscapeStart, $game_party.name)
$game_message.texts.push(text)
if $game_troop.preemptive
success = true
else
success = (rand(100) < @escape_ratio)
end
Sound.play_escape
if success
wait_for_message
battle_end(1)
if $game_switches[THEME_CONFIG::CONT_DEFAULT_MAP_BGM_SWITCH] == true
$game_map.autoplay
end
else
@escape_ratio += 10
$game_message.texts.push('\.' + Vocab::EscapeFailure)
wait_for_message
$game_party.clear_actions
start_main
end
end
end
This post has been edited by CaptainWinky: Apr 6 2008, 08:41 AM