MV Yanfly's Actor Transformation code is confusing.

Using http://www.yanfly.moe/wiki/Actor_Transformations_(MV_Plugin_Tips_&_Tricks)
Followed the video, read everything on the page. However the video says "see Yanfly.moe for an explanation of the code", however, there is no explanation.

Trying to explain what I want to do here, there is a single actor in my game with a transformation based ultimate, what would I change in the script to detect the name of said character and change the character's icon during transformation under the state's effect? Code is below, as from the website if any java wizards can throw me a bone. Thanks ahead of time.

<Custom Apply Effect> // Check if user is an actor. if (user.isActor()) { // Archive the previous settings. user._prevCharName = user._prevCharName || user._characterName; user._prevCharIndex = user._prevCharIndex || user._characterIndex; user._prevFaceName = user._prevFaceName || user._faceName; user._prevFaceIndex = user._prevFaceIndex || user._faceIndex; user._prevBattlerName = user._prevBattlerName || user._battlerName; // Check if the actor ID is 1. if (user.actorId() === 1) { // The filename of the character graphic without the file extension. var charName = 'HaroldSSJ'; // The index of the character graphic used. var charIndex = 0; // The filename of the face graphic without the file extension. var faceName = 'HaroldSSJ'; // The index of of the face graphic used. var faceIndex = 0; // The filename of the battler graphic without the file extension. var battlerName = 'Harold_SSJ1'; // Check if the actor ID is 2. } else if (user.actorId() === 2) { // The filename of the character graphic without the file extension. var charName = 'ThereseSSJ'; // The index of the character graphic used. var charIndex = 0; // The filename of the face graphic without the file extension. var faceName = 'ThereseSSJ'; // The index of of the face graphic used. var faceIndex = 0; // The filename of the battler graphic without the file extension. var battlerName = 'Therese_SSJ1'; // Check if the actor ID is 3. } else if (user.actorId() === 3) { // The filename of the character graphic without the file extension. var charName = 'MarshaSSJ'; // The index of the character graphic used. var charIndex = 0; // The filename of the face graphic without the file extension. var faceName = 'MarshaSSJ'; // The index of of the face graphic used. var faceIndex = 0; // The filename of the battler graphic without the file extension. var battlerName = 'Marsha_SSJ1'; // Check if the actor ID is 4. } else if (user.actorId() === 4) { // The filename of the character graphic without the file extension. var charName = 'LuciusSSJ'; // The index of the character graphic used. var charIndex = 0; // The filename of the face graphic without the file extension. var faceName = 'LuciusSSJ'; // The index of of the face graphic used. var faceIndex = 0; // The filename of the battler graphic without the file extension. var battlerName = 'Lucius_SSJ1'; // If none of the above actor ID's match, use this setting. } else { // The filename of the character graphic without the file extension. var charName = 'HaroldSSJ'; // The index of the character graphic used. var charIndex = 0; // The filename of the face graphic without the file extension. var faceName = 'HaroldSSJ'; // The index of of the face graphic used. var faceIndex = 0; // The filename of the battler graphic without the file extension. var battlerName = 'Harold_SSJ1'; } // Changes the character image to the setting applied from above. user.setCharacterImage(charName, charIndex); // Changes the face image to the setting applied from above. user.setFaceImage(faceName, faceIndex); // Changes the battler image from the setting applied from above. user.setBattlerImage(battlerName); // Refreshes the user's appearance. user.refresh(); } </Custom Apply Effect> <Custom Remove Effect> // Retrieve archived settings. var charName = user._prevCharName; var charIndex = user._prevCharIndex; var faceName = user._prevFaceName; var faceIndex = user._prevFaceIndex; var battlerName = user._prevBattlerName; // Changes the character image to the archived setting. user.setCharacterImage(charName, charIndex); // Changes the face image to the archived setting. user.setFaceImage(faceName, faceIndex); // Changes the battler image from the archived setting. user.setBattlerImage(battlerName); // Clear archived data. user._priorityCharacterName = undefined; user._priorityCharacterIndex = undefined; user._prevFaceName = undefined; user._prevFaceIndex = undefined; user._priorityFaceName = undefined; user._priorityFaceIndex = undefined; user._prevFaceName = undefined; user._prevFaceIndex = undefined; user._priorityBattlerName = undefined; user._prevBattlerName = undefined; // Refreshes the user's appearance. user.refresh(); </Custom Remove Effect>
You would just change all the settings for Harold since only your (presumably) main character transforms. Everywhere it has 'Harold' in ' ' quotes change to your actor name, transformation name, and picture file names. If you want everyone to be able to go SSJ/Trance mode/whatever you have to modify it for everyone.
Moved to: Plugin Support
it would be the second character in the roster, so swap where it says "HaroldSSJ" to the actor name?
it would be the second character in the roster, so swap where it says "HaroldSSJ" to the actor name?
Then you would replace every instance of Therese's name
Then you would replace every instance of Therese's name
Using the normal, row based battle system, can you explain this all to me broken down? I assume it's this code here I change, but a lot of the wording is strange.
// Check if the actor ID is 2. } else if (user.actorId() === 2) { // The filename of the character graphic without the file extension. var charName = 'ThereseSSJ'; // The index of the character graphic used. var charIndex = 0; // The filename of the face graphic without the file extension. var faceName = 'ThereseSSJ'; // The index of of the face graphic used. var faceIndex = 0; // The filename of the battler graphic without the file extension. var battlerName = 'Therese_SSJ1';
Going down the list here, I am still a bit confused by "character graphic" is this referring to the overworld sprite/chibi? I assume the same of the battler graphic? So would I only need to change "face graphic" in a row/DQ like combat system? So put in the filename and the index , can I leave the rest blank? I seem to get errors otherwise.
Yes, it's asking for the file name of the chibi sprites, the face image, and the battle sprite and where each of those graphics are on their respective tilesheets. 0 means it's in the top left.

E: No, you can't leave it blank because the command will still run and it will try to find an image called Therese, or [blank] and it will error out. If you want to leave it as is just use Actor 2's regular face image.
To be fair to you trying to read through this...there's some garbage in this snippet 😛 I don't know if it was reused from something else in another project or something, but there's a whole chunk that literally has nothing to do with the transformation effect.

The stuff at the bottom, anything that starts with "priority" can just get deleted. It's not actually used for anything in this code.

Then, of course, none of the extra variables in the Remove Effect are really useful for anything - it's just as readable without them, and there would be half as much code to read, which I think makes it easier to understand what's going on.

Code:
<Custom Remove Effect>
// Changes the character image to the archived setting.
user.setCharacterImage(user._prevCharName, user._prevCharIndex);
// Changes the face image to the archived setting.
user.setFaceImage(user._prevFaceName, user._prevFaceIndex);
// Changes the battler image from the archived setting.
user.setBattlerImage(user._prevBattlerName);
// Clear archived data.
delete user._prevFaceName;
delete user._prevFaceIndex;
delete user._prevFaceName;
delete user._prevFaceIndex;
delete user._prevBattlerName;
// Refreshes the user's appearance.
user.refresh();
</Custom Remove Effect>
Thank you both! Got it working and everything! It's much appreciated!

Original thread: https://forums.rpgmakerweb.com/threads/yanflys-actor-transformation-code-is-confusing.156989/