Save an Actor's Data to be used later.

As the title suggests, I want to know whether or not it is possible to save a character's data to be used at a point later on in the game.

In my game, I want to create a feature that replicates the power Subaru has in Re:Zero, where whenever he dies he is sent back to a specific point in time. This would result in everyone but the main character having the same level, stats, items, etc. they would have had at that time, while the player character would retain their level, skills, and information they have gathered before dying.

I have looked around a bit but couldn't find anything that resembled what I want to do. Any help would be appreciated and I can give more information if needed.
Hi there!

In a rough way, if when you say items, you mean equipment, you can add the actor data into a variable using the script field of the variable:

1675381502763.png


JsonEx.makeDeepCopy($gameActors.actor(ID))

Replace ID with the actor id you want to "save".

Then, when you want to restore it, use the script call:

$gameActors._data[ID] = $gameVariables.value(ID)
Replace the first ID with the actor ID you want to restore.
Replace the second ID with the ID of the variable you used to store the actor data.

See if this can help you ^^
Hi there!

In a rough way, if when you say items, you mean equipment, you can add the actor data into a variable using the script field of the variable:

View attachment 252357

JsonEx.makeDeepCopy($gameActors.actor(ID))

Replace ID with the actor id you want to "save".

Then, when you want to restore it, use the script call:

$gameActors._data[ID] = $gameVariables.value(ID)
Replace the first ID with the actor ID you want to restore.
Replace the second ID with the ID of the variable you used to store the actor data.

See if this can help you ^^
It works! Another quick follow up question though, what about Gold and Items? Would it be a similar process?
It works! Another quick follow up question though, what about Gold and Items? Would it be a similar process?
I don't think you need to go so far as to do a deep copy for gold and items since they're simpler data structures. You'd just set your variables to $gameParty._items, $gameParty._weapons, $gameParty._armors and $gameParty._gold, then when restoring set those properties to the values held in the variables.

Original thread: https://forums.rpgmakerweb.com/threads/save-an-actors-data-to-be-used-later.154621/