How to make NPC's walk around the map they are on when you are on a different map

I have looked around on how to do this but i could not understand a thing, i am quite new to rpg maker mv and i wish to make something like Stardew Valley (with a twist), if anyone could help me that would be great, thanks 🙂
Seeing as nothing runs on maps you're not on, this is quite difficult to do in RPG Maker.

The easiest version I can see is by creating a universal 'clock' by having a parallel process tick up a variable by 1 every second, and then when you enter a map, have an event run that places the NPC's according to the value of this Variable ( the 'time' so as to speak).

So practically:
1. Make a common event Paralell Process in your database.
2. Set it up as follows:
In the 'Trigger dropdown box select 'Parallel process'
Select a switch that will start your clock. Use an Autorun event when your game starts to turn this to ON
3. In the main body of the Event:
With 'Control Variable' add 1 to the Variable you will use to keep time. (Let's call it 'Time')
Then select 'Wait' for 60 Frames. ( 1 second)
Then, if you want the clock to reset after a certain number of seconds, add a conditional statement that checks the value of 'Time'. If it's = to how many seconds you want a day/cycle to be, you reset it to zero.

So every 60 frames, or 1 second 'Time' will increase by one.

Now, on every map, you make an event that auto-runs, and checks the time against a bunch of conditional (if) statements, and moves the NPC's to their location based on the time, then removes itself by using 'Erase event' Which will stop this event from running again until you leave and re-enter the map.

So for example
If time=1-100 => put the Weaponsmith behind the counter of his shop.
If time = 101-200 => put him in the front of the shop.
If time 201-300 => don't show the weaponsmith.
basically you can't, because those other maps don't exist while you are on a map.
each map is loaded from default mapfiles on entering, and the map you leave is erased at that moment.

what ypu have to do is make a time system outside the maps (in the common events) that simulates what happens in time, and have the map you enter update itself based on that time information.

And this should not include step by step moving as that would be very difficult to calculate for more than a handfull of events on the map - it should be more like "in one hour two dozen fruits are produced" etc.
Thank you, sorry i have not checked it lately, assuming that the first method does not work does anyone know any game engines that are as simple as rpg maker but i can do that, thanks 🙂
assuming that the first method does not work does anyone know any game engines that are as simple as rpg maker but i can do that
I really doubt that such an engine exists at all, even as a complex one. And that would include stardew valley itself.

The problem is that it takes a lot of RAM and processing power to keep large maps going - that is the reason why games are splitting their world into maps, so that they don't have to keep everything going everywhere but can simulate and simplify what happens in other maps the player is not currently on.

Every game works that way, and if such a simulation doesn't work for you then because you made a mistake designing its logic and not because of an inability of the engine.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-npcs-walk-around-the-map-they-are-on-when-you-are-on-a-different-map.133058/