Making a gravestone event on death that holds player xp.

Without any script calls I have created a mess of a system to place a gravestone where I was knocked out. I am using a "call common event" that saves variables x and y based on my location on knockout. It also sets a variable for the map I was knockout out on. It clears the knockout states then moves a event that holds the graphic and pick up options for the gravestone to the saved location. last it transfers me to my last saved check point.

I'm just testing it to see if I can get the gravestone to stick between maps and it works unless I die more than once on different maps. At that point it puts a Gravestone on each map at the x and y set by my variable.

Right now when I load in I can move to the 2nd map and lose a fight taking me back to 1st map(where the checkpoint is) then walk back and the gravestone moves back to my last known knockout spot during the transfer to map 2.

I was reading online of event spawn scripts to move a event to a different map but couldn't get them to work for XP. I feel like if I only have one event that holds the gravestone and moved it somehow to the map I was knocked out on it would fix the problem I'm having. Right now though I planned to just copy the event on each map and have it invisible till active. This works until it places the gravestone where I died and is no longer running in parallel process and swaps to action button on event page 3. Since its no longer in parallel process i don't think i can turn it off without clicking on it.

any tips would be appreciated I'm still new to this so take it easy on me if I'm being dumb.


Putting the parallel processing back on in event page 3 and adding a conditional branch checking if the C buttons being pressed fixed my problem but still would like to know if there is a script for xp to make my life easier.
Do you need to be able to find every single spot where you character died? I mean, if it died on 10 maps, all of them should display an event that marks the spot, right?

Perhaps you should look for a script that copies predefined events. So you'd just need to create a basic event where the player will never see it, like some map with those event templates only. Then the script would copy it and place it at the specific coordinates on each map. This would be done via a script call.

Right now I can't think off any specific script that might fit the description, but I suspect I posted some sort of copy events script either here or on Save-Point.
For this I'd like it to just remember the last spot I died. If I would die again trying to get the gravestone I'd like it to forget the old event and place a new one with the new lost xp. Its working now but every transfer to a new map has to call a common event plus update my current mapID and every map has to have the event hided somewhere. along side every battle having to have a call to the common event if lost.

I'll see if I can find that script for sure. If I can shave off some of this it would be a big help. The main common event saves most the info I need to place the gravestone where it needs to go so just being able to copy/move the gravestone event to the mapID I died on would make it easier to implement. I think even with the script I'd still have to update the location when entering a new map unless I can have the script check variables I set somehow. I don't know all the in's and out's to what I can and can't do when it comes to scripts and script calls.

ideally I'd have the gravestone event on a stand alone map like you said and just call for it to be copied to the spot I died and just have the map transfers check and update the location if the map is the one i died on.
I have published the KLastDefeat XP script here on the board. Once it's been approved by a moderator, you can check it out and see whether or not it fits your gaming needs.

Original thread: https://forums.rpgmakerweb.com/threads/making-a-gravestone-event-on-death-that-holds-player-xp.179683/