On-screen enemies respawning options? NEED HALP PWEASE

Having a blast with RMMZ i havent touched rpg maker in a long time but im making my first game and it's pretty sweet so far. im reallly stumped on something right now though. im working on having on screen battles, where an enemy with random pathing gets in your vicinity, it starts a battle. its going great so far. i also have a harvesting materials system going where you walk up to an event, it checks your inventory for a crafting tool, and gives you a random chance to collect stuff ala monster hunter. its working fine. however here is where im brutally stumped..

i would like the stuff (both enemies and mats) to respawn when the player rests at an inn. i understand now that using erase event would make them respawn on re-entering the map, so one idea is to have everything for a certain area on one huge map, and when you sleep, it takes you in and out of the map, respawning all the events, and maybe the exit of the map would be just straight to the overworld, but thats potentially a looooot of stuff going on in one map (lag city?)

another option i was toying around with is self switching to an empty page to make the event stop, in which they are able to stay gone when you leave the map, but i dont see how to bring all the events back at once. basically i have come to the conclusion that if i want EVERYTHING to respawn under one triggering event but NOT when going in and out of the map, i would have to have a switch for every single monster and harvestable, and would have to list every single one of the switches on the sleeping event to respawn them. or i could just reuse the switches for every new dungeon, but i also plan on having a lot of dungeons with random loot ala skyrim etc., so it would basically be pointless to have all those switches and might as well give up and accept that stuff is gonna respawn when the player leaves the map.

another option i briefly looked into is frame based respawn timers, which would eliminate most of my pain, but i just dont know how i feel about making players wait in real time for stuff to respawn. it could be cool, and if i cant find a simple solution, i might just cave and try it.

any suggestions? i dont want huge maps, i like the feeling of going in and out of maps. especially for stores and stuff... like i dont want everything respawning everytime the players exits the map, its just not how i envision the game. i REALLY appreciate any advice y'all have... i did about 10 hours plus working on this system and lurking youtube/google/reddit/this forum and someone please tell me there is omething super simple that im missing LOL. i really wanted the natural high of figuring this one out on my own... but from the lurking ive done, i figured you guys know these systems so well i might as well give up and ask, maybe save some precious time or at least just get opinions on what to do if i really am this limited. THANKS SO MUCH IN ADVANCE!!!
hi
you could create a third event page which is active upon a single switch. That page would simply turn off self switches on all events with that page.

Page 1 .. runs event, ends with self switch.
Page 2 .. self switch on(completed event).
Go to bed... turn on switch (reset)
Page 3 .. on switch(reset) runs event to turn off self switches.
Turn off switch(reset).. wake up from bed.
you could create a third event page which is active upon a single switch. That page would simply turn off self switches on all events with that page.
the issue with this is that the events would only reset when enter that map.
having only 1 control switch would only work for 1 map since would need to turn off the control switch in order to do the fights. so you would need another switch for every map.

OP had a thought that could work of changing the self switch to regular switch.
but dont actually need regular switches, can use script calls to effect self switches from other events on any map.

....(looking for reference about multiple switches all at once since that was the original ordeal trying to avoid).... and if my partial understanding is correct it will only require 1 script call per map (possibly just 1 period). i hardly understand scripts and code but heres a link that im getting this info from.
I would suggest you decide what works best for you and your game.
You wanted a switch to reset all enemies and harvest.
If you sleep, would only one map reset or all maps?
Having one switch reset all the enemies could make sense, but only you can decide that. Having one switch to reset enemies and another to reset harvest is possible.
You aren't limited, and there's more than one way to achieve similar results.
From a creative point of view, the end result is all that matters-- how you get there is your own method.

Hope it helps!
the issue with this is that the events would only reset when enter that map.
having only 1 control switch would only work for 1 map since would need to turn off the control switch in order to do the fights. so you would need another switch for every map.

OP had a thought that could work of changing the self switch to regular switch.
but dont actually need regular switches, can use script calls to effect self switches from other events on any map.

....(looking for reference about multiple switches all at once since that was the original ordeal trying to avoid).... and if my partial understanding is correct it will only require 1 script call per map (possibly just 1 period). i hardly understand scripts and code but heres a link that im getting this info from.
Wow! This might actually be the way. I definitely don't feel like it needs to be map dependant, but this is kind of exactly what I was looking for, a way to reset multiple switches or all switches under one command, and even better, self switches! It might make using self switches on events other than "respawning" events tricky or impossible but I'm not experienced enough to foresee that, so I'll have to just give it a shot. So far I only have to use self switches on my enemies and materials, so I should be alright. I'm gonna check this out later after I get off work, I'll let you know if I can get it working

