Is technically possible to run an event on other map than the one you are in?

Status
Not open for further replies.

Lucas7eixeira

Villager
Member
Joined
May 1, 2019
Messages
24
Reaction score
3
First Language
portuguese
Primarily Uses
RMMV
I need to place an event, a trader that appears every morning (6AM in the time plugin) in a map, basically he enters the map, walk till the place he set shop and take some itens in a chest where the player can let some itens to sell automatically, wait a certain number of time, than walk the way out of the map. Seens easy, but... I need it to occurs even when I'm not at the map, like, if I enter exactly 6AM he will be entering the map too, but, lets assume he needs 30 minutes "in game" to walk till the place he set shop, so if I enter the map 6:30AM he will be in that place and not entering the map, or if I enter 6:15AM he will be half way from that place. Can it be build? Any ideas how?
Thx in advance! :)
 

MushroomCake28

KAMO Studio
Veteran
Joined
Nov 18, 2015
Messages
1,886
Reaction score
3,359
First Language
English
Primarily Uses
RMMV
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.
 

Uzuki

Kawaii on the streets, Senpai in the sheets
Veteran
Joined
Aug 18, 2012
Messages
1,884
Reaction score
1,274
First Language
English
Primarily Uses
RMMV
How do you have your time system set up? Are you using a plugin for it?
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
310
Reaction score
203
First Language
English
Primarily Uses
RMMV
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).
 

Lucas7eixeira

Villager
Member
Joined
May 1, 2019
Messages
24
Reaction score
3
First Language
portuguese
Primarily Uses
RMMV
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! :)
 

Dreadshadow

Lv 38 Tech Magician
Moderator
Joined
Mar 2, 2014
Messages
3,843
Reaction score
2,507
First Language
Greek
Primarily Uses
RMMV
OP Question, answering without even reading.
No you can't. But you can make a system that gives you the delusion that it works that way.
It must work on EVERY map, maybe calling a Common Event or something on load.
So you should set up a map Event that must run in Parallel and call the Common Event. Make sure you don't create an infinite loop without wait commands, because you will have performance issues. Every almost 60 frames per second, the common Event will be called. On EVERY map. Because this event will exist on EVERY map, except maybe cut scenes (you didn't thought of that yet didn't you).
So there you got it.
 

Lucas7eixeira

Villager
Member
Joined
May 1, 2019
Messages
24
Reaction score
3
First Language
portuguese
Primarily Uses
RMMV
Another point is the chest to place itens to sell automatically. I think I'll need to implement that chest in the common events if I need the itens to be sold even if I'm not at the map at 6AM, right? It will be more or less like the basket to sell itens in the game "harvest moon", if u played it.
 

Dreadshadow

Lv 38 Tech Magician
Moderator
Joined
Mar 2, 2014
Messages
3,843
Reaction score
2,507
First Language
Greek
Primarily Uses
RMMV
Common Events are what they are. Common. You can call them from anywhere.
Haven't played it, but I know the game.

Divide and Conquer.
A common Event to manipulate time.
A common Event to manipulate the chest, maybe checking the time, I don't know.
You are on a good road.

If I may ask, what is your experience on RPG Maker in general?
 

Lucas7eixeira

Villager
Member
Joined
May 1, 2019
Messages
24
Reaction score
3
First Language
portuguese
Primarily Uses
RMMV
OP Question, answering without even reading.
No you can't. But you can make a system that gives you the delusion that it works that way.
It must work on EVERY map, maybe calling a Common Event or something on load.
So you should set up a map Event that must run in Parallel and call the Common Event. Make sure you don't create an infinite loop without wait commands, because you will have performance issues. Every almost 60 frames per second, the common Event will be called. On EVERY map. Because this event will exist on EVERY map, except maybe cut scenes (you didn't thought of that yet didn't you).
So there you got it.
Thx for pointing some directions here, that's more or less the way I'm thinking to implement it.
For now I'm not thinking in any cut scenes, just a demo to see if the game mechanics work fine.
And yeah, I already aware of the necessity of the wait commands, learned it the hard way! XD
 

Lucas7eixeira

Villager
Member
Joined
May 1, 2019
Messages
24
Reaction score
3
First Language
portuguese
Primarily Uses
RMMV
Common Events are what they are. Common. You can call them from anywhere.
Haven't played it, but I know the game.

Divide and Conquer.
A common Event to manipulate time.
A common Event to manipulate the chest, maybe checking the time, I don't know.
You are on a good road.

If I may ask, what is your experience on RPG Maker in general?
made some little projects for fun with some friends maybe a ten years ago when i was a kid, not much complicated, just some "meme" games when the internet connection in the lan house we played was down... lol
but I'm learning to code in python and Javascript now, and made a game designer course a few years ago, already have some experience in "game maker" and "construct2" engines...
 
Last edited:

Dreadshadow

Lv 38 Tech Magician
Moderator
Joined
Mar 2, 2014
Messages
3,843
Reaction score
2,507
First Language
Greek
Primarily Uses
RMMV
Okay. I asked because I made a game that is introducing the most important things of MV and it could save you some time playing it. But I am not sure, since you know how to do stuff. I got link in Signature. [1b] is the one for you.
As for trying things before building, I find it a smart move.
Finally, and I am sorry I gotta do this...

@Lucas7eixeira , please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


You can use Edit to add stuff to your post.
 

Lucas7eixeira

Villager
Member
Joined
May 1, 2019
Messages
24
Reaction score
3
First Language
portuguese
Primarily Uses
RMMV
Okay. I asked because I made a game that is introducing the most important things of MV and it could save you some time playing it. But I am not sure, since you know how to do stuff. I got link in Signature. [1b] is the one for you.
As for trying things before building, I find it a smart move.
Finally, and I am sorry I gotta do this...
[dpost]@Lucas7eixeira [/dpost]
You can use Edit to add stuff to your post.
For sure there's something I can learn on your game, I'll give it a try as soon as I can. And for the double post thing, sorry, I was already replying your first comment when u did the second one, I'll pay more attention on this next time. ;)
 

Dreadshadow

Lv 38 Tech Magician
Moderator
Joined
Mar 2, 2014
Messages
3,843
Reaction score
2,507
First Language
Greek
Primarily Uses
RMMV
Yes don't mind. You can use the edit button to add stuff, or even report a post of yours if you accidentally double post.
You are not into trouble, just avoid doing it from now on. :)
 

Dreadshadow

Lv 38 Tech Magician
Moderator
Joined
Mar 2, 2014
Messages
3,843
Reaction score
2,507
First Language
Greek
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Babbaditch Finster and the Seven-Sided Cube has got to be one of my favorite classic games that didn't exist when I was kid, or ever
My tutorial about frankenspriting is now online :3 Any topic you would like to see next?
Stuffing three people in a room and thinking they'll study together is so wrong XD I don't get how people do group studies. We just end up gossiping about everything except studying lol
Been parallax mapping nigh all night. :D
2nd character based on the same random inputs

Forum statistics

Threads
93,389
Messages
911,915
Members
122,891
Latest member
dokdo2005
Top