Some problems with Yanfly Lunatic Conditions

1. do this after action if damage value was = or superior to 1


<Custom Action End Effect>


if (value >= 1) {


user.removeState(321);


}


</Custom Action End Effect>


Result: no errors, state didn't get removed after dealing damage


__


2. do this after action if skill mana cost was = or superior to 1


<Custom Action End Effect>


if (item.mpCost >= 1) {


user.removeState(361);


}


</Custom Action End Effect>


Result:
92f4a255e6.jpg



__


3. gain mana equal of skill cost if target is slain


<After Eval>


if (target.hp <= 0) {


user.gainMp(item.Mpcost);


}


</After Eval>


Result:
5613055e7e.jpg



The error seem to happen even with Yanfly plugins on the right order


With every plugin but Yanfly's disabled
ebe7895414.png



Solution: instead of skill MP cost, just write the exact MP number of the skill, though it won't work for states


<Post-Damage Eval>


if (target.hp <= 0) {


user.gainMp(30 * user.mcr);


}


</After Eval>


__


4. self gain upgradable state after doing All Allies action


<After Eval>


if (user.isStateAffected(113))


user.addState(114);


else


if (user.isStateAffected(114))


user.addState(115);


else


if (user.isStateAffected(115))


user.addState(115);


else


user.addState(113);


</After Eval>


Result: user gain states equal to the number of target instead of once.


__


5. What should I write inside an <After Eval> to show a popup if the user/target loses HP/MP?


I will have more over the course of the day, might be compatibility issues or typos, ill check myself over time and check out more issues I have.
what plugin are you using?


what you want to  do?


have you update the plugin?


for this,


<Custom Action End Effect>
if (value >= 1) {
user.removeState(321);
}
</Custom Action End Effect>


if you want to remove the state from the user that the enemy attack, try use this instead

Code:
<Custom Action End Effect>
if (value >= 1) {
target.removeState(321);
}
</Custom Action End Effect>
All plugins are updated


I want to remove the state on the user when the user attacks
gain mana equal of skill cost if target is slain


<After Eval>


if (target.hp <= 0) {


user.gainMp(item.Mpcost);


}


</After Eval>


Result:
5613055e7e.jpg



The error seem to happen even with Yanfly plugins on the right order


With every plugin but Yanfly's disabled
ebe7895414.png

I encountered this error before, make a new project, copy all rpg_xxx.js and replace with your current project. or just repair your js files (especially rpg_core.js)
Copy pasted all rpg js files from a new project to my project and the error still happen.


3. solved
5.

Code:
<After Eval>
if (user.isStateAffected(113)) {
	user.addState(114);
} else if (user.isStateAffected(114)) {
	user.addState(115);
} else if (user.isStateAffected(115)) {
	user.addState(115);
} else {
	user.addState(113);
}
</After Eval>
Doesn't work, I still gain 2 stacks if there are 2 targets and 3 stacks if there are 3 targets.
you forgot to remove the previous state

Code:
user.removeState(x);
The previous states are automatically removed with State Resist.
5.


<After Eval>
if (user.isStateAffected(113)) {
if (!user.isStateAffected(114) user.addState(114);
} else if (user.isStateAffected(114)) {
if (!user.isStateAffected(115) user.addState(115);
} else if (user.isStateAffected(115)) {
if (!user.isStateAffected(115) user.addState(115);
} else {
if (!user.isStateAffected(113) user.addState(113);
}
</After Eval>


6. tp is case sensitive

Code:
<Custom Turn End Effect>
user.gainTp(user.mdf);
if (user.tp >= 100) {
user.addState(16);
user.gainTp(-100); 
}
</Custom Turn End Effect>
5.
bfe2323796.jpg



6. Resolved, thanks to you


3+6 Solved
sorry, some typos

Code:
<After Eval>
if (user.isStateAffected(113)) {
	if (!user.isStateAffected(114)) user.addState(114);
} else if (user.isStateAffected(114)) {
	if (!user.isStateAffected(115)) user.addState(115);
} else if (user.isStateAffected(115)) {
	if (!user.isStateAffected(115)) user.addState(115);
} else {
	if (!user.isStateAffected(113)) user.addState(113);
}
</After Eval>
Same error, I get state 114 if there are 2 targets when I didn't had state 113 at the beginning.
can we private message?


i don't want to fill this topic with typos.
can we private message?


i don't want to fill this topic with typos.

No problem


3 4 6 solved

Original thread: https://forums.rpgmakerweb.com/threads/some-problems-with-yanfly-lunatic-conditions.58196/