Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Erase Spawned Event?

Save-Point

Full Version: Erase Spawned Event?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
H'lo
I'm using a Yanfly Engine Ace Spawn Event Script adaptment for RmXP.
( Script HERE )
It works fine but I've noticed that erasing these events won't work.
Since I can't make them disappear with Self Switches (I need to make them spawn more than once, and they would spawn already Self Switched)
I'd really need to use the common 'erase event' option.
Am I doing something wrong? Is it impossible?
Thanksss
It is a pretty small script.  It basically 'duplicates' events rather than spawning custom ones like the script SephirothSpawn crafted.  I use that one to good effect as I can add what switches, charsets, speed, etc to generated events.  Again, this merely does a copy/paste of existing events.

BUT... I digress.

To delete an event on the current map using a script call, you need to know the event ID of that newly spawned event.

Let's assume you have a map with two events, the first is EV:001  and the second is EV:002.  Make them visible with some characterset graphics.... Aluxes or something.  The first will be set up to make your newly spawned event, the second will erase it.

THE FIRST EVENT will have a script call like this:  spawn_event_location(8, 8, 2)
This will make a duplicate of the second event, and paste it in location 8,8 of the map.

THE SECOND EVENT will have a script call like this:  $game_map.events[3].erase
This performs the erase, but of an ID number (3) which doesn't exist UNTIL it the event is generated.

This will work the first time.  But each time you generate a new event, even after erasing, the ID number increases by one.  So if you use this to make an event  ala event 003, then erases it... the next event will be event 004.

You will have need to keep track of the map events being created in this manner in some fashion and use the above suggested script call to erase your desired events.

Oddly, if you copy an event that has [Erase Event] map event in the code,  triggering the duplicate erases the ORIGINAL!??  Creating the [Erase Event] map event must link it by ID to the event itself... so copying Event 12 with [erase event], to make the new event 15, the [erase event] command in 15 turns out to still linked to event 12. ROFL!
I see. I should then keep count with a certain variable and use its value to erase this event adding 1 each time.
Still, as you said Copied Events trigger the og one. Ha ha
And furthermore, making two events to create and erase a third copied event would be too complex since I needed the event to be erased by the player, and this event would appear randomly, multiple times and in different maps during the game. Welp nm.
It's my fault I programmed each damn map with this script without noticing it worked like that. SephirothSpawn felt too beefy but now I'm regretting avoiding it.

I guess I could also try the classic sandbox way, putting these events hidden in each map and make them pop out in the right place with [Set Event Location], then adding just [Erase Event] so that they would reset each time by exiting the map. Oof!