RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Update Action Order Per Action (v1.0)

0 Members and 2 Guests are viewing this topic.

*
Rep:
Level 82
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


Code: [Select]
#-------------------------------------------------------------------------
#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


  • Logan Forrests


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.
« Last Edit: April 23, 2011, 03:22:23 PM by LoganForrests »
(Why do I always feel like it's the end of the world and I'm the last man standing?)

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Nice work LoganForrests. It's a little feature but it can really spruce up the tactical element of the DBS, which is sorely lacking by default.

*
Rep:
Level 82
It wasn't something I'd considered until I rewrote my Charm script, and then realised just how battle actions were actually processed. Sometimes, I do wonder whether VX was a step forward or a step backwards compared to 2k3 (I never liked XP).

But this little nugget helps with the Quicken/Delay states I made to instantly affect the playing field - Quicken will ensure the target goes next, whilst Delay will ensure the target goes last instead of having to wait until the next turn.

It's the little things that can really make the DBS shine I think.
(Why do I always feel like it's the end of the world and I'm the last man standing?)

***
Rep:
Level 74
I'm baaack!
Almost used a message thinking I might get banned for posting  ;D

THIS IS URGENT FOR ME AND POSSIBLY OTHERS!!!

SCRIPT: Tankentai ATB

ERROR MESSAGE:


When I open the scripts tab this line of ATB (1.1) is selected:
1359l        @at_count = @at_count + $data_states[state_id].atb_damage * 10

SCRIPTS:
Check Attachment (Saved in UniCode so it auto translated comments)

***
Rep:
Level 69
RESIDENT ADONKADONK
This is a useful script, while I did not get any errors, when I use the Tankentai Sideview 3.4e without ATB, occasionally, two actors go at a time. It isn't a super problem or anything, just thought I would let you know.

I'm back.