- Joined
- Apr 18, 2013
- Messages
- 1,226
- Reaction score
- 603
- First Language
- English
- Primarily Uses
- RMMV
Okay, so my skill is designed to do random elemental damage to the enemies it targets. I'm having an issue with the variable getting set prior to the first use of the skill. The first time the skill is used it does not show the animation that I've assigned and is not doing the force element command within whole action, it is just doing the damage calculation in the damage formula box. After the first use, however, the skill works as intended.
Here is the note tag for the skill. Plugins involved are Yanfly Battle Core, Action sequences, element core, and skill core.
I believe the issue is with the skill core note tag. Currently it is set to Pre-Damage Eval, but I've also tried Before Eval and it did not make a difference.
My work around is an autorun event that sets the variable with a script call and erases itself. However, if anyone knows why this is not working the first time the skill is used, I would like to understand. Thank you.
Here is the note tag for the skill. Plugins involved are Yanfly Battle Core, Action sequences, element core, and skill core.
Code:
<Pre-Damage Eval>
$gameVariables.setValue(21, Math.randomInt(4) + 1)
</Pre-Damage Eval>
<whole action>
if $gameVariables.value(21) === 1
// Change to Fire element
force element: 2
animation 36: targets
else if $gameVariables.value(21) === 2
// Change to Water element
force element: 3
animation 34: targets
else if $gameVariables.value(21) === 3
// Change to Air element
force element: 4
animation 40: targets
else if $gameVariables.value(21) === 4
// Change to Earth element
force element: 5
animation 38: targets
end
action effect
clear element
wait for animation
</whole action>
<target action>
</target action>
My work around is an autorun event that sets the variable with a script call and erases itself. However, if anyone knows why this is not working the first time the skill is used, I would like to understand. Thank you.

