So I have an NPC that is patrolling in a rectangle around some boxes. The player should try to avoid them, but if they don't it initiates a fight that they can choose to see through to the end or escape from.
The issue is that if the player chooses to escape the NPC's patrol route goes off kilter and they end up walking into a wall and getting stuck. I already have "skip if cannot move" unchecked. I think it might have something to do with going into and out of the fight resetting the move pattern back to the beginning when the NPC isn't in it's normal starting spot.
nothing can really stop that because the move route has to reset on such a case by default.
an existing workaround is to add a plugin that gives you the option to remember last event location and then write the event in a way that detects current position and adapts pathfinding to continue.
It might be possible to ask for a plugin that tracks steps in the background and jumpt to the correct command in a moveroute after an interaction, but no one has written such a plugin yet to my knowledge, so I can't tell if there is a problem with that idea.
The best bodge I can come up with in the meantime is teleporting the guard back to his original start point upon completion of the battle escape. Not particularly neat, but better than the alternative.
You could use a pathfinding plugin. That way you don't have to rely on move routes. The event will go to its destination no matter where it is.
I was wrong. It doesn't restart the sequence. What happens is that when player touch or event touch activates after a step has been taken, but the step does not complete. So what happens is that the pattern is a single step out of line when you come back.
Does anyone have recommendations for specific pathfinding plugins? I tend to find plugins a bit of a russian roulette sometimes.
That's a really useful plugin, and i'm definitely going to use it. Annoyingly I stumbled on a super easy fix for my original problem. I put a "1 step forward" command into the post escape combat block of instructions and it made up for the missed step pre combat. Sorry for dragging you all in on this.