O TEMA DO FÓRUM ESTÁ EM MANUTENÇÃO. FEEDBACKS AQUI: ACESSAR

Change Party Order

Iniciado por LoboShow, 02/02/2013 às 20:23

Change Party Order

Compativel com: RMVX
Compatibilidade: ?
Facilidade de uso: ?
Lag gerado: ?

[box class=titlebg]
Para que serve o script
[/box]
Possibilita alterar a ordem do grupo simplesmente apertando as teclas Q e W (L,R);
Pode facilmente ser ativado/desativado por meio de swicthes.

[box class=titlebg]
Instruções
[/box]
Copie o script e cole-o acima do main. Na linha 12 é onde você deve escolher o switch que deve estar OFF para que o sistema funcione, caso ele esteja ON o script será desativado e não será possível alterar o grupo.

[box class=titlebg]
Script
[/box]
#==============================================================================
#  Change Party Order
#  Author: modern algebra (rmrk.net)
#  Date: February 20, 2008
#==============================================================================

class Scene_Map
  #  ORDER_FREEZE_SWITCH_ID :: This constant is for you to set to a switch ID
  # that controls whether the player is allowed to change party order. If it is
  # set to 1 for example, then turning Switch 1 ON will disallow the player
  # from changing party order, and turning it OFF will allow the player to.
  ORDER_FREEZE_SWITCH_ID = 1
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Frame Update
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modern_algebra_change_leader_modification_updt update
  def update
    modern_algebra_change_leader_modification_updt
    return if $game_switches[ORDER_FREEZE_SWITCH_ID]
    # If Button R is being pressed
    if Input.trigger? (Input::R)
      # Remove the Lead Actor
      old_lead = $game_party.members.shift.id
      $game_party.remove_actor (old_lead)
      # Add the old leader back into the party
      $game_party.add_actor (old_lead)
    end
    # If Button L is being pressed
    if Input.trigger? (Input::L)
      # Recreate the actors array from the members array
      actors = []
      $game_party.members.each {|actor| actors.push (actor.id)}
      # Reorder the array to the new order
      actors.unshift (actors.pop)
      actors.each {|id|
        # Remove each actor and add them in the new order
        $game_party.remove_actor (id)
        $game_party.add_actor (id)
      }
    end
  end
end


[box class=titlebg]
Créditos e Avisos
[/box]
Criador: modern algebra