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

[ACE] Código para localizar e mover eventos

Iniciado por Kusma, 15/09/2021 às 20:14

15/09/2021 às 20:14 Última edição: 15/09/2021 às 20:39 por Kusma
Boa noite Makers Malukos!

Não sei se deveria fazer esse tópico aqui ou em Scripts, então se errei lhes agradeço pela paciência com um novato no fórum.

Preciso de uma ajuda simples: As opções de definir localização de "Localização do evento..." e "Definir rota de movimento", eu preciso fazer elas por código especificando a ID do evento que quero mudar a localização ou mover.

Que códigos uso?

Desde já agradeço!

Achei no fórum gringo, link aqui: https://forums.rpgmakerweb.com/index.php?threads/script-call-collection-for-vxace.25759/

Localização de evento e jogador
# Move Event ID to new X and new Y Position
# ----------------------------------------------
$game_map.events[id].moveto(new_x, new_y)
# Move Player to new X and new Y Position
# ----------------------------------------------
$game_player.moveto(x, y)



Rota de movimento
move_route = RPG::MoveRoute.new
move_route.repeat = false           # This means the event will repeat the action
move_route.skippable = true         # This means the event will skip the move route if it's not possible
m = RPG::MoveCommand.new
m.code = 45                         # The List of M Code can be found over Game_Character Default Script, this current m.code is call script
m.parameters = ["script call here"] # This is if you use #45 in M.code
                                    # To show animation in move route just type animation_id = n, for balloons it's balloon_id = n
move_route.list.insert(0,m.clone)
$game_player.force_move_route(move_route)         # For Player
$game_map.events[ID].force_move_route(move_route) # For Events
# ----------------------------------------------
# Other Move Route Options
# ----------------------------------------------
# Single Action
newCommand.code       = moveCode       # See List in Game_Character Default Script
newCommand.parameters = [""]           # This refers to Jump, Wait, Switch On, Switch Off, Change Speed,
                                       # Change Frequency, Change Graphic, Change Opacity, Play SE and Script.
newRoute.list.insert(0,newCommand.clone)
# Multiple Actions (Example)
# newCommand.code       = 1
# newRoute.list.insert(0,newCommand.clone)
# newCommand.code       = 3
# newRoute.list.insert(0,newCommand.clone)
# newCommand.code       = 1
# newRoute.list.insert(0,newCommand.clone)
# For Turning
$game_map.events[eventid].set_direction(n) # For Events
$game_player.set_direction(n)              # For Players
#Direction n = [2]Down [4]Left [6]Right [8]Up
# Changing Event Graphic
$game_map.events[id].set_graphic("character_name", character_index)
# id is the id of the event you want to change.
# "character_name" is the name of the graphic file you want to change to (make sure to keep the quotation marks).
# character_index is the index on the character sheet (it starts counting at 0).

Citação de: Selitto online 15/09/2021 às 20:34
Achei no fórum gringo, link aqui: https://forums.rpgmakerweb.com/index.php?threads/script-call-collection-for-vxace.25759/

Localização de evento e jogador
# Move Event ID to new X and new Y Position
# ----------------------------------------------
$game_map.events[id].moveto(new_x, new_y)
# Move Player to new X and new Y Position
# ----------------------------------------------
$game_player.moveto(x, y)



Rota de movimento
move_route = RPG::MoveRoute.new
move_route.repeat = false           # This means the event will repeat the action
move_route.skippable = true         # This means the event will skip the move route if it's not possible
m = RPG::MoveCommand.new
m.code = 45                         # The List of M Code can be found over Game_Character Default Script, this current m.code is call script
m.parameters = ["script call here"] # This is if you use #45 in M.code
                                    # To show animation in move route just type animation_id = n, for balloons it's balloon_id = n
move_route.list.insert(0,m.clone)
$game_player.force_move_route(move_route)         # For Player
$game_map.events[ID].force_move_route(move_route) # For Events
# ----------------------------------------------
# Other Move Route Options
# ----------------------------------------------
# Single Action
newCommand.code       = moveCode       # See List in Game_Character Default Script
newCommand.parameters = [""]           # This refers to Jump, Wait, Switch On, Switch Off, Change Speed,
                                       # Change Frequency, Change Graphic, Change Opacity, Play SE and Script.
newRoute.list.insert(0,newCommand.clone)
# Multiple Actions (Example)
# newCommand.code       = 1
# newRoute.list.insert(0,newCommand.clone)
# newCommand.code       = 3
# newRoute.list.insert(0,newCommand.clone)
# newCommand.code       = 1
# newRoute.list.insert(0,newCommand.clone)
# For Turning
$game_map.events[eventid].set_direction(n) # For Events
$game_player.set_direction(n)              # For Players
#Direction n = [2]Down [4]Left [6]Right [8]Up
# Changing Event Graphic
$game_map.events[id].set_graphic("character_name", character_index)
# id is the id of the event you want to change.
# "character_name" is the name of the graphic file you want to change to (make sure to keep the quotation marks).
# character_index is the index on the character sheet (it starts counting at 0).


Show Selitto! Muito obrigado!