Hi folks. I'm scratching my head figuring out how to make an ability where the user can only activate it when they have 5 or less TP. It will give the user 50 tp in return. The move is similar to Meditate from the Final Fantasy series, except it can only be used under this condition. I have Yanfly Skill Core and tried fiddling around with the Custom Show Eval, but nothing seems to work. I tried this but am guessing there needs to be more:
<Custom Show Eval>
if (user.tp <= 5 {
condition = true;
} else {
condition = false;
}
</Custom Show Eval>
Any help would be appreciated. Thank you! 🙂
Thanks for the reply. It still doesn't seem to work with what you posted, at least when I battle test. Also tried it with this:
<Custom Show Eval>
if (user.tp <= 5) {
condition = true;
} else {
condition = false;
}
</Custom Show Eval>
Yep, done this, but still isn't working. Meditate shows up and can be used repeatedly no matter the TP.
Looks like an issue with my version and/or plugins. I made a Disintegrate move from Yanfly's list, and the MP isn't repaid when my character finishes an enemy. So, for whatever reason, the codes aren't working, although I have action sequences and other moves working as intended.
Edit: Nevermind, I got the Disintegrate move to work.
Edit2: Oh! It seems to be working now. For whatever reason it does not allow <=. I changed it to this and it works now:
<Custom Show Eval>
if (user.tp < 6) {
visible = true;
} else {
visible = false;
}
</Custom Show Eval>
Edit3: Looking back on this, the problem was using conditions instead of "visible". Also, "<=" works. I just tested it. The skill appears at 5 tp, but not 6. This is the finished code.
<Custom Show Eval>
if (user.tp <= 5) {
visible = true;
} else {
visible = false;
}
</Custom Show Eval>
That is a much better code, thank you! I included the requirements in
the ability description, because it doesn't use any TP to activate.
This is something I will use again in future for other similar moves.
I think we can consider this one closed! Cheers.