[MZ] Help memorizing/recalling a character's sprite.

Hello all.

I am currently trying to code turning the 4 party members into horses on using a "Riding Crop"
It's super easy to change each of the party member's sprites on the map to horses.
My question is: How do I recall the previous sprite once they unmount from the horses ?

I figure I would have to actually store each party member's current sprite somewhere using a scipt but I've been looking on and off for 2 days now and not finding anything on how to do that (unless there's something I do not understand).

One thing to note: My 4 party members are chosen by the players at start from a pool of 20 characters. So using "Actor1" is impossible as we do not know who was picked, and then in which slot such "actor" is in (Tho I can get actor ID from party members so I can fetch that). Most of my scripts uses "PartyMembers()[1].whatever" ("whatever" being hp, mp, state, currentclass().id, stats... etc).

So far to initiate the transformation into horses, I have this
1739941880607.png


I can also change the player (and only the party leader?) using the "set movement route" option...

But my original question remains... How do I store the original 4 sprites, and how do I recall them once my script gets them off the horses. I could really use some small script, it's probably me not finding which script to use to do this and in what variable type to store it and how.

Let me know if you did this before and have an Idea... preferably with "PartyMembers()[X]" if such a command exists. Or maybe there are commands in the 3 pages that allow to change party members into horses? I can easily do it for the "player" but it only changes the first one, and no way to revert back once I need it too... anyways I'll stop rambling and see if anyone has a solution.

Thank you for any help.
Use the change actor images command and just turn all the actors into horses and then when you want to change them back, use the same command again and choose their original sprites. Just do it for all actors, doesn't matter that they're not in the party. I do this in my game for climbing sprites, etc.
Use the change actor images command and just turn all the actors into horses and then when you want to change them back, use the same command again and choose their original sprites. Just do it for all actors, doesn't matter that they're not in the party. I do this in my game for climbing sprites, etc.

Thank you. I was trying to only store my current party member's sprite as variable, but it was not working as it did not recognize the format stored in said variables when I recalled it later for the transformation back to their regular sprite. Even String(variable) produced some very weird results.

Your solution was super simple and worked right away.
Sometimes you just have to spam (easy) lines of codes for it to work.
Thank you

Original thread: https://forums.rpgmakerweb.com/threads/mz-help-memorizing-recalling-a-characters-sprite.175587/