An event that spawns differently if player is close when switch turns on

Hey 😍

Is there a way to make this? I want to create an npc that is only at his house when it's night (night switch on), so my player can go into npc's house when he's not there and steal some stuff. But is there a way I can make this so if night switch turns on while the player is on the house, the npc doesnt suddenly appear there?
its possible with a work around, but you can also let the npc walk into the house
when the player is inside, you might need a conditional branch for this with else
handler, because if the player isn't in the house, he can spawn on the place
where it want it to be.

the same way can be for npc, if night is on and the player is in the house, npc wont spawn
untill the map is refreshed. but I dont know how to call that though.
Ok, got it. I feel so stupid rn hahaha
I simply made a conditional branch to activate another switch (#InTheHouse) if player comes in when night switch is off, then a parallel process inside the house that turns on if #InTheHouse is on. This parallel process spawns the npc differently when night switch turns on.

Original thread: https://forums.rpgmakerweb.com/threads/an-event-that-spawns-differently-if-player-is-close-when-switch-turns-on.122434/