Keeping event erased (temporarly)

i couldnt find a suitable title and that seemed like the most suitable one...ok, so... i made loads of events like in picture...


and i made a variable, the variable is randomly generating numbers between 1-20. so that when i teleport into the map ill have variable set into a fixed number.


when number is between number X and Y i get the event on second page.... (its part of the thought of having random generated resources in a map)


when i go in, random events spawn depending on the numbers i set for events, i collect them...event is gone.


the question is this, i want the resources to NOT spawn back after i collect them, UNTILL the variable change again....


so the process i want in other wordings would be like... variable is 15, i get to collect 3 out of 5 items for example, i leave...come back with those 3 resources gone BUT the other 2 still there.


untill the character goes to sleep or day ends for example (thats how i plan to make variable changes...sleep and day end) then i get new variable ....


any insight on how to achieve this??


Untitled.jpg
instead of using erase event, you need to make it multiple pages.


In your case, you'll need a third page for "no resource" or "resource taken" that uses another self-switch, and a fourth page that is conditioned to a general switch "reset events" - the same switch for all events on that map.


The fourth page should be autorun with commands to switch off all self-switches, effectively resetting all events.


And to trigger the reset you'll need an event that has the following commands in exactly that order:


- control switch "reset events" = ON


- wait (5)


- control switch "reset events" = OFF


You'll need the wait to give every other event time to reset its self-switches, and then you need to switch the reset of to allow those events to process again.


Depending on the lag of the map, a lower or higher wait might be required - you need to test that for each map
considering the wait and the lag you mentioned, can it be achieved during Sleep "wait" ?


for example, i place sleep, then wait 120 frames, so the lag subside in case there is a huge one? because im considering multiple maps with more resources and that might build up that said lag.


thank you very much for the previous answer

Original thread: https://forums.rpgmakerweb.com/threads/keeping-event-erased-temporarly.58514/