Issue with Transformation plugin

Greeting. I began utilizing Yanfly's transformation plugin. For the MOST part It works great but there is one glaring issue and I would like to know if and how it can be fixed.
The transformation I have given to my characters wears off after three turns. That part works fine but the issue is that if a character is KO'd while they are in said transformation and then revived, the transformation will not wear off at all whilst in battle. This essentially provides the opportunity for it to be exploited for longer battles. Does anyone know why it's not wearing off when a character get's ko'd? Thanks in advance!
Does anyone know why it's not wearing off when a character get's ko'd?
No, because you don't show us what you're doing 😉

Please provide links to plugins you have questions about - although I don't know of any Yanfly transformation plugin, so I suspect you're actually referring to his Tip & Trick article that utilizes notetags for the Buffs & States Core plugin.

In addition to the link, you need to give us screenshots of the skills/states in question so we can actually see what code you have in your project.
No, because you don't show us what you're doing 😉

Please provide links to plugins you have questions about - although I don't know of any Yanfly transformation plugin, so I suspect you're actually referring to his Tip & Trick article that utilizes notetags for the Buffs & States Core plugin.

In addition to the link, you need to give us screenshots of the skills/states in question so we can actually see what code you have in your project.
Ah ok I see. I will try to get them to you as soon as I can.
If you're using states to handle transformations, that easily explains why death causes problems:
all other states are removed on death by default.

one possible solution is to find a way to declare your transformation states to be unaffected by death.
I don't know if yanfly's plugin can do that or if you need to add another plugin for that ability.

the other solution would be to use something other than a state to mark and remember transformations - but that can get very tricky.
No, because you don't show us what you're doing 😉

Please provide links to plugins you have questions about - although I don't know of any Yanfly transformation plugin, so I suspect you're actually referring to his Tip & Trick article that utilizes notetags for the Buffs & States Core plugin.

In addition to the link, you need to give us screenshots of the skills/states in question so we can actually see what code you have in your project.
Ok, so I finally got back home and here is what I have.
Firstly, the website is acting sorta wonky for me right now, but I have a link to the Youtube Vid that I got it from.


As for some screenshot, I will attach them below.
The first is the skill itself, dubbed "Overflow"
1705709090050.png



Then we have the state itself here called "Awakened"
1705709246776.png



And JUST IN CASE you want the coding for it, I will post that here as well.


<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 = 'lamirecawakened';

// The index of the character graphic used.

var charIndex = 0;

// The filename of the face graphic without the file extension.

var faceName = 'LamirecAwakened';

// The index of of the face graphic used.

var faceIndex = 0;

// The filename of the battler graphic without the file extension.

var battlerName = 'Lamirec awakened';

