[solved]Problem with setting a variable, using Yanfly skill core

Status
Not open for further replies.

HumanNinjaToo

The Cheerful Pessimist
Veteran
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.
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>
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.
 

Dopan

Veteran
Veteran
Joined
Mar 27, 2020
Messages
542
Reaction score
255
First Language
German
Primarily Uses
RMMV
Try "Custom Execution",.. Im using no SV battles mostly (on TacticalBasedStrategy- projects) and Custom Execution triggers earlier than the other Evals for my usage..
..you could also use Huds(=srd Huds for EG) , connected with Switches to every Eval in order to show visually when a eval triggers,that might help for testing purposes..
 
Last edited:

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,226
Reaction score
603
First Language
English
Primarily Uses
RMMV
Custom Execution worked. Thanks a bunch!
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,867
Reaction score
5,240
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,454
Members
137,821
Latest member
Capterson
Top