is it possible to reset an event?

is it possible to reset an event?
let me explain better, I would like to make a game where the enemies are physically on the map, and do not appear in random mode
now when I face an enemy after the battle I activate a control switch, and the enemy disappears
I would like to make it so that when I exit the map, they reset and reappear
It is possible. Instead of using a switch (which will stay on when you transfer to another map), use the 'erase event' option after winning the battle. That way the event will disappear, but will be back if the player leaves the map and then comes back.
Yes - there have been other threads about this.

This post links to code options as well as shows how to do it using just events.


The only trick to using Erase Event as @hiddenone mentions is that if you're using Battle Processing to use the traditional battle system, that counts as leaving the map, and the enemies will reappear when you come back.

It's a little hard to tell because your event screenshot isn't in English - you can change the language for screenshots by right-clicking RPG Maker in your Steam library, going to Properties, and changing to English.
...

It's a little hard to tell because your event screenshot isn't in English - you can change the language for screenshots by right-clicking RPG Maker in your Steam library, going to Properties, and changing to English.
It starts the battle and then activates a switch to make the pig disappear, likely to trigger the second page.

@pier85ra
Instead of using the switch, you need to use "Erase Event," as was suggested. You haven’t set conditions for escape or defeat — does that mean there aren't any conditions like that?
Instead of using the switch, you need to use "Erase Event," as was suggested.
Again, that's only a good suggestion if it's the only enemy you can fight on this map.

Otherwise, fighting one enemy will respawn all others.

See the post I linked to for ways (both code- and event-based) to make all enemies respawn only when you transfer away and back to the map.
The only trick to using Erase Event as @hiddenone mentions is that if you're using Battle Processing to use the traditional battle system, that counts as leaving the map, and the enemies will reappear when you come back.
Are you sure?
Because I use on map encounters that resolve with an erase event and enemies don't respawn until you reload the current map.
I am not sure if it behaving in (imo) the expected way was caused by maybe Yanfly's core plugin or something , but at least in my game events are not restored when transitioning out of battle.
Not sure maybe Yanfly's core plugin or something changes the behavior to act that way, but at least in my game it functions properly.
yeah, just gave it a quick check. in a clean project, the return from battle doesnt cause erased events to return

EDIT: without looking at the JS, ill assume they dont respawn unless the map changes, or the map doesnt refresh when returning from battles. neither the return from battle nor transferring to the same map respawns them
@TheAM-Dol @Robro33 Well, I guess I'm not sure, and the OP should just do what @hiddenone said!

It's not a technique I've ever used personally, but I was given to understand from old posts by some coding elders that events would be un-erased any time you changed to the battle scene.

It's what I get for not looking it up myself 😛 Thanks for the correction.
I tried using a simple "cancel event", inserted after the battle
basically that monster disappears, the others remain, so they reset only after you exit the map
and that's exactly what I needed, thank you very much for all the help you're giving me

Like this

Original thread: https://forums.rpgmakerweb.com/threads/is-it-possible-to-reset-an-event.172314/