Hi, I was wondering why my move route command doesn't work in Ruby.
i = $game_variables[86]e = $game_map.eventsmove_route = RPG::MoveRoute.newmove_route.repeat = falsemove_route.skippable = falsem = RPG::MoveCommand.newm.code = 25move_route.list.insert(0,m.clone)e.force_move_route(move_route)The event is supposed to turn toward the player with no repeats and skips, but nothing happens.
Edit: I checked the variable that says which event this is and its correct, otherwise other stuff that I programmed wouldn't have done anything as well.
You don't need to do this via script. You can simply do a Set Move Route and check the Repeat button, with a Turn Toward Player command. When you want them to stop "following" the player's movement, just issue another Set Move Route with no movement commands and it will cancel it out.
I don't have Ace in front of me now to see why it's not working, but the fact that you've got move_route.repeat = false might be a good starting point.
But don't do it in a script unless you really have to.
Not sure what's wrong there, but I know you need a MoveCommand with code 0 to end the the route.
e = $game_map.eventsmove_route = RPG::MoveRoute.newmove_route.repeat = truemove_route.skippable = falsemove_route.wait = falsemove_route.list = []move_route.list << RPG::MoveCommand.new(Game_Character::ROUTE_TURN_TOWARD)move_route.list << RPG::MoveCommand.new(Game_Character::ROUTE_WAIT, [30])move_route.list << RPG::MoveCommand.new(Game_Character::ROUTE_END)e.force_move_route(move_route)this script should work.Why exactly are you doing this through scripts, though?
Ah, sorry - I misread. You want them to turn towards the player if they're within 2 tiles, wait 2 seconds, then turn to face their original direction?
How are you determining which events will do this? Your original code looked at a variable for the event id, then got the event from that variable. That's probably slow, because I'm assuming you're updating that variable within a loop somewhere.
Can you show us the full code that controls everything that's done?