I would suggest you decide what works best for you and your game.
You wanted a switch to reset all enemies and harvest.
If you sleep, would only one map reset or all maps?
Having one switch reset all the enemies could make sense, but only you can decide that. Having one switch to reset enemies and another to reset harvest is possible.
You aren't limited, and there's more than one way to achieve similar results.
From a creative point of view, the end result is all that matters-- how you get there is your own method.

Hope it helps!
The problem is, I haven't found out how I could make a everything respawn under one switch. Unless you use a unique switch for every single enemy. if everything is designated under the same switch, such as the switch being a condition, everything turns on, or off, under that switch. If the events self switch to an empty page, they "turn off", but then turning them back on with one switch becomes an issue unless I set them all to parallel, or autorun with a loop, that has a branch to check if the "respawn" switch is on, which I'm trying to avoid doing to keep the logic as clean as possible and keep the lag as low as possible. Maybe I'm just overthinking the consequences of having those "dead enemy" event pages set as autorun. The only other way would be to turn them off is with erase event, in which case they all respawn when you re-enter the map. I tend to overthink simple things and I'm relatively new to rpg maker. Idk. I just want to do what I can to achieve my mission in the cleanest way possible. But what tiamat said could do the trick if I can get that script to work.. all enemies will self switch to a "dead enemy" or "empty harvestable" page (empty page) that has a self switch condition, and then when you rest at the inn, it resets all self switches to off, causing the first page, aka the "alive" page, the only page without self switch conditions , to start running on all the enemies and ingredients. At least.. I think that's how it would work
Page 1 runs your event, however you set it up to run and SET self switch (A, B, C, D) -- which activates Page 2 with self switch on and stops that event.
Page 3 will only run if switch(name it Enemy Respawn or whatever) parallel. The Page will turn OFF self switch.
When you go to bed, turn on switch(Enemy Respawn).
They will all remove self switches, then you turn off switch(Enemy Respawn).. leaving them at the 1st Page.. ready to go again.
Page 1 runs your event, however you set it up to run and SET self switch (A, B, C, D) -- which activates Page 2 with self switch on and stops that event.
Page 3 will only run if switch(name it Enemy Respawn or whatever) parallel. The Page will turn OFF self switch.
When you go to bed, turn on switch(Enemy Respawn).
They will all remove self switches, then you turn off switch(Enemy Respawn).. leaving them at the 1st Page.. ready to go again.
hmmm i think im picking up what you're putting down. im gonna give it a shot. if i cant figure it out, i suppose i'll post screens of whats going on. i appreciate the help.

EDIT
OMG IT WORKS! it does precisely what i wanted. it was just a bit too big brain for me to figure out, as a newb. i was pretty close, but i didnt reach the point where i thought to have a parallel page with a switch condition that turns off self switches, and then to toggle that main switch twice. thanks a bunch. i feel like li learned a lot with this simple lesson, and now everything works exactly the way i wanted it to!
OMG IT WORKS! it does precisely what i wanted. it was just a bit too big brain for me to figure out, as a newb. i was pretty close, but i didnt reach the point where i thought to have a parallel page with a switch condition that turns off self switches, and then to toggle that main switch twice. thanks a bunch. i feel like li learned a lot with this simple lesson, and now everything works exactly the way i wanted it to!
Good job, friend!
Happy game making!!
Page 1 runs your event, however you set it up to run and SET self switch (A, B, C, D) -- which activates Page 2 with self switch on and stops that event.
Page 3 will only run if switch(name it Enemy Respawn or whatever) parallel. The Page will turn OFF self switch.
When you go to bed, turn on switch(Enemy Respawn).
They will all remove self switches, then you turn off switch(Enemy Respawn).. leaving them at the 1st Page.. ready to go again.
If you have rest points in their own maps, like an Inn room or something, is there a way you could get this to respawn all items/enemies in all other maps? Right now for example, if you have a big map with lots of items/enemies and you activate them all, then go to the Inn map and rest, then return to the big map, the reset will not have activated because it was triggered in a separate map.
, is there a way you could get this to respawn all items/enemies in all other maps?
because the other maps do not exist while you are outside them, you'll need one switch per map.

then instead of having the reset on the bed, you have the reset on one parallel process on each map.
that event would be
wait (3 frames)
switch map-reset-switch OFF
erase event

