blade911

Veteran
Veteran
Joined
Jul 24, 2015
Messages
83
Reaction score
27
First Language
English
Primarily Uses
I am trying to create a system where the user learns new skills by using older skills to a higher level using yanfly skill mastery levels plugin.
Code:
<Before Eval>

if (!user.isLearnedSkill(609)){
 if (user.skillMasteryLevel(item.id) >= 2) {
   user.learnSkill(609);
   var text = user.name() + ' has learned '
   text = text + 'Fira!';
   $gameMessage.add(text);
 }
}
</Before Eval>

in the above code, the skill checks if it is at a sufficient skill mastery level then learn the upgraded skill, the problem is, the new skill isn't learned until it is used one more time after the old skill is leveled up.

I want to learn the new skill as soon as the user levels up the old skill. How do I go about doing that, am I using the correct eval, or is it something completely different?
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,160
Reaction score
2,542
First Language
English
Primarily Uses
RMMV
Well you're using a <Before Eval> notetag, so the code is being executed before the original skill is performed and leveled up - so once the skill gets to level 2, the code isn't looked at until you use it once more.

Does it work the way you want if you just change it to execute after the skill has been used via <After Eval> ?
 

Latest Threads

Latest Profile Posts

grief... finding a font that works with the engine has been a bigger process than I thought it'd be. doesn't help MV loves to scrunch letters next to each other like a football huddle.
The new Phoenix plugin. I drew icons and an interface into it
R3-M1 can now leave footprints :kaojoy: Thanks Dsiver144 for another amazing plugin!!

1653686110642.png

Hey guys, do you wanna see who dominated the competition in our last game jam?! Stop by while we play Pinky by @Wumbohek Starting at 4:20pm EST.

Forum statistics

Threads
122,178
Messages
1,147,041
Members
160,438
Latest member
zodismegalame
Top