First sorry for the bad English, I just woke up, need to take care of my kid and cant check for misspellings now... lol
How do you have your time system set up? Are you using a plugin for it?
Currently I have two options for it, one is a common event I made using a time/weather/season system from "XIIIthHarbinger" I found on steam as template, the other option is a plugin, if I remember well it's from MOG.
You can't run events that aren't on your current map for the simple reason that the engine doesn't load other maps and their events. What you are asking for can still done with auto-events on the map where your NPC goes to the chest by simply checking the time when you enter the map and either make the NPC disappear, move him to where he's supposed to be, or move him to the chest. It will require some work to event, but it's not that hard and it's certainly not impossible.
I already did the event to check the time and turn a switch on, the npc does his things than disable that switch and goes off, for the shop its okay the way it is, but I plan to make other events with a certain difficulty to catch them up, like a NPC travelling a map and u need to catch them up for some reason, but a battle can happen and the npc will still travel while u are fighting, or even cheating him coming from the opposite way in the last moments and so...
I was afraid of spend too much time in a thing I don't knew if can be done since I plan to submit it to the RPG maker anniversary event, but if u guys said it can be implemented I'll try my best to do it.
The way that games typically implement this is by cheating a little bit.
Basically, players really don't care about the edge case of "what happens if I show up in the middle of him walking across the map". What they care about more is being able to reliably find NPCs, and, to a lesser extent, knowing that NPCs have a little life of their own. So what I'd recommend is the following:
Set up a scheduler event. When the player enters the map, it checks the time
If it's before 6:00 when the player enters the map, the trader event is marked as invisible and uninteractable.
If it's between 6:00 and the trader's end of shift when the player enters the map, the trader is already at the chest (and interactable and everything)
If it's after the trader's end of shift, the trader is gone.
So that solves like 70% of the situation right there, but presumably you want to have a bit of a living world going on, and that means that people should move when the player can see them. So, add another couple things to your scheduler:
At 6:00 exactly, the trader is teleported to the edge of the map, made visible and interactable, and set to path to the treasure chest.
At the end of his shift, the trader is set to path to the map's edge. When he touches it, he is made uninteractable and invisible.
That covers the remaining 29% or so, getting you 99% of the way to having a perfect setup, but without having to figure out how to interpolate your trader's movement if the player shows up mid-walk (which would be a LOT more effort to do than the stuff I just outlined, which is easy peasy).
I already have that 99% set up, but yeah, I'm planning to have a live world, as much as I can, that's the main goal of my project. so it's not that alive when, if I enter the map 5:50, when it reaches 6:00 the trader suddenly materialize in the chest, or if I set up the switch to trigger if the hour is between 6 and 7, and I enter the map 6:50 for example, the event starts from the beginning, and finish 7, before executing all commands in it...
But like I said, if u guys says it can be implemented I'll work hard on it!
🙂