Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Leader swap with key hit

Is there a script to swap the leader (Person on map) by just hitting the key?

Like if you press "L" it goes to the next character in your party as leader

EX: Your party is Hero(Guy on map),Dude,and Girl
You press "L"
Now your party is Dude(Guy on map),Girl, and Hero
 
Wow. This must be the 500th time I have seen this.

Let me find it...

Insert above Main
Code:
class Game_Party
  def shift_forward
    @actors << @actors.shift
    $game_player.refresh
  end
  def shift_backwards
    @actors.insert(0, @actors.pop)
    $game_player.refresh
  end
end

class Scene_Map
  alias_method :seph_partycycling_scnmap_update, :update
  def update
    if Input.trigger?(Input::L)
      $game_party.shift_forward
    elsif Input.trigger?(Input::R)
      $game_party.shift_backwards
    end
    seph_partycycling_scnmap_update
  end
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top