@Bearcat
Ok to merge any command adding scripts with this I'll use this as an example
delete the code in
red take note of the code in
blue
#==============================================================================
# â—â— Simple Escape Command
#------------------------------------------------------------------------------
# Trickster ([email hidden])
# Version 1.0
# Date 4/2/07
# Goto rmxp.org for updates/support/bug reports
#------------------------------------------------------------------------------
# This script adds an Escape Command to the Battle Commands and when used
# It escapes from battle. Also removes the Attack Escape Window in battle (phase2)
#==============================================================================
#--------------------------------------------------------------------------
# Begin SDK Log
#--------------------------------------------------------------------------
SDK.log('Simple Escape Command', 'Trickster', 1.0, '4/2/07')
#--------------------------------------------------------------------------
# Begin SDK Requirement Check
#--------------------------------------------------------------------------
SDK.check_requirements(2.0, [1, 2, 3, 4])
#--------------------------------------------------------------------------
# Begin SDK Enabled Check
#--------------------------------------------------------------------------
if SDK.enabled?('Simple Escape Command')
class Scene_Battle
[COLOR=Red]#--------------------------------------------------------------------------
# * Main Window Delete anything in this method about the @actor_command_window since everything is about the command window delete the whole thing
#--------------------------------------------------------------------------
alias_method :trick_escape_battle_main_window, :main_window
def main_window
# The Usual
trick_escape_battle_main_window
# Get Commands
commands = @actor_command_window.commands.dup
# Push Escape
commands << SDK::Scene_Commands::Scene_Battle::Escape
# Push Escape
@actor_command_window.commands = commands
end
[/COLOR]
#--------------------------------------------------------------------------
# * Start Party Command Phase
#--------------------------------------------------------------------------
alias_method :trick_escape_battle_start_phase2, :start_phase2
def start_phase2
# The Usual
trick_escape_battle_start_phase2
# Disable party command window
@party_command_window.active = false
@party_command_window.visible = false
# Start Phase 3
start_phase3
end
[COLOR=Red]#--------------------------------------------------------------------------
# * Command : Escape Not needed see the code in blue for the alternative
#--------------------------------------------------------------------------
def update_phase3_command_escape
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Set action
@active_battler.current_action.kind = [COLOR=Blue]0[/COLOR]
@active_battler.current_action.basic = [COLOR=Blue]2[/COLOR]
# Go to command input for next actor
[COLOR=Blue]phase3_next_actor[/COLOR]
end[/COLOR]
[COLOR=Red]#--------------------------------------------------------------------------
# * Check Commands 99% of the time edits to this method are not needed so just delete it
#--------------------------------------------------------------------------
alias_method(:trick_escape_battle_phase3_basic_command_input,
:phase3_basic_command_input)
def phase3_basic_command_input
# Return if no active battler
return if @active_battler == nil
# Call Original
trick_escape_battle_phase3_basic_command_input
# Loads Current Command
command = @actor_command_window.command
# Run Escape if command is escape
if command == SDK::Scene_Commands::Scene_Battle::Escape
update_phase3_command_escape
end
end[/COLOR]
#--------------------------------------------------------------------------
# * Make Basic Action Results
#--------------------------------------------------------------------------
alias_method(:trick_escape_battle_make_basic_action_result,
:make_basic_action_result)
def make_basic_action_result
# The Usual
trick_escape_battle_make_basic_action_result
# If escape
if (@active_battler.is_a?(Game_Actor) and
@active_battler.current_action.basic == 2)
make_basic_action_result_escape
return
end
end
#--------------------------------------------------------------------------
# * Make Basic Action Results - Escape
#--------------------------------------------------------------------------
def make_basic_action_result_escape
# Setup Agi and number
enemies_agi, enemies_number = 0, 0
# Run Through Each Enemy
$game_troop.enemies.each do |enemy|
# Skip if non-existant
next if not enemy.exist?
# Add Agi
enemies_agi += enemy.agi
# Increase Number
enemies_number += 1
end
# Calculate enemy agility average
enemies_agi /= enemies_number.to_f if enemies_number > 0
# Setup Agi and number
actors_agi, actors_number = 0, 0
# Run Through Each Actor
$game_party.actors.each do |actor|
# Skip if non-existant
next if not actor.exist?
# Add Agi
actors_agi += actor.agi
# Increase Number
actors_number += 1
end
# Calculate actor agility average
actors_agi /= actors_number.to_f if actors_number > 0
# Get Chance
chance = 50 * actors_agi / enemies_agi if @active_battler.is_a?(Game_Actor)
chance = 50 * enemies_agi / actors_agi if @active_battler.is_a?(Game_Enemy)
# Determine if escape is successful
success = rand(100) < chance
# If Actor
if @active_battler.is_a?(Game_Actor)
# If escape is successful and possible to escape
if success and $game_temp.battle_can_escape
# Play escape SE
$game_system.se_play($data_system.escape_se)
# Return to BGM before battle started
$game_system.bgm_play($game_temp.map_bgm)
# Battle ends
battle_end(1)
# If escape is failure
else
# Display Cannot Escape
@help_window.set_text('Cannot Escape', 1)
end
# If Enemy
else
# If Escape is successful
if success
# Display "Escape" in help window
@help_window.set_text('Escape', 1)
# Escape
@active_battler.escape
else
# Escape Failed
@phase4_step = 1
end
end
end
end
#--------------------------------------------------------------------------
# End SDK Enabled Check
#--------------------------------------------------------------------------
end
Expand to see the code.
already deleted version
#==============================================================================
# â—â— Simple Escape Command
#------------------------------------------------------------------------------
# Trickster ([email hidden])
# Version 1.0
# Date 4/2/07
# Goto rmxp.org for updates/support/bug reports
#------------------------------------------------------------------------------
# This script adds an Escape Command to the Battle Commands and when used
# It escapes from battle. Also removes the Attack Escape Window in battle (phase2)
#==============================================================================
#--------------------------------------------------------------------------
# Begin SDK Log
#--------------------------------------------------------------------------
SDK.log('Simple Escape Command', 'Trickster', 1.0, '4/2/07')
#--------------------------------------------------------------------------
# Begin SDK Requirement Check
#--------------------------------------------------------------------------
SDK.check_requirements(2.0, [1, 2, 3, 4])
#--------------------------------------------------------------------------
# Begin SDK Enabled Check
#--------------------------------------------------------------------------
if SDK.enabled?('Simple Escape Command')
class Scene_Battle
#--------------------------------------------------------------------------
# * Start Party Command Phase
#--------------------------------------------------------------------------
alias_method :trick_escape_battle_start_phase2, :start_phase2
def start_phase2
# The Usual
trick_escape_battle_start_phase2
# Disable party command window
@party_command_window.active = false
@party_command_window.visible = false
# Start Phase 3
start_phase3
end
#--------------------------------------------------------------------------
# * Make Basic Action Results
#--------------------------------------------------------------------------
alias_method(:trick_escape_battle_make_basic_action_result,
:make_basic_action_result)
def make_basic_action_result
# The Usual
trick_escape_battle_make_basic_action_result
# If escape
if (@active_battler.is_a?(Game_Actor) and
@active_battler.current_action.basic == 2)
make_basic_action_result_escape
return
end
end
#--------------------------------------------------------------------------
# * Make Basic Action Results - Escape
#--------------------------------------------------------------------------
def make_basic_action_result_escape
# Setup Agi and number
enemies_agi, enemies_number = 0, 0
# Run Through Each Enemy
$game_troop.enemies.each do |enemy|
# Skip if non-existant
next if not enemy.exist?
# Add Agi
enemies_agi += enemy.agi
# Increase Number
enemies_number += 1
end
# Calculate enemy agility average
enemies_agi /= enemies_number.to_f if enemies_number > 0
# Setup Agi and number
actors_agi, actors_number = 0, 0
# Run Through Each Actor
$game_party.actors.each do |actor|
# Skip if non-existant
next if not actor.exist?
# Add Agi
actors_agi += actor.agi
# Increase Number
actors_number += 1
end
# Calculate actor agility average
actors_agi /= actors_number.to_f if actors_number > 0
# Get Chance
chance = 50 * actors_agi / enemies_agi if @active_battler.is_a?(Game_Actor)
chance = 50 * enemies_agi / actors_agi if @active_battler.is_a?(Game_Enemy)
# Determine if escape is successful
success = rand(100) < chance
# If Actor
if @active_battler.is_a?(Game_Actor)
# If escape is successful and possible to escape
if success and $game_temp.battle_can_escape
# Play escape SE
$game_system.se_play($data_system.escape_se)
# Return to BGM before battle started
$game_system.bgm_play($game_temp.map_bgm)
# Battle ends
battle_end(1)
# If escape is failure
else
# Display Cannot Escape
@help_window.set_text('Cannot Escape', 1)
end
# If Enemy
else
# If Escape is successful
if success
# Display "Escape" in help window
@help_window.set_text('Escape', 1)
# Escape
@active_battler.escape
else
# Escape Failed
@phase4_step = 1
end
end
end
end
#--------------------------------------------------------------------------
# End SDK Enabled Check
#--------------------------------------------------------------------------
end
Expand to see the code.
now you have to use my script to create the command should be something like this
Quote:
id x
name whatever
kind 0
type 2
next_method phase3_next_actor
But the next_method parameter is not required since if you leave it off it assumes the next method is phase3_next_actor so
Quote:
id x
name whatever
kind 0
type 2
just replace x and whatever with any number (that hasn't been used already) and a name
@Jonny
In a new script above main but below Advanced Battle Commands and Timer Battle System Base
class Scene_Battle
#--------------------------------------------------------------------------
# * Go to Command Input for Next Actor
#--------------------------------------------------------------------------
def phase3_next_actor(flag = true)
# End Action For Battler if made an action
phase3_end_action if @active_battler != nil && flag
# Actor blink effect OFF
$game_party.actors.each {|actor| actor.blink = false}
# Call Block The Number of Times There are Actors
$game_party.actors.size.times do
# Advance actor index
@actor_index = (@actor_index + 1) % $game_party.actors.size
# Get Active Battler
@active_battler = $game_party.actors[@actor_index]
# Set Blink To True
@active_battler.blink = @active_battler.inputable?
# Break if can accept input
if @active_battler.inputable?
# Set index to 0
@actor_command_window.index = 0
# Clear Action
@active_battler.current_action.clear
# Set Actor
@actor_command_window.actor = @active_battler
# Break
break
end
# Actor blink effect OFF
@active_battler.blink = false if @active_battler != nil
# Set Active Battler to Nil
@active_battler = nil
end
# Set To Unselectable if no active battler
@actor_index = -1 if @active_battler == nil
# Set up actor command window
phase3_setup_command_window
end
#--------------------------------------------------------------------------
# * Go to Command Input of Previous Actor
#--------------------------------------------------------------------------
def phase3_prior_actor
# Actor blink effect OFF
$game_party.actors.each {|actor| actor.blink = false}
# Call Block The Number of Times There are Actors
$game_party.actors.size.times do
# Get Previous Index
@actor_index = (@actor_index - 1) % $game_party.actors.size
# Get Active Battler
@active_battler = $game_party.actors[@actor_index]
# Set Blink to True
@active_battler.blink = @active_battler.inputable?
# Break if can accept input
if @active_battler.inputable?
# Set index to 0
@actor_command_window.index = 0
# Set Actor
@actor_command_window.actor = @active_battler
# Break
break
end
# Actor blink effect OFF
@active_battler.blink = false if @active_battler != nil
# Set Active Battler to Nil
@active_battler = nil
end
# Set To Unselectable if no active battler
@actor_index = -1 if @active_battler == nil
# Set up actor command window
phase3_setup_command_window
end
end
Expand to see the code.
Delete this from Advanced Battle Commands
#--------------------------------------------------------------------------
# * Actor Command Window Setup
#--------------------------------------------------------------------------
alias_method(:trick_aibc_phase3_setup_command_window,
:phase3_setup_command_window)
def phase3_setup_command_window
# The Usual
trick_aibc_phase3_setup_command_window
# Set Actor
@actor_command_window.actor = @active_battler
end
Expand to see the code.
If that doesn't work tell me because I have already merged this script with TRTAB (actually it's not the actual CBS it isn't compatible with it is Timer Battle System Base that is causing the problem) once, but I forgot what I did