Any ways for events to process out of maps?

So, I'm trying to to make an apple tree from where players can take them and leave the tree without a single apple left. I want these the apples to regrow in about 10-20 minutes in real time. Unfortunately, the processing timer stops entirely when the player leaves the map.


So uh, any ideas?
You can try to set the timer via parallel process in common event
You can try to set the timer via parallel process in common event

I probably should have specified, sorry about that.


I want to make multiple amount of these across the game. (RPG is open-world). It would make it painful to add each one as a common event.


Unless I just don't know the right way of doing it.
There is a way, but it will require a script. More specifically, you require a self-variable-script.


The Self Data Suite support thread - RGSSx Script Support - RPG Maker Forums


Have each event store a time-number of when it should change in its self-variable and have it with a parallel process checking the number to the current time number - if greater reset the event (don't forget a good wait on the parallel page or you'll lag your game.


Then use a common event to count the time variable up (or use a time script).


Whenever the player returns to a map, the parallel processes will check if enough time has elapsed, no matter how long the player was out of map.


This will only work with counting up however, so you should not count seconds - the mechanic will fail if you ever have an overflow or reset on the time variable
There is a way, but it will require a script. More specifically, you require a self-variable-script.


The Self Data Suite support thread - RGSSx Script Support - RPG Maker Forums


Have each event store a time-number of when it should change in its self-variable and have it with a parallel process checking the number to the current time number - if greater reset the event (don't forget a good wait on the parallel page or you'll lag your game.


Then use a common event to count the time variable up (or use a time script).


Whenever the player returns to a map, the parallel processes will check if enough time has elapsed, no matter how long the player was out of map.


This will only work with counting up however, so you should not count seconds - the mechanic will fail if you ever have an overflow or reset on the time variable

I downloaded the the file and got 17 different scripts in the folder. I'm guessing I needed the Event (Self Switches)  I'm trying to play around with it but it ain't doing much for my goal. Which scripts (and if you don't mind commands) do you require/recommend I use?
I know that it does nothing by itself - it's a support script that needs to be used with script commands in eventing, but for cases like these the self-variables are really vital as a method.


Unfortunately this requires more than a few minutes to setup, and I'm really short on time this month - if the description above is not enough for you to understand what to do, you'll have to wait until someone else can get that into event code.
I know that it does nothing by itself - it's a support script that needs to be used with script commands in eventing, but for cases like these the self-variables are really vital as a method.


Unfortunately this requires more than a few minutes to setup, and I'm really short on time this month - if the description above is not enough for you to understand what to do, you'll have to wait until someone else can get that into event code.

Regardless, thanks a bunch for introducing this script to me. If anyone has a more simple answer for a dummy like me that would be nice. But for right now I'll be playing around with this script and try to look up some tutorials and tips on it.

Original thread: https://forums.rpgmakerweb.com/threads/any-ways-for-events-to-process-out-of-maps.56383/