Ok so I have a passive state and I need help.

My passive state is called Voice of Light but we can say VoL for short. So far it is SUPPOSED TO have these:

-Activates when you have 100 TP and TP rapidly decays.
-When at 0 TP it deactivates.
-It makes your heals leave echoes that heal for %30 of the initial healing value.
-It transforms your character.

So far a fusion of 3 Yanfly Tips and Tricks:

-Actor Transformation
-Echo of Light
-Trance

The problem is, the transformation does not occur and I do not know how to make it so, can someone help me with a notetag that I can copy paste? I tried everything, but to no avail. I told to a friend and we brainstormed all day but it seems so complex that we could not do it fully.
In programming there are two things.
What is it supposed to do
What did you actually tell it to do.
You have told us what it is supposed to do, but otherwise we are missing info like which plugins do you use, which notetags does the state have and things like that. Can I please ask for more information?

Edit: I checked the tips and tricks themselves and found nothing wrong with it, so I'll wait for how you combined those three together.
@Poryg of course, I am using all of Yanfly's plugins. And the state has these notetags below, I tried adding transformation tags but it was a total failure so I scrapped them out. Everything except transformation works just fine.

<Custom Establish Effect>

// Check if the action deals HP healing and the target is alive.

if (this.isHpEffect() && target.result().hpDamage < 0 && target.isAlive()) {

// Add the Echo of Healing state.

target.addState(20);

// Calculate 20% of the amount healed.

var healing = Math.abs(Math.ceil(target.result().hpDamage * 0.30));

// Default the echo healing total to 0.

target._echoHealing = target._echoHealing || 0;

// Add the healing amount to the echo healing total.

target._echoHealing += healing;

}

</Custom Establish Effect>



<Custom Passive Condition>

// Check if the party is in battle.

if ($gameParty.inBattle()) {

// Default the user's trance state to false.

user._trance = user._trance || false;

// Sets the condition for the user to be either in the trance state or if the user's TP matches the user's MaxTP.

condition = user._trance || user.tp === user.maxTp();

} else {

// Otherwise, the condition is false.

condition = false;

}

// If the condition passes...

if (condition) {

// And if the user isn't in the trance state...

if (!user._trance) {

// Then play an animation as the user enters trance.

user.startAnimation(97);

}

// Set the user's trance state to true.

user._trance = true;

}

</Custom Passive Condition>



<Custom Regenerate Effect>

// Set the TP drain amount.

var tp = 25;

// Reduce the user's TP.

user.gainTp(-tp);

// If the user's TP is 0...

if (user.tp === 0) {

// ...then turn off trance.

user._trance = false;

}

<Custom Regenerate Effect>
And where did you have the transformation tags? At the top? At the bottom?
If at the bottom, then no wonder it doesn't work, because
<Custom Regenerate Effect>
// Set the TP drain amount.
var tp = 25;
// Reduce the user's TP.
user.gainTp(-tp);
// If the user's TP is 0...
if (user.tp === 0) {
// ...then turn off trance.
user._trance = false;
}
<Custom Regenerate Effect>

actually has one mistake in the code which I saw even on the website.

<Custom Regenerate Effect>
// Set the TP drain amount.
var tp = 25;
// Reduce the user's TP.
user.gainTp(-tp);
// If the user's TP is 0...
if (user.tp === 0) {
// ...then turn off trance.
user._trance = false;
}
</Custom Regenerate Effect> is correct.
@Poryg Wait, Transformation tags belong to the top? Could you give me a correct lunatic state note tag that gives all 3 effects to me? Transformation, Trance and Echo. Also after it has made so many misfunctions I gotten rid of anything that have to do with transformation until someone that knows lunatic state well looks at it.

I want to add those to the currently existing VoL effect, but when I do the transformation does not happen.

I did the change you told me about and the crashes and big white lunatic state writeup screens in the midst of battle are gone. Still the transformation does not occur.

<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() === 2) {
// The filename of the character graphic without the file extension.
var charName = 'Serenity';
// The index of the character graphic used.
var charIndex = 0;
// The filename of the face graphic without the file extension.
var faceName = 'Serenity';
// The index of of the face graphic used.
var faceIndex = 1;
// The filename of the battler graphic without the file extension.
var battlerName = 'SerenityAngelic';
}
// 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 had it on the bottom, there's no wonder it didn't work, because the Echo of Light had a messed up <Custom Regeneration Effect> tag, because it wasn't closed properly. The syntax of the codes looks alright and I see no reason why it shouldn't work. I'm not testing it, since I don't want to waste so much time creating a demo project (my laptop has been running very slowly lately).

