11-11-2022, 08:13 AM
KRefreshFormation XP
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.
Code:
# * KRefreshFormation XP
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)
$game_system.se_play($data_system.cursor_se)
$game_party.swap_formation(:left)
elsif Input.trigger?(Input::R)
$game_system.se_play($data_system.cursor_se)
$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.