Save-Point
KRefreshFormation VX + ACE - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker VX/VXAce (RGSS2/3) Engines (https://www.save-point.org/forum-117.html)
+---- Thread: KRefreshFormation VX + ACE (/thread-9477.html)



KRefreshFormation VX + ACE - kyonides - 09-19-2024

KRefreshFormation VX + ACE

by Kyonides

Introduction

You can press L or R buttons to change the current formation while walking through the map.
In the RPG Maker series, PageUp and PageDown buttons serve the same purpose as L and R, respectively.

VX & VX ACE Version

Code:
# * KRefreshFormation VX & ACE

class Game_Party
  def swap_formation(dir)
    return if @actors.size < 2
    if dir == :left
      @actors << @actors.shift
    elsif dir == :right
      @actors.unshift @actors.pop
    end
    $game_player.refresh
  end
end

class Game_Player
  alias :kyon_refresh_form_gm_plyr_up :update
  def update
    if Input.trigger?(Input::L)
      Sound.play_cursor
      $game_party.swap_formation(:left)
    elsif Input.trigger?(Input::R)
      Sound.play_cursor
      $game_party.swap_formation(:right)
    end
    kyon_refresh_form_gm_plyr_up
  end
end

Terms & Conditions

Free for use in any kind of project. There is nothing else you should know about them.