Is there any way I can cancel a moveroute? I have this scenario:
Waiter walks to the kitchen (no wait). Then after some dialogs the scene fades out and the waiter is relocated. But if he is relocated before he finished moving then he continues his old moveroute... I currently worked around it by using another waiter and making the first one through+transparent but that get's messy after a few times...
Is there a way to wait for a moveroute? Like:
I have a waiter grab some drinks. Then I have some dialogs. But after the dialogs are finished I don't want the waiter to give you the drinks if he is still getting them...
Can you post a screenshot of all the event pages? It would be a big help.
Just do another Set Move Route. As long as you HAVE used a Set Move Route (and not an Autonomous Movement instead), setting a new move route will cancel the original.
You can do a Set Move Route without actually adding any movement commands. That will just have the effect of cancelling any move route already in place.
I have a common event for waiting for a player's or an event's move route to finish.
I'm not at my PC at the moment, so I'll see if I can remember ...
In your event that has the move route and the dialogue:
Put the event ID into a variable
Put the x and y END locations into two more variables
Call the common event to "wait for NPC move route completion"
In the common event:
Loop Wait 4 Frames Conditional Branch: if event is on required x and y positions Break Loop EndRepeatI can't remember if I used two additional variables to put the event's current X and Y positions (using a script call: $game_variables[x] = $game_map.events[eventid].x, where eventid is the variable with the event numbe) and then compared them to the two previously set variables, or if I just did the whole thing in a script within the conditional branch.Post back whether your solution works, or you can get my suggestion working. If you still need help, I'll give you a screenshot of my common event when I get home.
You sometimes have those really smart events and without scripting 🙂 .
But I prefer my script in this particular case because it is possible that they come back at that specific coordinate but without finishing their moveroute. Like when you enter the Burger World:
- Cashier gets you a milkshake.
- Comes back and places milkshake on counter (is now at the original coordinate again). # <Your example would finish here>
- Goes to get some food and comes back to place it on the counter.
- Now the moveroute has ended and she asks you to pay. # <My script finishes here>
I know it's probably possible to edit your example to make it compatible with the above.
Yes my solution works. I just call wait_for_moveroute(x) in my event just before the dialog and all is good.
Just one question, you wait 4 frames, my script waits 1. Is there any specific reason for choosing 4? Isn't it possible to be like 3 frames 'late' this way?
Since you can only wait for one moveroute at a time, waiting just 1 frame is not a performance issue.
Yes. "if event is on required x and y positions" is just a pseudocode placeholder. It's up to you to figure out the exact syntax.
As I said, I wasn't at my PC when I wrote that, so I would have just been guessing, and probably would have included a few errors.
Which is also why I said "if you still need help, I'll give you a screenshot of my common event when I get home." 😉