MV Help with pathfinding

Hi,

I'm using Shaz Smart Pathfinding plugin to move an NPC (event 1) towards a specific location using the following command in a second parallel event:
Code:
SmartPath 1 0 0
(Even though the second event is parallel I make sure to run the code just once using variables).

The pathfinding seems to work correctly and the event moves towards its destination.

The problem is the interaction between the player and the NPC, as when the player interacts with it to have a conversation, the NPC keeps moving.

How do I pause the NPC from moving while the player is interacting with it, and continue its route when the interaction ends?

Thank you.
You could make the first command when you interact with the event be to call the plugin command that turns off its pathfinding?

See if that works...typically movement on events that can be interacted with is kept on those events. Using one event to control others is largely a cutscene technique.

If that doesn't work, there's some more advanced screwery you can try:
Hi @ATT_Turan thanks for your reply.

About the first solution about stopping the pathfinding when interacting with the event, that would mean losing the path, as the event will stay put after the interaction ended. How do I make sure the correct pathfinding restarts, since I'm not saving the destination in any variable?

About putting the script in the parallel event, I'm using this technique so I can change the destination based on variables. For instance, using a time system, the parallel event tells the NPC to move towards the bed when it's 11PM and move towards the kitchen when it's 8AM. How can I have the same behaviour by putting the script inside the NPC event?
How do I make sure the correct pathfinding restarts, since I'm not saving the destination in any variable?
You turn on a switch or set a variable to reactivate the original parallel event. Or you simply copy code from the parallel event into the end of your conversation to re-calculate the destination and call the plugin command again.

About putting the script in the parallel event, I'm using this technique so I can change the destination based on variables. For instance, using a time system, the parallel event tells the NPC to move towards the bed when it's 11PM and move towards the kitchen when it's 8AM. How can I have the same behaviour by putting the script inside the NPC event?
I'm not sure of the question - you'd have the same behavior by putting the same commands there that you had in the separate parallel event.

Then you can mess around with the code in the post I linked to under "Two triggers."

But I think you should be able to get it working fine by turning the pathfinding off and back on again.

Also, just as a quick note, I notice you double-posted this question in the thread for the plugin. It doesn't really make sense to do that, because you're liable to get different people responding to the same question in two places and now you're duplicating their effort. 😉
I'm not sure of the question - you'd have the same behavior by putting the same commands there that you had in the separate parallel event.
The problem is that the event itself is not parallel, but it's triggered when the action button is pressed. So if the player doesn't interact with it the pathfinding doesn't start
The problem is that the event itself is not parallel, but it's triggered when the action button is pressed. So if the player doesn't interact with it the pathfinding doesn't start
1 - Did you read the section of the thread I linked to? The whole point is the event would be set to parallel in the editor, and then you use code in its commands to change the trigger to Action Button.

2 - You seem focused on the harder/more complicated route. As I said in my first response in post #2, I suggest only looking at or trying this if there's some reason you can't get it to work just from the regular event commands. (and I see no reason why that wouldn't work)

Original thread: https://forums.rpgmakerweb.com/threads/help-with-pathfinding.164225/