Beginer development: NPC schedule

After finishing create day cycles

Now I'm make NPC schedule, and here where i have a problem

If i do action inside map everything work, but when I enter to map NPC coordinates go back to default

So page 1
Code:
◆If:Time = 1
  ◆Set Event Location:StepMoM_HF1, (3,5) (Direction: Up)
  ◆Set Movement Route:StepSys_HF1 (Wait)
  :                  :◇Transparent ON
  ◆
:End
◆If:Time = 2
  ◆Set Event Location:StepMoM_HF1, (1,0)
  ◆Set Movement Route:StepMoM_HF1 (Wait)
  :                  :◇Transparent ON
  ◆Set Movement Route:StepSys_HF1 (Wait)
  :                  :◇Transparent ON
  ◆
:End
◆If:Time = 3
  ◆Set Event Location:StepMoM_HF1, (16,4) (Direction: Down)
  ◆Set Movement Route:StepMoM_HF1 (Wait)
  :                  :◇Transparent OFF
  ◆Set Event Location:StepSys_HF1, (17,4)
  ◆Set Movement Route:StepSys_HF1 (Wait)
  :                  :◇Transparent OFF
  ◆
:End
◆If:Time = 4
  ◆Set Event Location:StepMoM_HF1, (1,0)
  ◆Set Movement Route:StepMoM_HF1 (Wait)
  :                  :◇Transparent ON
  ◆Set Event Location:StepSys_HF1, (2,0)
  ◆Set Movement Route:StepSys_HF1 (Wait)
  :                  :◇Transparent ON
  ◆
:End
◆Control Self Switch:A = ON

page 2 , condition if Self Switch:A = ON

Code:
◆If:Time chec ≠ Time
  ◆Control Self Switch:A = OFF
  ◆
:End
◆Wait:180 frames

For now i have found 2 way to fix it, just do only 1st page parallel process , and delete 2nd. (but i want put in parallel process short and easy requests)

Integrate NPC location in time count event that i create (here link) https://forums.rpgmakerweb.com/index.php?threads/beginer-development-times-of-day.89383/

But i wonder why it's not work in 1st place, it's like if 'Self Switch A' when i enter in map already ON
Why not have the npc event as sepreate pages, with each page checking the time variable. So on page 1 it checks if the time variable is greater or equal to 1, on page 2 checks if the variable is greater than 2 and so on.

And then put the movement route in the event page movement route for each page, and then in the event have it talk or open a shop or whatever.
Why not have the npc event as sepreate pages, with each page checking the time variable. So on page 1 it checks if the time variable is greater or equal to 1, on page 2 checks if the variable is greater than 2 and so on.

And then put the movement route in the event page movement route for each page, and then in the event have it talk or open a shop or whatever.

Then i will have 5 pages + 5 more pages for weekend so it can be up to 10 checks before action, it's will make process more heavy. I want minimize request by creating check page. This is why I interested why In time_event my method work but not work for event that place NPC
When you say minimize it, do you mean want all of your event processing to happen on one page? If so why? That's going to create a complex and very, very long event page.
Just have a single page, and put Erase Event as the very last command.

It will run, put the event where it's meant to be based on the time, and will delete itself. When you leave the map and return, it will be reloaded and will do the same things again.

The problem with the way you're doing it is if the time changes while you're still on the map, because that parallel process is running continually, the NPC is going to jump from one location to another suddenly.
When you say minimize it, do you mean want all of your event processing to happen on one page? If so why? That's going to create a complex and very, very long event page.

Not all, but still, I want avoid unnecessary action in parallel events.

Just have a single page, and put Erase Event as the very last command.

It will run, put the event where it's meant to be based on the time, and will delete itself. When you leave the map and return, it will be reloaded and will do the same things again.

The problem with the way you're doing it is if the time changes while you're still on the map, because that parallel process is running continually, the NPC is going to jump from one location to another suddenly.

Action are trigger time like work out, watch tv, take bath and etc all add +1 to time, so if NPC in this map they must change place where they stand, and it's trigger other event depend on part of day. So erase event won't do.

NPC will not jump, In time event i use Fade-in/out to hide teleportation
So i still don't figure out why self switch not restart when i re-enter map.

To optimize thing I just add switch that stop parallel events while player interact with other event.

Original thread: https://forums.rpgmakerweb.com/threads/beginer-development-npc-schedule.89515/