KRefreshFormation XP
#1
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.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#2
Cool to see this done for all the 'Makers, many thank yous!

One feature you could add is to auto-swap forward when the lead character dies.
(In my game, when I was using followers, dead followers were removed from the entourage.)

Also, the ability to let the developer lock the main character from being moved around in the menus.
(In my game, the lead character is the only one programmed with all the action animations. That's why I lock him in key scenes. In other cases, anybody can be lead and different leads have different field map specialties which requires them to be locked as lead player from time to time.)

Not to complicate things, just thinking of how I personally use stuff and I'd imagine others could possibly have similar use cases.

As a sister script, you could make a "designated leader" script. Leader ID = 0 (whoever is index 0 of the party is designated leader), Leader ID >= 1 (leader is actor with ID#). If leader is removed from party, it defaults 0 again.
[Image: Button-BOTB.png]
[Image: Save-Point.gif][Image: Button-You-Tube2.png][Image: Button-Sound-Cloud2.png][Image: Button-Audio-Mack2.png]
[Image: LS-Banner.gif]
NEW ALBUM OUT NOW!

Reply }




Users browsing this thread: 2 Guest(s)