The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: MrMoo on July 18, 2007, 11:33:44 PM

Title: [RESOLVED] Change Lead Script
Post by: MrMoo on July 18, 2007, 11:33:44 PM
Hey guys, I'm looking for a script where if you press L or R (Q/W) you can shift your party position 1 spot forward or backwards. I used this script before and requested it a long time ago (by long time ago i mean crankeye long time ago) and can't seem to find it anymore. I remember it being a really small and simple script so if anyone could come up with one or find one that would be great.

Similar to this guy's post but I'm not using near fantastica's thing.
http://rmrk.net/index.php/topic,5727.0.html (http://rmrk.net/index.php/topic,5727.0.html)
Title: Re: [Request] Change Lead Script
Post by: modern algebra on July 19, 2007, 02:04:56 AM
Sure, I'll write one up for you. Give me a second.

EDIT: Okay, Starting now

EDIT 2:


class Scene_Map
 
  alias change_leader_modification update
  def update
    change_leader_modification
    if Input.trigger? (Input::R)
      new_lead = $game_party.actors.shift
      $game_party.add_actor (new_lead.id)
    end
    if Input.trigger? (Input::L)
      new_lead = $game_party.actors.pop
      $game_party.actors.unshift (new_lead)
      $game_player.refresh
    end
  end
end
 


Place it just above main
I didn't test it, but it should work. Tell me if you encounter any problems
Title: Re: [Resolved] Change Lead Script
Post by: MrMoo on July 19, 2007, 04:50:57 AM
Works perfectly fine, thanks. If I do encounter any problems I'll tell you.