How to make NPCs schedules

Hello, I'm new at rpg maker MV. I've been using the engine for just some weeks and in my main project I ran in a problem.

How to do NPCs schedules

I already have a day night common event system conting sec, min and hours, and have them all divided by switchs of 3 hours each

My biggest two issues are

1. How do I make an NPC travel trough maps.

2. How do I make that the player doesn't need to be on the map to the NPC start its schedule actions or that when the players enters after the NPC route was suppose to be finished, it is in the right place
1) you don't, because you have no NPCs.
You have events pretending to be NPCs, and no event exists outside its own map.
what you do instead is having different events on different maps pretend to be the same NPC.

2) again not possible because only the current map and its events exist at all.
what you need to do instead is to have the events simulate the time when they didn't exist as soon as the player enters their map.

one method for the above is to use multiple event pages conditioned to a daily time variable to determine what the event should currently do, including when it should vanish because it is supposed to be on a different map in that time.

Depending on how you work this might cause the event to suddenly vanish if the time steps per page is too long or changes while the player is near the event, but unfortunately there are limits to the number of event pages and that will limit how fine your control can be.
1) you don't, because you have no NPCs.
You have events pretending to be NPCs, and no event exists outside its own map.
what you do instead is having different events on different maps pretend to be the same NPC.

2) again not possible because only the current map and its events exist at all.
what you need to do instead is to have the events simulate the time when they didn't exist as soon as the player enters their map.

one method for the above is to use multiple event pages conditioned to a daily time variable to determine what the event should currently do, including when it should vanish because it is supposed to be on a different map in that time.

Depending on how you work this might cause the event to suddenly vanish if the time steps per page is too long or changes while the player is near the event, but unfortunately there are limits to the number of event pages and that will limit how fine your control can be.
I was expecting that would be it. In this case, theres any plugin, tutorial or guide to do the NPC schedule? I've been trying to find one but I'm not getting anywhere.
you can do it without plugins if you figure out the back and forth of every NPC.
look around in the forums... the matter has been discussed before.
I was expecting that would be it. In this case, theres any plugin, tutorial or guide to do the NPC schedule? I've been trying to find one but I'm not getting anywhere.
You should adjust your understanding of NPCs in RPG Maker.
An NPC that appears in your game in 3 different places isn't the same event with a schedule, but there will be 3 individual events that look like your NPC.
Your NPC can be a hundet times on a map, but due to conditions, only one of them will show at once, so it seems as they have a daily routine.

Once you get your point of view right, you won't have any trouble to set up your "schedule".

To answer your specific questions:

1. You set up your character on every map you need them and set up the conditions that have to be true to show up. Use several event pages, if this character will do different things (or is invisible) in specific situations.
1739647923077.png


Event pages will be checked from highest to lowest, and the first one, that has true conditions, will be executed. All other will be ignored. So, the right order and the right conditions matter.

2. You said you have states already that will indicate specific times of the day. Personally I wouldn't use switches, but an upcounting variable.
You are asking for already running routines when the player is in different places. That won't work this way, as maps and events aren't active when you aren't there. Your conditions have to reflect the ongoing routine. If your 3-hour-switches aren't enough to do that, you have to split them up further.

For example:
You might want an NPC to cook, eat and do the dishes between 6-9pm.
Your problem might be, they'll always start at the beginning, when you enter their home, as you only have an "evening" Switch.

If you have an "hour" Variable instead, you can set your event up like
If Hour Variable = 18, make the Event cooking
If Hour Variable = 19, make the Event eat
If Hour Variable = 20, make the Event doing dishes.

In theory, you could use even smaller time periods and define their actions on a second or even frame specific base.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-npcs-schedules.175486/