Eventing Question: Turn Switch OFF/ON after a certain time in game?

Hello everyone,


I have a question regarding eventing in MV.


Is it possible to have a (self) switch turn on/off after a certain time has passed in game?


The player should be able to leave a map, but as long as they are in game, the timer still ticks down. 


This requirement rules out the "Timer" event command. Besides, I don't want the timer to be visible.


Also The "Wait" event command won't work for me, because I need time spans >1 minute. 


For example,


Talk to an NPC, self switch is turned on, dialogue changes. But after 30 minutes I'd like to have the original dialogue back.


or


Pick a flower as crafting material, self switch is turned on, event page 1 is empty, so no more flower to pick/interact with. But after an hour has passed in game, the flower should have regrown, ready to be picked again. 


Is this possible without the use of further plugins? Just by eventing?


Or will I need to get a plugin for that?


Thank you and have a great day  😀
You can event a time system, it just needs a lot of waits and counting minutes and hours. simply use several wait commands one after another for that.


But especially if you're planning to use that on a lot of different events with different times, I suggest searching for the multiple timer plugin Shaz' wrote
...


Also The "Wait" event command won't work for me, because I need time spans >1 minute...



Just on this one point...


A 'Wait (60)' time (1 second...) can be put inside a loop; looping 10 times will result in a 'Wait' of 10 seconds. Having this loop in an outer loop 10 times gives a 'Wait' of 100 seconds. Another outer loop of, say, 6 gives a 'Wait' of 600 seconds, or 10 minutes. Any combination of loops of the sort can be envisaged to create 'Waits' of pretty well any length required. In the example above, simply changing the initial 'Wait (60)' to 'Wait (90)', for instance, would give a 'Wait' of 15 minutes.


Just sayin', hope this helps.
You could use Time Stamps for this.


Just do this once when the Mission Starts.


Control Variable1 = Game Time


Now you could use a paralell Event for checking or you check it once when you talk to the event npc when you return.


Control Variable2 = Game Time


Control Variable2 minus Variable1


Conditional Branch  Variable2 is more than 300 (60 =1 Seccond, 300 means that atleast 5 secconds has pass)


Maybe this simplyfied example helps you getting started and there are several ways to Event this slightly different depending on what exactly you do and need ingame.
'Wait (60)' loop



Thanks for the advice, didn't realize you could use loops like that.


This will cone in handy for sure!

Time Stamps



This is a nice a way to do it without help of a plugin.


The problem I see with this is that you would need to have a variable defined for each of these events.


If you want to use it for specific NPCs only this won't be an issue, because there is a limited number. 


For resource nodes, however, it would require a lot of individual variables, for basically the same event on different maps.


Thank you for the hint, I will experiment with that for the NPC-specific use.

I suggest searching for the multiple timer plugin Shaz' wrote





Yeah, you are right, eventing all of that seems to be quite a lot of work…


So I went out and searched for a suitable plugin. 


The MultipleTimer by Shaz would certainly do the job, yet after some digging I found another one that does exactly what I was looking for:


The Event Respawn Timers by Galv. The script seemed a bit more intuitive to me, but that is surely a matter of taste.


Just putting it here for anyone with the same objective.


Thanks for the help!  🙂

Original thread: https://forums.rpgmakerweb.com/threads/eventing-question-turn-switch-off-on-after-a-certain-time-in-game.65689/