SCRIPT FREEZE WITH FORCE_MOVE_ROUTE

Posts

Pages: 1
My ocde can't pass trought the line Fiber.yield while $game_player.force_move_route(route)
Why? Thanks.



def walk_to(target,direction,step,through=false ,speed=4,frequency=5)


route = RPG::MoveRoute.new
route.repeat = false
route.wait = true
route.skippable = false
route.list =

if through==false then
route.list << RPG::MoveCommand.new(37)
else
route.list << RPG::MoveCommand.new(38)
end

case target

when 0

old_through = $game_player.through
old_move_speed = $game_player.move_speed
old_move_frequency = $game_player.move_frequency

$game_player.move_speed
$game_player.move_frequency

for i in 1..step

route.list << RPG::MoveCommand.new(direction)
end

if through==false then
route.list << RPG::MoveCommand.new(37)
else
route.list << RPG::MoveCommand.new(38)
end
route.list << RPG::MoveCommand.new(0)

Fiber.yield while $game_player.force_move_route(route)

$game_player.move_speed = old_move_speed
$game_player.move_frequency = old_move_frequency

when 1

character = get_character(0)

old_through = character.through
old_move_speed = character.move_speed
old_move_frequency = character.move_frequency

character.move_speed
character.move_frequency

for i in 1..step
route.list << RPG::MoveCommand.new(direction)
end

if through==false then
route.list << RPG::MoveCommand.new(37)
else
route.list << RPG::MoveCommand.new(38)
end
route.list << RPG::MoveCommand.new(0)
Fiber.yield while character.force_move_route(route)

character.move_speed = old_move_speed
character.move_frequency = old_move_frequency

end

end
Adon237
if i had an allowance, i would give it to rmn
1743
Though RGSS is basically ruby, the fiber class isn't in it, i am pretty sure.
Is this xp/vx/vxace?
Adon237
if i had an allowance, i would give it to rmn
1743
well ace has fiber i think
I think that is XP, btw
Yes fiber exist. By the way my code work now with this code.

curently I use 1 2 3 4 for direction. Any bright idea how to chane it for up down left right?

def walk_to(target, direction, step, through=false, speed=4, frequency=5)
character = get_character(target)
route = RPG::MoveRoute.new
route.repeat = false
route.skippable = false
route.list =
route.list << RPG::MoveCommand.new(29, )
route.list << RPG::MoveCommand.new(30, )
route.list << RPG::MoveCommand.new(through ? 37 : 38)
step.times do route.list << RPG::MoveCommand.new(direction) end
route.list << RPG::MoveCommand.new(29, )
route.list << RPG::MoveCommand.new(30, )
route.list << RPG::MoveCommand.new(character.through ? 37 : 38)
route.list << RPG::MoveCommand.new(0)
character.force_move_route(route)
Fiber.yield while character.move_route_forcing
end
Adon237
if i had an allowance, i would give it to rmn
1743
author=XGuarden
Yes fiber exist. By the way my code work now with this code.

curently I use 1 2 3 4 for direction. Any bright idea how to chane it for up down left right?

def walk_to(target, direction, step, through=false, speed=4, frequency=5)
character = get_character(target)
route = RPG::MoveRoute.new
route.repeat = false
route.skippable = false
route.list =
route.list << RPG::MoveCommand.new(29, )
route.list << RPG::MoveCommand.new(30, )
route.list << RPG::MoveCommand.new(through ? 37 : 38)
step.times do route.list << RPG::MoveCommand.new(direction) end
route.list << RPG::MoveCommand.new(29, )
route.list << RPG::MoveCommand.new(30, )
route.list << RPG::MoveCommand.new(character.through ? 37 : 38)
route.list << RPG::MoveCommand.new(0)
character.force_move_route(route)
Fiber.yield while character.move_route_forcing
end

is this code in VX ACE?
Pages: 1