Yanfly Equip Core - How to save an actor's equipment to a variable, and then later have them re-equip every equipment within the variable

Hello!
So I'm attempting to create a system where an actor can have several equipment "sets" they can swap between without having to manually re-equip every single piece of equipment. For example, if there's equipment that's focused on killing fire enemies and water enemies, the player can simply swap between the Fire set of equipment and the Water set of equipment.

I've already tried two different methods, neither of which have worked:

Saving the First Equipment Set:
var actor = $gameActors.actor(1)
var equipset1 = JsonEx.makeDeepCopy(actor. Equips)

Saving the Second Equipment Set:
var actor = $gameActors.actor(1)
var equipset2 = JsonEx.makeDeepCopy(actor. Equips)

Equipping Set 1 or Two:
actor. Equips = equipset1
actor. Equips = equipset2

The issue with this is that it would have absolutely no effect whatsoever - my set equipment would not change when trying to use that last piece of code.

The second method I tried is as follows:
1745416138410.png

1745416159883.png


This would just result in a crash.

Any suggestions / plugins that would help achieve what I'm after? Thank you 😀
Saving the First Equipment Set:
var actor = $gameActors.actor(1)
var equipset1 = JsonEx.makeDeepCopy(actor. Equips)

Saving the Second Equipment Set:
var actor = $gameActors.actor(1)
var equipset2 = JsonEx.makeDeepCopy(actor. Equips)

Equipping Set 1 or Two:
actor. Equips = equipset1
actor. Equips = equipset2
im assuming some autocorrecting is happening there, but that as is wont work. syntax errors aside, unless youre using those equipset variables within the same scriptbox or this is is plugin code and its all in one function, they wont exist when youre ready to use them. You want to save the set somewhere you can retrieve it later like into a game variable or onto the actor

Your second method is on the right track, but an actor's _equips is an entirely different structure than what gets returned by their equips(). you want to save their _equips and then set it back afterwards
Have you tried the Memorise/Restore Equipment calls from the MV / MZ Script Call List?

mvzscl-equip-memory.png
Have you tried the Memorise/Restore Equipment calls from the MV / MZ Script Call List?

View attachment 338434

You're an absolute legend, thank you so so much! This worked perfectly even with the Equip Core plugin, cheers 😀

im assuming some autocorrecting is happening there, but that as is wont work. syntax errors aside, unless youre using those equipset variables within the same scriptbox or this is is plugin code and its all in one function, they wont exist when youre ready to use them. You want to save the set somewhere you can retrieve it later like into a game variable or onto the actor

Your second method is on the right track, but an actor's _equips is an entirely different structure than what gets returned by their equips(). you want to save their _equips and then set it back afterwards
Thank you for your time too, was also beneficial information that will help me out in other areas later on. Thank you both!

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-equip-core-how-to-save-an-actors-equipment-to-a-variable-and-then-later-have-them-re-equip-every-equipment-within-the-variable.177168/