However, feel free to try
Spoiler: this order
<Custom Establish Effect>
// Check if the action deals HP healing and the target is alive.
if (this.isHpEffect() && target.result().hpDamage < 0 && target.isAlive()) {
// Add the Echo of Healing state.
target.addState(20);
// Calculate 20% of the amount healed.
var healing = Math.abs(Math.ceil(target.result().hpDamage * 0.30));
// Default the echo healing total to 0.
target._echoHealing = target._echoHealing || 0;
// Add the healing amount to the echo healing total.
target._echoHealing += healing;
}
</Custom Establish Effect>

<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() === 2) {
// The filename of the character graphic without the file extension.
var charName = 'Serenity';
// The index of the character graphic used.
var charIndex = 0;
// The filename of the face graphic without the file extension.
var faceName = 'Serenity';
// The index of of the face graphic used.
var faceIndex = 1;
// The filename of the battler graphic without the file extension.
var battlerName = 'SerenityAngelic';
}
// 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>

<Custom Passive Condition>
// Check if the party is in battle.
if ($gameParty.inBattle()) {
// Default the user's trance state to false.
user._trance = user._trance || false;
// Sets the condition for the user to be either in the trance state or if the user's TP matches the user's MaxTP.
condition = user._trance || user.tp === user.maxTp();
} else {
// Otherwise, the condition is false.
condition = false;
}
// If the condition passes...
if (condition) {
// And if the user isn't in the trance state...
if (!user._trance) {
// Then play an animation as the user enters trance.
user.startAnimation(97);
}
// Set the user's trance state to true.
user._trance = true;
}
</Custom Passive Condition>


<Custom Regenerate Effect>
// Set the TP drain amount.
var tp = 25;
// Reduce the user's TP.
user.gainTp(-tp);
// If the user's TP is 0...
if (user.tp === 0) {
// ...then turn off trance.
user._trance = false;
}
</Custom Regenerate Effect>
I did nothing extraordinary, only rearranged the order and fixed the Custom regenerate notetag. The interpreter reads through all meta, so it means the order shouldn't be a problem.
Btw. Maybe you should check the filenames of your images too, programming can be case sensitive.
If it still doesn't work, then I'll take a wider look at it.
Strange, everything is so good but Serenity insists on not making her wings blue. But everything is fine except that.
The problem is <Custom Apply Effect>. This tag means that these things will process when the state is applied. Since this state is a passive state though, it will never be applied, it will only be activated. Which explains why the wings don't change.
There are two possible solutions.
One is create a new state called Transformation and let the healing state call it. The code would then like this. And remember, do NOT make the Transformation a passive state! And be sure to adjust the parameter in bold.
Spoiler: Transformation state
<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() === 2) {
// The filename of the character graphic without the file extension.
var charName = 'Serenity';
// The index of the character graphic used.
var charIndex = 0;
// The filename of the face graphic without the file extension.
var faceName = 'Serenity';
// The index of of the face graphic used.
var faceIndex = 1;
// The filename of the battler graphic without the file extension.
var battlerName = 'SerenityAngelic';
}
// 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>

Spoiler: And this is your passive state. Don't forget to update parameters in bold
<Custom Establish Effect>
// Check if the action deals HP healing and the target is alive.
if (this.isHpEffect() && target.result().hpDamage < 0 && target.isAlive()) {
// Add the Echo of Healing state.
target.addState(20);
// Calculate 20% of the amount healed.
var healing = Math.abs(Math.ceil(target.result().hpDamage * 0.30));
// Default the echo healing total to 0.
target._echoHealing = target._echoHealing || 0;
// Add the healing amount to the echo healing total.
target._echoHealing += healing;
}
</Custom Establish Effect>

<Custom Passive Condition>
// Check if the party is in battle.
if ($gameParty.inBattle()) {
// Default the user's trance state to false.
user._trance = user._trance || false;
// Sets the condition for the user to be either in the trance state or if the user's TP matches the user's MaxTP.
condition = user._trance || user.tp === user.maxTp();
} else {
// Otherwise, the condition is false.
condition = false;
}
// If the condition passes...
if (condition) {
// And if the user isn't in the trance state...
if (!user._trance) {
// Then play an animation as the user enters trance.
user.startAnimation(97);
user.addState(xx) // substitute xx for your Transformation state ID
}
// Set the user's trance state to true.
user._trance = true;
}
</Custom Passive Condition>


<Custom Regenerate Effect>
// Set the TP drain amount.
var tp = 25;
// Reduce the user's TP.
user.gainTp(-tp);
// If the user's TP is 0...
if (user.tp === 0) {
// ...then turn off trance.
user.removeState(xx) // substitute xx for your Transformation state ID
user._trance = false;
}
</Custom Regenerate Effect>
Wow you did it! You are the best!

You are my hero, thank you. ^^
Thread closed IgnoreMe

Original thread: https://forums.rpgmakerweb.com/threads/ok-so-i-have-a-passive-state-and-i-need-help.78502/