Main Menu
  • Welcome to The RPG Maker Resource Kit.

Rotate Party From The Map

Started by SeMcDun, September 03, 2014, 09:40:49 PM

0 Members and 1 Guest are viewing this topic.

SeMcDun

Rotate Party From The Map VXA
Version: 1.0
Author: SeMcDun
Date: 2014.09.03

Version History




  • <Version 1.0> 2014.09.03 - Completed

Description



Rotate the order of the party using the Q and W keys while walking around a map.
Faster than opening menus to change formation.
Can be useful if your game has features like;
- NPC says different things depending on who they are talking to.
- Objects can be interacted with differently depending on who touches it.
(Eg. A strong character who can push things.)
(Or, when a warrior interacts with a chest he cannot open it, when a thief interacts with the chest he opens it.)
(Or for a quest, your warrior searches a bookcase but finds nothing. The magician searches the bookcase and finds the quest item "Magical Tome")
^ That kind of thing.

Instructions

Just paste the code below Materials and above Main.

Script




#=begin
#===============================================================================
# SeM's Change Party Leader On Map VXA
#
# - v1.0
# By SeMcDun
# Last Update: 2014-09-03
#===============================================================================
# Description;
# Change the party leader while on the map using L and R (Q and W)
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This class performs the map screen processing.
#==============================================================================

class Scene_Map < Scene_Base
 
  #--------------------------------------------------------------------------
  # * Start Processing
  #--------------------------------------------------------------------------
  alias scene_map_start_scpl start
  def start
    scene_map_start_scpl
    @switched_char = false
  end # start
 
  alias scene_map_update_scpl update
  def update
    scene_map_update_scpl
   
    if Input.trigger?(:L) || Input.trigger?(:R)
      if @switched_char == false
        # If L or R is being pressed
        @switched_char = true
        if Input.trigger?(:L)
          for i in 0..($game_party.members.size - 2)
            $game_party.swap_order(i, i + 1)
          end
        end # If L
        if Input.trigger?(:R)
          i = $game_party.members.size - 2
          until i == -1
            $game_party.swap_order(i + 1, i)
            i -= 1
          end
         
          #for i in ($game_party.members.size - 2)..0
          #  $game_party.swap_order(i + 1, i)
          #end
        end # If R
       
      end # if not already switched char
    else
      @switched_char = false
    end # input L || R
   
   
   
  end # update
 
end # Scene_Map

#=end


Credit




  • SeMcDun

Support



Leave a message if there's a problem and I'll get back to you when I can.

Known Compatibility Issues

- - -

Terms of Use


Free to use in commercial or non-commercial projects with my name in the creds.

yuyu!

Quote from: SeMcDun on September 03, 2014, 09:40:49 PM
- NPC says different things depending on who they are talking to.
- Objects can be interacted with differently depending on who touches it.
(Eg. A strong character who can push things.)
(Or, when a warrior interacts with a chest he cannot open it, when a thief interacts with the chest he opens it.)
(Or for a quest, your warrior searches a bookcase but finds nothing. The magician searches the bookcase and finds the quest item "Magical Tome")
^ That kind of thing.

Okay, this is officially amazing! :gracie: Will save a bit of effort on the eventing side of things and generally makes the game feel more "natural" when you don't have to change orders in a menu. My current game doesn't use formations, but I'm definitely keeping an eye on this one!

+rep

[Spoiler=My Games and Art]
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]

[/Spoiler]