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

Mudar Personagem no Mapa

Iniciado por LoboShow, 09/03/2013 às 14:29

Mudar Personagem no Mapa

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

[box class=titlebg]
Para que serve o script
[/box]
Bom, este script permite mudar o char que está no mapa apenas apertando as teclas Q ou W.
Igual ao sistema de mapa de Final Fantasy 4.

Significa que quando eu apertar a teclas Q ou W vou trocar o personagem líder do grupo que fica no mapa, pelo segundo personagem do grupo e assim por diante.

[box class=titlebg]
Download
[/box]
#################################################################
######################### XRXS ##################################
#################################################################
#O script permite que você possa mudar o char que está no mapa
#apenas apertanto a tecla Q ou W.
#Para entender as cofigurações de botões aperte a tecla F1
#quando estiver jogando.
#################################################################

class Scene_Map
#Definina aqui quais os botões irão mudar o char no mapa.

def lr_variable_id
return 10
end
end
class Game_Player
def controlable?
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
return true
end
return false
end
end
class Scene_Map
alias xrxs41ax_update update
def update
xrxs41ax_update
if $scene.is_a?(Scene_Map) and $game_party.actors.size > 0 and $game_player.controlable?
if Input.trigger?(Input::L) or Input.trigger?(Input::R)
index = 0
for actor in $game_party.actors
if $game_variables[lr_variable_id()] == actor.id
index = $game_party.actors.index(actor)
end
end
if Input.trigger?(Input::L)
index = (index + $game_party.actors.size - 1) % $game_party.actors.size
elsif Input.trigger?(Input::R)
index = (index + 1) % $game_party.actors.size
end
$game_variables[lr_variable_id()] = $game_party.actors[index].id
$game_player.refresh
end
end
end
end
module XRXS41
MAPCHAR_VARIABLE_ID = 10
end
class Game_Player < Game_Character
alias xrxs41_refresh refresh
def refresh
xrxs41_refresh
id = $game_variables[XRXS41::MAPCHAR_VARIABLE_ID]
if id != 0
actor = $data_actors[id]
@character_name = actor.character_name
@character_hue = actor.character_hue
end
end
end
class Interpreter
alias xrxs41_command_122 command_122
def command_122
xrxs41_command_122
if @parameters[0] == XRXS41::MAPCHAR_VARIABLE_ID
$game_player.refresh
end
end
end


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