Update Action Order Per Action
Version: 1.0
Author: Logan Forrests
Date: April 18, 2011
Version History
- <Version 1.0> 18.04.2011 - Original Release
Planned Future Versions
None.
Description
Forces the turn order to be redetermined each time a battler makes an action. Thus, speed changes (such as via Haste/Slow like skills) will affect the order a battler makes their action during the action order execution process, not when the action orders are recalculated at the next turn.
Please do note that this is designed primarily for the Default Battle System as it changes the way that make_action_orders works. It will probably conflict with Custom Battle Systems. If you do make use of a CBS, then please direct yourself to the Support section of this post.
Instructions
No customisation required, so not much to instruct on.
Script
#-------------------------------------------------------------------------
#LoganForrests' Update Action Orders Per Action
# For the Default Battle System (DBS) in RMVX
#
# Date Created : 18 April 2011
# Date Finished : 18 April 2011
# Last Updated : 24 April 2011
# Latest Version : 1.0
#
#--------------------------------------------------------------------------
# Version History
#--------------------------------------------------------------------------
#
# v 1.0
# Original script: Action Turn Orders are redetermined each time a
# battler executes their action.
#
#--------------------------------------------------------------------------
# Description
#--------------------------------------------------------------------------
# Forces the turn order to be redetermined each time a battler makes an action.
# Thus, speed changes (such as via Haste/Slow like skills) will affect the
# order a battler makes their action during the action order execution process.
#
# NOTE
# This script will very likely conflict with any Custom Battle System scripts.
# Please request a patch from me at rmrk.net if you want to use this with
# a CBS script (please also tell/provide me with the script so that I can make
# a patch quicker).
#
#--------------------------------------------------------------------------
# Directions On How To Implement
#--------------------------------------------------------------------------
# Nothing needed to do.
#
#--------------------------------------------------------------------------
# Script Installation
#--------------------------------------------------------------------------
# In materials above Main, just below Materials and above all other
# scripts.
#
#--------------------------------------------------------------------------
# Support
#--------------------------------------------------------------------------
# The script has been written and tested with no other scripts in place. As
# such, if you encounted any issues with regards to other scripts,
# first try to resolve the problem by moving this script around. If you are
# still unable to resolve the problem, feel free to contact me on rmrk.net
# under the name LoganForrests (no spaces involved) with the name of the
# script(s) you find no longer work when this script is included and the
# nature of the problem(s) so that I can begin to work on the problem(s)
# being caused.
#
# Scripts are made to be compatibile with my own scripts.
#-------------------------------------------------------------------------
$imported = {} if !$imported
$imported["LFUpdatedTurnsv1.0"] = true
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# alias method: start
# set default @executed_order flag to false
#--------------------------------------------------------------------------
alias lf_uaoet_start_sb start
def start
#run original method
lf_uaoet_start_sb
@executed_order = false #turn order has not be executed
end
#--------------------------------------------------------------------------
# overwrite method: update
# added code to call update_turn_order when @executed_order is true
#--------------------------------------------------------------------------
def update
super
update_basic(true)
update_info_viewport # Update information viewport
if $game_message.visible
@info_viewport.visible = false
@message_window.visible = true
end
unless $game_message.visible # Unless displaying a message
return if judge_win_loss # Determine win/loss results
update_scene_change
if @target_enemy_window != nil
update_target_enemy_selection # Select target enemy
elsif @target_actor_window != nil
update_target_actor_selection # Select target actor
elsif @skill_window != nil
update_skill_selection # Select skill
elsif @item_window != nil
update_item_selection # Select item
elsif @party_command_window.active
update_party_command_selection # Select party command
elsif @actor_command_window.active
update_actor_command_selection # Select actor command
else
update_turn_order if @executed_order # Redetermine turn orders if req.
process_battle_event # Battle event processing
process_action # Battle action
process_battle_event # Battle event processing
end
end
end
#--------------------------------------------------------------------------
# alias method: start_main
# set @executed_order flag to true when actions begin processing
#--------------------------------------------------------------------------
alias lf_uaoet_start_main_sb start_main
def start_main
lf_uaoet_start_main_sb
@executed_order = true #set executed orders to true
end
#--------------------------------------------------------------------------
# new method: update_turn_order
# passes in remaining @action_battlers to make_action_orders
# sets @executed_order flag to false if all @action_battlers have had
# their turn
#--------------------------------------------------------------------------
def update_turn_order
if @action_battlers == []
@executed_order = false
return
end
make_action_orders(@action_battlers)
end
#--------------------------------------------------------------------------
# overwrite method: make_action_orders
# allow for passing in of action_battlers for redetermination)
#--------------------------------------------------------------------------
def make_action_orders(action_battlers_in = [])
@action_battlers = action_battlers_in
if @action_battlers == []
unless $game_troop.surprise
@action_battlers += $game_party.members
end
unless $game_troop.preemptive
@action_battlers += $game_troop.members
end
end #if @action_battlers == []
for battler in @action_battlers
battler.action.make_speed
end
@action_battlers.sort! do |a,b|
b.action.speed - a.action.speed
end
end
end
Credit
Support
The script has been written and tested with no other scripts in place. As such, if you encounted any issues with regards to other scripts, first try to resolve the problem by moving this script around. If you are still unable to resolve the problem, feel free to contact me on rmrk.net under the name LoganForrests (no spaces involved) with the name of the script(s) you find no longer work when this script is included and the nature of the problem(s) so that I can begin to work on the problem(s) being caused.
Known Compatibility Issues
This script will very likely conflict with any Custom Battle System scripts. Please request a patch from me at rmrk.net if you want to use this with a CBS script (please also tell/provide me with the script so that I can make a patch quicker).
Author's Notes
I'm not sure if one already exists, but since I needed this functionality for another script I'm working on I figured I might as well put it up here anyway. Feel free to remove it if one already exists.
Restrictions
Nothing but credit for this one. It's not a particularly clever script, it just adds a little to the default system.