Harvest Moon like NPCS that move out of house and in house depending on time

For starters, please do not recommend me a plugin.

So I have a set variable call "Day/Night timer" I wish to make the appearance of NPCs coming and going from their houses.
When it hits 180 the switch NIGHT is turned on and if it is 0 to 180, the switch DAY is on.

What I have been doing is turning switches on and off to hide the npc if the timer is past 90. And also using switches to show that when the time is past 90, a switch is turned on to show them leaving.

For this test, I would like the NPC to walk around the house randomly and you can talk to them. Once the timer hits 90, a switch is turned on and they head straight out the door. Another switch is turned on to hide their image to show that they have exited the building.

Outside, if timer is past 95 I would like the image of the NPC inside the house to be gone and outside of the house an event that was in front of the door that was blank, now has the NPC image and is moving to walk to town. Once they have reached the area on the map that teleports the player to town, another switch is turned on to hide the NPC image to show that the NPC has entered town.

In town, if timer is past 105 I would like the switch to show the npc walking to town off in the previous area and right now be walking to a specific place in town. So a switch is used to show the NPC entering town and another switch is turned on on the exact spot where the NPC stops and the event that was moving is now off.(or hidden)

Then I want the Npc to walk back home at night. (So more switches on and off to indicate movement towards home)

I had this achieved with switches but I realized I need a condition branch to check what time it is to start turning on switches. Because if the player isn't in the home then the chain reaction of the NPC moving out of the house into town will not start. It needs the IF timer is greater than 90 and such to move the event. That way it flows no matter where you in the game.

How do I set this up? Is this even possible? Does this make sense? I've spent longer than I should have on this.

Edit: Nevermind for now, I think I almost go this figured out. I just had to fix something I missed. ^^:
How did you get them to walk home at night? I've actually been wondering how you would do something like that. You can't get there current location as far as I can tell. I didn't see any way to tell them to go to one location. I can imagine ways to accomplish it but they are all rather complex.
Well I used switches, scripts and made the event parallel process.

◆If:Day is ON
◆If:Day/Night timer > 50
◆Control Switches:#0021 NPC is leaving house = ON
◆Set Movement Route:NPC test (Repeat, Wait)
: :◇Script:this.moveStraight(this.findDirectionTo(14, 24));
: :◇Script:if (this.pos(14, 24)) { this._moveRoute.repeat = false; };
◆Control Switches:#0022 NPC has exited house = ON
◆Control Switches:#0023 NPC walks house to town = ON
◆Control Self Switch:A = ON
◆
:End
◆
:End


◆If:Night is ON
◆Control Switches:#0022 NPC has exited house = OFF
◆Control Switches:#0023 NPC walks house to town = OFF
◆Control Switches:#0021 NPC is leaving house = OFF
◆
:Else
◆If:Day is ON
◆Control Self Switch:A = OFF
◆
:End
◆
:End

And then if NIGHT is ON and Timer is say, past greater than 180 he begins it walk home.

I use switches to turn off and on pages in ONE event to either hide or show or make the NPC walk.

You can use the script here but replace the 14, 24 with where you want exactly on the map the NPC to go. You also will need repeat movement on for it so don't put any other movement actions in scripted move event.

I'm not good at explaining too well, does any of that make sense?
Ah. I haven't explored the capabilities of script yet. Since the instance I was doing something like this I wasn't using a parallel event, I just detected the player's location, picked one of two spots based on that for destination and hard coded the walking. Nice to know that is available in the future.
Edit: Accidentally posted twice.
It's a lot of work, but easier to handle if you use a time variable directly - although I have to admit that MV's limit of 20 event pages might cause problems with this.

Basically have a variable assigned as a time variable, for example as hours (or as quarter hours if you need smaller coordination steps).
Then have all NPCs have pages assigned to values of that variable as page condition.

when the time goes on, the events will automatically switch pages to keep up with the time variable - and you can have the events do different things with the autonomous movement on each page, or switching to an invisible event page if the NPC is supposed to be on another page at that time.

This will not work for every NPC especially if you need to have more than 20 different options on one map (although you could use several events for one NPC on the same map if you plan carefully), but it will remove the need for a parallel process checking each NPC with dozens of switches.

Original thread: https://forums.rpgmakerweb.com/threads/harvest-moon-like-npcs-that-move-out-of-house-and-in-house-depending-on-time.104530/