Yanfly Skill Mastery - Update Descriptions

Plugins download locations:
Yanfly Skill Core
Yanfly Skill Mastery

Problem: I am using text strings assigned to variables to have skill descriptions change as skill mastery levels increase. This almost works, but the description lags behind by one single attack before the skill description updates. See below for my process:


I am attempting to have skills descriptions update based on their skill mastery levels. So Level 0 fire might say "Does a tiny bit of fire damage" whereas level 5 fire might say "Does a lot of fire damage and inflicts burn on target."

My thought was this would be easy using variables. An early event assigns the variables text strings e.g.:

Control Variables : #0002 Heal = "Heals a tiny bit"
Control Variables : #0003 Fire = "Does a tiny bit of fire damage"

Then in the description box for Heal and Fire, I just entered:
\v[2]
\v[3]

So far so good. This worked in assigning the original descriptions.

The problem comes when updating the skills. Here is Heal's (Skill #23) notebox:

<After Eval>
if (user.skillMasteryLevel(23) == 1) {
$gameVariables.setValue(2, "Heals a bit");
}
if (user.skillMasteryLevel(23) == 2) {
$gameVariables.setValue(2, "Heals some");
}
if (user.skillMasteryLevel(23) == 3) {
$gameVariables.setValue(2, "Heals a moderate amount");
}
<After Eval>

If I use Heal enough to level up to level 1, the description remains the level 0 description. If I use Heal one more time, then it updates to the Level 1 description. Other actions, like guarding and attacking do not update the description.

My guess is that the skill mastery level increases after the <After Eval> checks the skill mastery level to update the description. So I need to use the skill one more time so it can check the user's skill mastery level and update the text string.

But I have no idea how to solve the problem. It seems like it should be easy. Any thoughts?
Instead of after eval, try before eval.
Thanks for the suggestion. Unfortunately I tried that earlier, and again just now to make sure. It is the same result.
The after eval only checks and thus changes the variable after that skill is used.
You'll need to find a way to make the change exactly when the skill increases.
Time permitting I'll look into it more as well.
You'll need to find a way to make the change exactly when the skill increases.
Seems to be the case! But I don't know enough about how the game words to figure that out.

I may just work around it by having characters have to purchase item scrolls to update their skill descriptions or something like that. But if you figure out how to build it into combat, let me know!
I found a workaround that does the job.
First, like before, I use an event to set variable 2 to be a string of text for the Level 0 skill like "Level 0 Heal." Then the following code goes in the notebox for the skill. The code below just skips the use of user.skillMasteryLevel(id) altogether. In the example below, the skill mastery increases every 2 uses. Variable 10 is counts how many times a skill is used. When the skill uses are high enough to level up the skill, I change the description of the skill.

It's not particularly graceful or elegant, but I'm happy I figured it out.

<Before Eval>
$gameVariables.setValue(10,$gameVariables.value(10)+1)

if ($gameVariables.value(10) == 2) {
$gameVariables.setValue(2, "Level 1 Heal");
}

if ($gameVariables.value(10) == 4) {
$gameVariables.setValue(2, "Level 2 Heal");
}

if ($gameVariables.value(10) == 6) {
$gameVariables.setValue(2, "Level 3 Heal");
}
</Before Eval>

One caveat. If you are using action sequences, every instance of "action effect" in your skill will increase the skill count variable. So something like penta strike that has five instances of the action effect would add 5 to the variable each time. You'd have to do something like $gameVariables.setValue(10,$gameVariables.value(10)+0.2) in order for it to count skill uses correctly.
Glad you got it working.
I don't know if it was the cause or not, but I noticed your After Eval was missing the / at the end of it.
I know in the docs for the plugin it's set the way you did it, but it was technically a typo.
The After Eval you were using should be the correct choice to solve both instances you put here as they should only be run once per skill use and after all sets of the skill have been used.
I don't know if it was the cause or not, but I noticed your After Eval was missing the / at the end of it.
Thanks for pointing that out! I double checked, and the notetags in my game correctly included the /. I retested the system and the error still occurs when I use the method in the top post.

You'd have to do something like $gameVariables.setValue(10,$gameVariables.value(10)+0.2) in order for it to count skill uses correctly.

Maybe I don't know the correct syntax, but the above didn't work. Neither variable 10 nor variable 2 ever update. So I just changed the code to what is below, multiplying how many increases of variable 10 are needed by 5.

So if skill mastery level increases every 2 uses, but the action sequence has 5 instances of the action effect, the skill mastery and description should change when variable 10 is equal to 5, 10, and 15.

<Before Eval>
$gameVariables.setValue(10,$gameVariables.value(10)+1)

if ($gameVariables.value(10) == 5) {
$gameVariables.setValue(2, "Level 1 Heal");
}

if ($gameVariables.value(10) == 10) {
$gameVariables.setValue(2, "Level 2 Heal");
}

if ($gameVariables.value(10) == 15) {
$gameVariables.setValue(2, "Level 3 Heal");
}
</Before Eval>

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-skill-mastery-update-descriptions.108309/