for example:
if ("the target's fire rate" >= X) {
what should "the target's fire rate" be?
I tried this...
if (target.elementRate(fire's ID) >= X) {
and it didn't seem to work.
Where are you trying to use it? elementRate(ID) is indeed the correct function.
If its not working it could be target doesnt exist or is wrong. This will usually cause an error unless its on the damage formula which blocks error and just makes damage zero, though if it is indeed in the damage formula, try using b instead of target (a = user, b = target)
Another possibility is you're using the wrong value of X which causes your condition to not work correctly. elementRate will return a real value where 100% rate (in the editor) is 1.00
So if for example you wanna check if the rate is greater than or equal tk 50% it should be
.elementRate(ID) >= 0.5
is this damage formula?, notetag?, script?
if its notetag please have a link to the plugins involved
damage formula it would be b.elementRate(X) >== Y ? A : B;
otherwise it would be target.elementRate(X) >== Y
X is the ID in database types
Y is a numeric value for a %. 0.5=50%(resistant), 1=100%(normal), 1.5=150%(vulnerable)
I'm messing around with Yanfly's CTB.
the line is in this notetag:
<After CTB Eval>
if (target.elementRate(12) > 1) {
speed = max;
}
</After CTB Eval>
which should give the attacker an extra turn if the target has a rate higher than 100% for element 12, but nothing happens.
I've tried it with other ifs like
<After CTB Eval>
if (this.mmp > 10) {
speed = max;
}
</After CTB Eval>
which should give the attacker an extra turn if their max MP is over 10, and this one does work perfectly.
Edit: actually, just tested "if (target.mmp > 10) { " and it doesn't work, so "target" is probably not the skill's target.
sooo the question is how to refer to the skill's target.
yup, that works fine.
thanks!