NPC's move route is disrupted after turning on a switch.

So this is probably a dumb question, but I'm in the final stages of putting together my game's demo and I only JUST realized this odd little problem...

1674658278563.png


So this NPC walks around in a loop around a small room, right? However, there's an event on this same map which causes the character Alphin to join your party, which in turn flips a switch called Alphin Joined. If Alphin Joined is on, this NPC says something different. Problem is... this also seems to reset the NPC's move route when the event page changes...

What ends up happening is that depending on where he was when the switch was triggered, he'll end up moving in unintended directions and often get stuck against a wall. All pages have him moving with the same move route (which you can see in the image above), but if for example he was standing on the second dot from the bottom on the left side when the switch was flipped, he'll end up escaping the room and blocking the path, since the first command of his move route is to go left.

I'm gonna say that this probably isn't the way I should be handling this event, so... what's the solution? How can I change it so that he can't escape his intended move route?
You don't need two event pages for this. Just put the dialogue in a conditional branch checking whether Alphin is in your party (or the switch is on, or whatever).
You don't need two event pages for this. Just put the dialogue in a conditional branch checking whether Alphin is in your party (or the switch is on, or whatever).
1674667152743.png

So this would be the right way to do it, right?
I guess? Test it out 😛

You know how you've set up your game - is there a reason to check for Alphin Joined to be ON and for Alphin to be in the party? Is there a circumstance where the switch would be on but he's not in the party?
I guess? Test it out 😛

You know how you've set up your game - is there a reason to check for Alphin Joined to be ON and for Alphin to be in the party? Is there a circumstance where the switch would be on but he's not in the party?
Yeah, because you can swap out your party members 😛

It seems to be working though, thanks! 😀

Original thread: https://forums.rpgmakerweb.com/threads/npcs-move-route-is-disrupted-after-turning-on-a-switch.154396/