09-17-2009, 06:28 PM
Code:
#------------------#
#Dod Change Leader #
#by:Dodoop #
#version:1.0 #
#------------------#
#
# Edited by: Night_Runner
# Date: 15/Sept/09
#
# Designed to: Turn on the switch corresponding with the leading player's ID
# (and turn off the switch from the last leading player). And update the
# leading player before battle (designed to be compatable with MOG XAS Hud
# V2.6.
#
#-----------------#
#Muda o lÃder quando uma certa tecla for pressionada no mapa.
module Dodoop
#Tecla que devera ser pressiona para mudar o lÃder.
CHANGE_LEADER_INPUT = Input::L
end
class Scene_Map
alias change_leader update
def update
change_leader
if Input.trigger?(Dodoop::CHANGE_LEADER_INPUT)
leader_read
@sthero.update
end
$game_switches[$game_party.actors[0].id] = true # Turns on the switch of
# the leading hero
end
def leader_read
$game_switches[$game_party.actors[0].id] = false # Turns off the switch of
# the last hero
@actors = []
for i in 0...$game_party.actors.size
@actors[i] = $game_party.actors[i]
end
for i in 1...@actors.size
$game_party.actors[i - 1] = @actors[i]
end
@Xas_Window_Skill.update
$game_party.actors[@actors.size - 1] = @actors[0]
$game_player.refresh
$game_party.refresh # Needed to update the party order.
@sthero.refresh # Only to be used with MOG's XAS, refreshes the HUD.
@sthero.update if @sthero != nil
@sthero.refresh if @sthero != nil
@sthero.update if @sthero != nil
if @sthero != nil
@sthero.dispose
@sthero = Window_HUD.new
@sthero.x = XAS_HUD::XASHUD_X
@sthero.y = XAS_HUD::XASHUD_Y
if $game_switches[XAS_HUD::DISABLE_STATUS_HUD_SWITCH] == false
@sthero.visible = true
else
@sthero.visible = false
end
@sthero.update
end
end
end
#================================================#
# Game_Party
#================================================#
class Game_Party
def remove_actor(actor_id)
# Delete actor
@actors.delete($game_actors[actor_id])
# Refresh player
$game_player.refresh
$game_switches[actor_id] = false # If the actor is removed, they cannot
# be the leading hero.
end
end
ok here try this one now