First of all, Im not sure how I move on that forum so sorry if this thread is under bad topic (and please help me to move it)
I need help with setting "speed" variable in Yanfly's ATB battle system plugin in notetag "After ATB Eval"
The docs says :
<After ATB Eval>
speed = x;
</After ATB Eval>
so in general after skill is done it sets speed to x
I want to set speed to x only if enemy has status (so enemy has to be alive), lets say, with id "5"
So in pseudocode its looks like that
if enemy.hasStatus(5)
speed = 100
else
speed = 0
But
I got errors like
and after some debugging i see that
afterATBEval function doesn't have "target" or anything related to enemy
BUT i have found this:
this is body of the function, and it uses $gameSwitches_data as 's'
$gameSwitches_data has two interesting for me functions (according to kinoar.github.io)
value(ID) and setValue(ID,bool)
so i thought that code like this
<After ATB Eval>
if (s.value(301))
{
s.setValue(301, false);
speed = 75;
}
</After ATB Eval>
Would work - but no, if switch with id 301 is on (this switch indicaties if enemy has status) it should set speed to the value
but it crashes just like two images above
Using switch instead of something like
(target.isStateAffected(5))
is workaround already but it still dont work
im aware that
eval(item.atbAfterEval);
cause error but i do not understand why and how can i fix it
I need help with setting "speed" variable in Yanfly's ATB battle system plugin in notetag "After ATB Eval"
The docs says :
<After ATB Eval>
speed = x;
</After ATB Eval>
so in general after skill is done it sets speed to x
I want to set speed to x only if enemy has status (so enemy has to be alive), lets say, with id "5"
So in pseudocode its looks like that
if enemy.hasStatus(5)
speed = 100
else
speed = 0
But
I got errors like
and after some debugging i see that
afterATBEval function doesn't have "target" or anything related to enemy
BUT i have found this:
this is body of the function, and it uses $gameSwitches_data as 's'
$gameSwitches_data has two interesting for me functions (according to kinoar.github.io)
value(ID) and setValue(ID,bool)
so i thought that code like this
<After ATB Eval>
if (s.value(301))
{
s.setValue(301, false);
speed = 75;
}
</After ATB Eval>
Would work - but no, if switch with id 301 is on (this switch indicaties if enemy has status) it should set speed to the value
but it crashes just like two images above
Using switch instead of something like
(target.isStateAffected(5))
is workaround already but it still dont work
im aware that
eval(item.atbAfterEval);
cause error but i do not understand why and how can i fix it