Version: 1
Introduction
This script allows developers to set victory MEs depending on the value of a game variable. Useful if you want your project's victory ME changed when the player has progressed pretty far in the game.
Features
- Set variable ID and control victory MEs through the variable's value.
Screenshots
No screencaps.
Demo
No demo.
Script
Ruby:
<span style="color:#000080; font-style:italic;">=begin
<span style="color:#000080; font-style:italic;">╔══════════════════════════════════════════════════════════════════════════════╗
<span style="color:#000080; font-style:italic;">║ Variable-Based Battle Victory MEs ║
<span style="color:#000080; font-style:italic;">║ by PK8 ║
<span style="color:#000080; font-style:italic;">║ September 29th, 2009 ║
<span style="color:#000080; font-style:italic;">║ [url=http://rmvxp.com]http://rmvxp.com[/url] ║
<span style="color:#000080; font-style:italic;">╟──────────────────────────────────────────────────────────────────────────────╢
<span style="color:#000080; font-style:italic;">║ ■ Table of Contents ║
<span style="color:#000080; font-style:italic;">║ ├─ Author's Notes - Line 16─18 ║
<span style="color:#000080; font-style:italic;">║ ├─ Introduction & Description - Line 20─23 ║
<span style="color:#000080; font-style:italic;">║ ├─ Features - Line 25,26 ║
<span style="color:#000080; font-style:italic;">║ ├─ How to Use - Line 28─35 ║
<span style="color:#000080; font-style:italic;">║ ├─ Methods Aliased - Line 37,38 ║
<span style="color:#000080; font-style:italic;">║ └─ Thanks - Line 40─42 ║
<span style="color:#000080; font-style:italic;">╟──────────────────────────────────────────────────────────────────────────────╢
<span style="color:#000080; font-style:italic;">║ ■ Author's Notes ║
<span style="color:#000080; font-style:italic;">║ After working on Individual Troop Victory MEs, I wanted to work on this ║
<span style="color:#000080; font-style:italic;">║ script. I was pretty bored so yeah. ║
<span style="color:#000080; font-style:italic;">╟──────────────────────────────────────────────────────────────────────────────╢
<span style="color:#000080; font-style:italic;">║ ■ Introduction & Description ║
<span style="color:#000080; font-style:italic;">║ This script allows developers to set victory MEs depending on the value of a ║
<span style="color:#000080; font-style:italic;">║ game variable. Useful if you want your project's victory ME changed when the ║
<span style="color:#000080; font-style:italic;">║ player has progressed pretty far in the game. ║
<span style="color:#000080; font-style:italic;">╟──────────────────────────────────────────────────────────────────────────────╢
<span style="color:#000080; font-style:italic;">║ ■ Features ║
<span style="color:#000080; font-style:italic;">║ ─ Set variable ID and control victory MEs through the variable's value. ║
<span style="color:#000080; font-style:italic;">╟──────────────────────────────────────────────────────────────────────────────╢
<span style="color:#000080; font-style:italic;">║ ■ How to Use ║
<span style="color:#000080; font-style:italic;">║ Varba_Victory_Var: Set game variable ID. ║
<span style="color:#000080; font-style:italic;">║ ║
<span style="color:#000080; font-style:italic;">║ Varba_Victory[variable id value] = ["file", volume, pitch] ║
<span style="color:#000080; font-style:italic;">║ ^ Sets victory ME based on the value of the variable ID. ║
<span style="color:#000080; font-style:italic;">║ ║
<span style="color:#000080; font-style:italic;">║ Note: If you're using Individual Troop Victory MEs, please paste this script ║
<span style="color:#000080; font-style:italic;">║ above it. It's so Individual Troop Victory MEs can override this script║
<span style="color:#000080; font-style:italic;">╟──────────────────────────────────────────────────────────────────────────────╢
<span style="color:#000080; font-style:italic;">║ ■ Methods Aliased ║
<span style="color:#000080; font-style:italic;">║ ─ start_phase5 of Scene_Battle ║
<span style="color:#000080; font-style:italic;">╟──────────────────────────────────────────────────────────────────────────────╢
<span style="color:#000080; font-style:italic;">║ ■ Thanks ║
<span style="color:#000080; font-style:italic;">║ ─ If it weren't for JoeYoung's original request, I wouldn't have worked on ║
<span style="color:#000080; font-style:italic;">║ this script. ║
<span style="color:#000080; font-style:italic;">╚══════════════════════════════════════════════════════════════════════════════╝
<span style="color:#000080; font-style:italic;">=end
#------------------------------------------------------------------------------
# * Customise
#------------------------------------------------------------------------------
class PK8
Varba_Victory = {} # Do not touch this.
Varba_Victory_Var = 2 # Set variable ID.
# The value of PK8::Varba_Victory_Var controls the battle theme.
# [id] = [Music File, Volume, Pitch]
Varba_Victory[1] = ["002-Victory02", 100, 100]
Varba_Victory[2] = ["003-Victory03", 100, 100]
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
alias_method(:pk8_var_battle_victoryme_start_phase_5, :start_phase5)
def start_phase5
pk8_var_battle_victoryme_start_phase_5
start_var_battle_victoryme
end
#----------------------------------------------------------------------------
# * Start Troop Victory
#----------------------------------------------------------------------------
def start_var_battle_victoryme
PK8::Varba_Victory.each_key { | i |
# If Variable ID value equals the key.
if $game_variables[PK8::Varba_Victory_Var] == i
if PK8::Varba_Victory[i][0] != nil and !PK8::Varba_Victory[i][0].empty?
# Sets ME volume to 100 if nil.
PK8::Varba_Victory[i][1] = 100 if PK8::Varba_Victory[i][1] == nil
# Sets ME pitch to 100 if nil.
PK8::Varba_Victory[i][2] = 100 if PK8::Varba_Victory[i][2] == nil
# Plays ME.
Audio.me_play("Audio/ME/#{PK8::Varba_Victory[i][0]}",
PK8::Varba_Victory[i][1], PK8::Varba_Victory[i][2])
end
break
end }
end
end
Instructions
Instructions are in the script.
FAQ
Awaiting question.
Compatibility
Aliases start_phase5 of Scene_Battle.
Credits and Thanks
If it weren't for JoeYoung's original request, I wouldn't have made this script.
Author's Notes
After working on Individual Troop Victory MEs, I wanted to work on this script. I was pretty bored so yeah.
Terms and Conditions
Credit me. :3