// Check if the actor ID is 2.

} else if (user.actorId() === 2) {

// The filename of the character graphic without the file extension.

var charName = 'gaileawakened';

// The index of the character graphic used.

var charIndex = 0;

// The filename of the face graphic without the file extension.

var faceName = 'gaileawakened';

// The index of of the face graphic used.

var faceIndex = 0;

// The filename of the battler graphic without the file extension.

var battlerName = 'gaileawakened';

// Check if the actor ID is 3.

} else if (user.actorId() === 3) {

// The filename of the character graphic without the file extension.

var charName = 'talvianawakened';

// The index of the character graphic used.

var charIndex = 0;

// The filename of the face graphic without the file extension.

var faceName = 'Talvianawakened';

// The index of of the face graphic used.

var faceIndex = 0;

// The filename of the battler graphic without the file extension.

var battlerName = 'Talvianawakened';

// Check if the actor ID is 4.

} else if (user.actorId() === 4) {

// The filename of the character graphic without the file extension.

var charName = 'xeaawakened';

// The index of the character graphic used.

var charIndex = 0;

// The filename of the face graphic without the file extension.

var faceName = 'Xeaawakened';

// The index of of the face graphic used.

var faceIndex = 0;

// The filename of the battler graphic without the file extension.

var battlerName = 'xeaawakened';



// Check if the actor ID is 5.

} else if (user.actorId() === 5) {

// The filename of the character graphic without the file extension.

var charName = 'tonnerawakened';

// The index of the character graphic used.

var charIndex = 0;

// The filename of the face graphic without the file extension.

var faceName = 'tonnerawakened';

// The index of of the face graphic used.

var faceIndex = 0;

// The filename of the battler graphic without the file extension.

var battlerName = 'tonnerawakened';



// Check if the actor ID is 6.

} else if (user.actorId() === 6) {

// The filename of the character graphic without the file extension.

var charName = 'votiveawakened';

// The index of the character graphic used.

var charIndex = 0;

// The filename of the face graphic without the file extension.

var faceName = 'votiveawakened2';

// The index of of the face graphic used.

var faceIndex = 0;

// The filename of the battler graphic without the file extension.

var battlerName = 'votiveawakened2';



// Check if the actor ID is 7.

} else if (user.actorId() === 7) {

// The filename of the character graphic without the file extension.

var charName = 'Jamaanawakened';

// The index of the character graphic used.

var charIndex = 0;

// The filename of the face graphic without the file extension.

var faceName = 'Jamaanawakened';

// The index of of the face graphic used.

var faceIndex = 0;

// The filename of the battler graphic without the file extension.

var battlerName = 'Jamaanawakened';













// 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>
If you're using states to handle transformations, that easily explains why death causes problems:
all other states are removed on death by default.

one possible solution is to find a way to declare your transformation states to be unaffected by death.
I don't know if yanfly's plugin can do that or if you need to add another plugin for that ability.

the other solution would be to use something other than a state to mark and remember transformations - but that can get very tricky.
It does? You would think that wouldn't have been a problem with how thorough they usually are with these plugins.... I think.
If I can't find an easy solution, I'll do some more research and see if someone else has also had this problem and found a solution. Right now this place is usually my go to since whenever I have had a problem, someone here has solved it relatively quick.
I do some more research and see if someone else has also had this problem and found a solution.
The thread in my signature has instructions for making Buffs & States Core execute Remove Effects upon death.
The thread in my signature has instructions for making Buffs & States Core execute Remove Effects upon death.
Ok, so i tried this and I'm assuming as per usual I did something wrong. I tried putting(copy and paste) it in Notepad ++ and it makes the actor disappear upon death. I can revive them but they stay invisible the rest of the battle. Where did I mess up here?

1705727171229.png
I think the problem is the user.refresh() at the end of the notetag code. That's causing the state removal code to run twice, and the second time all of the stored values have already been erased, so it's replacing them with null entries (invisible actor).

I've also always kinda hated the extra junk in that Tip & Trick - Yanfly must have had extra things from some other project that got copied into or not deleted by mistake.

So change your Removal notetag to this, see if it works.

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.
if (user.hp>0)
    user.refresh();
</Custom Remove Effect>

You could also make your apply effect code way less huge with a bit of JavaScript operators.

Just say
Code:
var charName = user._characterName + "awakened";

and similar for the face and battler names. That way it will look for whatever the name of the original file is with "awakened" added to it, just like you already have. So the base character file is Lamirec.png, it will look for the transformation sprite to be named "Lamirecawakened.png" - and then you don't need big chunks of code for each individual actor ID.

But that's just if you want to tidy it up some...it isn't broken the way it is.
I think the problem is the user.refresh() at the end of the notetag code. That's causing the state removal code to run twice, and the second time all of the stored values have already been erased, so it's replacing them with null entries (invisible actor).

I've also always kinda hated the extra junk in that Tip & Trick - Yanfly must have had extra things from some other project that got copied into or not deleted by mistake.

So change your Removal notetag to this, see if it works.

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.
if (user.hp>0)
    user.refresh();
</Custom Remove Effect>

You could also make your apply effect code way less huge with a bit of JavaScript operators.

Just say
Code:
var charName = user._characterName + "awakened";

and similar for the face and battler names. That way it will look for whatever the name of the original file is with "awakened" added to it, just like you already have. So the base character file is Lamirec.png, it will look for the transformation sprite to be named "Lamirecawakened.png" - and then you don't need big chunks of code for each individual actor ID.

But that's just if you want to tidy it up some...it isn't broken the way it is.
You're brilliant, it worked! Now whenever a character falls, they revert back to their base form! This will hopefully make it a bit more balanced(though honestly the transformation might still be a bit too strong so I'll probably end up nerfing it a bit). I was struggling for a second until I realized that I did need to pair it WITH the plugin as well. *derp*

Also thanks for the advice. I kinda already have the code set to give all seven of the characters their awakened forms and pasted into the state so I wouldn't really bother changing anything cause it would probably just be more work. BUT I'll probably make a backup state and experiment with your above advice to help save time in case i end up making a sequel.

Also, I used to think Yanfly was the best at most of these things but it seems to come with quite a few problems from what I've seen. A lot of those plugins even messed with some of the base features, like getting rid of the critical hit indicator! I kind of wanted that.
A lot of those plugins even messed with some of the base features, like getting rid of the critical hit indicator!
As a general rule, almost anything the Yanfly plugins change can be toggled in a plugin parameter.

What critical hit indicator do you mean?
As a general rule, almost anything the Yanfly plugins change can be toggled in a plugin parameter.

What critical hit indicator do you mean?
Well a character got a critical hit in battle it usually notified you of such in text at the bottom in battle. Like (insert characters name here) "Got a critical hit" but it doesn't do that anymore. Now all it does is have the damage over the enemy glow red instead, but I don't even remember what plugin i plugged in to make that happen but I know it was one of the battle cores.

Tho honestly it's not a huge deal. Technically as long as it gives an indicator that it was a crit.
Well a character got a critical hit in battle it usually notified you of such in text at the bottom in battle. Like (insert characters name here) "Got a critical hit" but it doesn't do that anymore. Now all it does is have the damage over the enemy glow red instead, but I don't even remember what plugin i plugged in to make that happen but I know it was one of the battle cores.

Tho honestly it's not a huge deal. Technically as long as it gives an indicator that it was a crit.
That is indeed a result of the Battle Engine Core. Specifically, it's a result of having the FF style log, where you just see the name of a skill being used instead of "Hero casts Fire!" kind of text.

It is toggleable though.
That is indeed a result of the Battle Engine Core. Specifically, it's a result of having the FF style log, where you just see the name of a skill being used instead of "Hero casts Fire!" kind of text.

It is toggleable though.
I see. I'll play around with it a bit. I kind of like the FF style log but I also didn't mind the "Hero uses etc* text either. Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/issue-with-transformation-plugin.164944/