RPG Maker Forums

I am using SoulPour777's simple player swapping system to allow the party order to be rotated on the map (eventually this will become the only way to change characters in my project but that's not important right now).  So far I have modified the script so that there is only one button that changes characters and in only one direction, as opposed to in either direction like in the default version of the script.  

What I am trying to do next isn't nearly as simple as I thought it would be.  I would like the script to check if the next actor is downed (0 HP), and if so skip over them, and switch to the next living actor.  This is important because I am using an action battle system and can't have the player controlling a dead character.  I haven't been able to work this out myself, and have been getting all sorts of error messages in whatever I try.

The script as I have it now (still switches to dead characters if they're next in the order) is as follows.

 # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# Simple Player Swapping# Author: Soulpour777# Date Scripted: 12:18PM, April 5, 2014# Description: Allows the player to switch on to characters by pressing a left# and right button (user defined)# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= module Soulpour  module PlayerSwitch    # Which button should be pressed to switch party members from the    # formation?    # :R = W    # :L = Q    Switch_Button = :L    # What is the name of the sound effect played when you switch players?    # Sound Effect should be inside the SE folder or inside the RTP    Button_Effect = "Absorb1"  endend class Game_System  #--------------------------------------------------------------------------  # * Public Instance Variables  #--------------------------------------------------------------------------    attr_accessor           :leader_switch  #--------------------------------------------------------------------------  # * Alias Listings  #--------------------------------------------------------------------------    alias :soul_initialize_on_game_system         :initialize  #--------------------------------------------------------------------------  # * Object Initialization (Aliased)  #--------------------------------------------------------------------------    def initialize    soul_initialize_on_game_system    @leader_switch = 1  endend class Scene_Map < Scene_Base  #--------------------------------------------------------------------------  # * Alias Listings  #--------------------------------------------------------------------------    alias :soul_frame_update_on_scene_map         :update  #--------------------------------------------------------------------------  # * Frame Update (Aliased)  #--------------------------------------------------------------------------  def update    soul_frame_update_on_scene_map    if Input.trigger?(Soulpour::playerSwitch::Switch_Button)      RPG::SE.new(Soulpour::playerSwitch::Button_Effect, 100, 100).play      $game_party.swap_order($game_system.leader_switch, 0)      if $game_system.leader_switch == ($game_party.all_members.size) - 1        $game_system.leader_switch = 1      else        $game_system.leader_switch += 1      end    end  end  end 
Any help on this would be amazingly appreciated. :D

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,539
Members
137,834
Latest member
EverNoir
Top