Deleting an event, not just erasing it

Hello,

I m looking for a proper way to delete an event from a $gameMap object. I can properly erase my events, however the events I create stack into the events array of $gameMap...

As I plan to create thousands of dynamic events (not at the same time) I would like this array to stay small, storing only the live events (I loop on them all at some point to clear them up).

How can I do that?

Thank you for the feedback
That completely depends on how you create them dynamically. You need to remove them in the same way as you add them.
That completely depends on how you create them dynamically. You need to remove them in the same way as you add them.

I use $gameMap.copyEventFrom() and I have a bunch of maps which are event stores from which I source the events.
That is not a function in the default scripts, so you have created it yourself or added a plugin that created it. Therefore you will have to add a corresponding function to do the reverse.
That is not a function in the default scripts, so you have created it yourself or added a plugin that created it. Therefore you will have to add a corresponding function to do the reverse.

You are right it seems it is implemented by OrangeCustomEvents, I will see if it provides something that goes beyond erasing the event, I will keep the topic updated.
So, I did not find a proper way to achieve that.

The OrangeCustomEvents plugin functions deletes the event from $gameSystem but not from $gameMap. I tried doing so by removing the event from the underlying _events array in $gameMap. It does not work because the Event IDs are actually used as straight offsets for the _events array by the Game_Map functions. Using pop() shifts the events and it goes messy when the engine accesses undefined events when it should not.

Maybe it's possible, but not without hooking more functions...

I will resort to creating intermediate "flushes" on map change; emptying ALL the events should actually be more consistent and should work. 'will try later.

I've moved this thread to Plug-In Support. Thank you.


May have to ask the creator of the plug-in for that feature then, or write it yourself.

Also don't double post, which is posting below yourself 2x. I know when you quote it defaults to a new post, so be careful of that. And for that reason we suggest using the @ symbol instead of quoting posts.
Just an update: I found a solution, the details are in my post here:

Orange Custom Events

Original thread: https://forums.rpgmakerweb.com/threads/deleting-an-event-not-just-erasing-it.93743/