you'll need that 3 frame wait to have all events on that map enough time to react to the reset-switch for that map before it is switched off to wait for the next reset, and the erase event will make sure that the reset is checked again each time you enter.
because the other maps do not exist while you are outside them, you'll need one switch per map.

then instead of having the reset on the bed, you have the reset on one parallel process on each map.
that event would be
wait (3 frames)
switch map-reset-switch OFF
erase event

you'll need that 3 frame wait to have all events on that map enough time to react to the reset-switch for that map before it is switched off to wait for the next reset, and the erase event will make sure that the reset is checked again each time you enter.
Yes this is exactly what I ended up doing. It took me awhile to realize that when you hit a switch on another map it doesn't actually change the page of events on a separate map. So basically you have two switches, I call one of them well rested and the other one respawn toggle. When you rest at the end it flips the well rested switch on. When you get to the map with enemies and items on it, if well rested switch is on, there's an event that runs, it toggles the respawn switch on and off, which switches the enemies over to their respawn page that turns off all self switches, and then turning that switch off flips them back to their first page or the "respawned" page, and then finally the well rested switch is flipped off.
When you rest at the end it flips the well rested switch on. When you get to the map with enemies and items on it, if well rested switch is on,
that defeats the purpose of one switch per map.
just check:

if you work this way, only the first map you enter with well-rested will be reset, if you go to a second map with the same principle you will no longer trigger the reset if well-rested is now off.
this behaviour (only the next map resets) would be available with only the well-rested switch, no need to use the map switches.

what I meant is that the bed-event turns on ALL map-based reset switches, and the parallel process I described runs all times when entering the maps.
That works because with that structure, multiple uses can be ignored - if the player didn't go back to the bed using the reset parallel will have no effect because the map-switch is already off.
that defeats the purpose of one switch per map.
just check:

if you work this way, only the first map you enter with well-rested will be reset, if you go to a second map with the same principle you will no longer trigger the reset if well-rested is now off.
this behaviour (only the next map resets) would be available with only the well-rested switch, no need to use the map switches.

what I meant is that the bed-event turns on ALL map-based reset switches, and the parallel process I described runs all times when entering the maps.
That works because with that structure, multiple uses can be ignored - if the player didn't go back to the bed using the reset parallel will have no effect because the map-switch is already off.
Makes sense and works for me, but a bit unfortunate if you have a lot of maps (I have roughly 5-8 per area, as I don't like making enormous maps). I guess without using plug-ins, this is really the only way to go. Many thanks.
that defeats the purpose of one switch per map.
just check:

if you work this way, only the first map you enter with well-rested will be reset, if you go to a second map with the same principle you will no longer trigger the reset if well-rested is now off.
this behaviour (only the next map resets) would be available with only the well-rested switch, no need to use the map switches.

what I meant is that the bed-event turns on ALL map-based reset switches, and the parallel process I described runs all times when entering the maps.
That works because with that structure, multiple uses can be ignored - if the player didn't go back to the bed using the reset parallel will have no effect because the map-switch is already off.
Ahhhh of course. How did I not realize lol. Maybe I should post screens of my monster events and that could help clarify how I'm able to do this? If the well rested switch is always on, wouldn't this get in the way of the point of the system (when you win the battle the enemy leaves behind a corpse that you can harvest from, the goal is for it to stay as a corpse all the way until you rest, and I was only able to the system working the way I wanted to with having a different page for each "enemy state")
from what I understand the problem is not with your enemy event, but with the bed event and the reset event instead.
but yes, you should post screenshot of all events page types that you currently use if the descriptions above were not enough to get everything working.
and please include a description of both what you want the events to do, and what does not happen
so the first page is the alive or "respawned page, its random move, and when within activation square of 5, flips to the second page which is the "chase" page, where the enemy is chasing you, and if they touch you, you enter a battle. if you win the battle, it switches to the "corpse" page where you can attempt to harvest from the body, if you do, it gets turned to the "corpse disappeared" page. if the respawn toggle switch is on, it goes to the final page where it turns off all self switches. and then the respawn toggle switches off, causing it to flip to the "respawned" page. the save event location and delete event location is a separate issue that i have a found a weird workaround for that's working for now until i find a better way to do that (remembers the location when they are dead but respawns them to original location). so the big problem with it is that if you toggle the respawn switch on another map (at the bed), it doesn't change the page of events on other maps, meaning i may have to rethink how this whole system works, because as you described if the toggle switch goes on and off on one map, nothing on other maps will respawn.

Original thread: https://forums.rpgmakerweb.com/threads/on-screen-enemies-respawning-options-need-halp-pwease.139697/