Making events passable for certain npcs [Solved]

Hello! Hope everyone's having a great time working on their projects.
Regarding my issue, my game has an enemy. As of now, whenever the player is being chased, they can escape the enemy by going inside a room and shutting the door (not even locking it), trapping the enemy outside. But I want the enemy to be able to go through these doors i.e I want to make these doors passable for the enemy but impassable in general (unless interacted with). I can't turn on through because then, the player will clip through even when it's supposed to be closed. Anyone have any solution to this?
set the door object to be interactable on touch, check for the touch-er being the enemy, validate the enemy, set IT'S move route to through ON, move, and then set through OFF.

I don't know if that'll override the enemy's move route.
if it does, you can still save the enemy's move route in it's own object (the whole move route IS and object in itself) and assign it to the enemy again after the fact.
OR, simply reset the enemy's move route to "approach" and that should take care of it.

another method would be to always check for touch, an on player action simply change the door to an "open" sprite, while always setting the through for both the player and the enemy.

your problem is that the door is an obstacle.... an obstacle that's ALWAYS PASSABLE, sometimes by opening and sometimes by phasing through it.
you have to decide which to use in each case... that's where you put the conditional.
and, since the event enemy can't *interact* (in control terms) with the event door but you need the door to respond to the event enemy,.... there's your touch action.
I thought of doing that but for the pathfind to work, it checks for areas already passable. Since the door is still impassable, the event won't move at all. That's the problem.
are you using a plugin for that?
Yes. It's a huge map so the event won't be able to track the player properly with the built in approach command. So I'm using a pathfinding plugin.
I thought of something. Let's see if it works.
if you have the door alter the enemy's move route, you can make it pass over impassable tiles, and then restore it's move route.
*provided* the plugin works with the standard move route object, and has the same mechanics, you can save the move route for later use.
what I'm saying is, make an override for that one case of the enemy meeting the door... and an override always has an on and off state, so if you find a way to save the move route and restore it, you've solved the problem.
The plugin command is like qPathfind eventID towards p
so there's no way to control it externally... at least I don't know how.
But I ended up doing this:
1584534560950.png

Works now ^^
if that's the case (running with a parallel, I mean) I would have still left the door to override the enemy, instead of the enemy having to run an additional check *while on parallel*

the multiple pages here is your *save the move route elsewhere*.
you can work with pages, so it would be a matter of just triggering the correct one.
you can't ping the plugin from the event, but you can have the event *halt itself at working with the plugin*, because the processing of the move route takes precedence before the running of the parallel command, so by sending a change of self-switch from the move route you effectively override the parallel by changing it for a new set of instructions (a new page)

if it's just one door, it's no big deal.... but if it's multiple doors, you might as well have the event just run around on it's own and let the doors process the decision IF and WHEN it comes to that, not all the time.

Original thread: https://forums.rpgmakerweb.com/threads/making-events-passable-for-certain-npcs-solved.119239/