Yanfly Skill Mastery Levels - Level Up Notification in Map (Script)

Hi guys! I need some help!

I am creating a mining system! In my game, mining is a skill just like a proficiency where the more you use it, the more it becomes stronger. So, the more you mine, the more your level in this proficiency grows and more reward you get from mining! Imagine Skyrim, you know when you are fighting with that bow and suddenly, the notification: Archery Increased to 50... that's the idea!

Now, the thing is: how can I make a script (or even a Conditional Branch) to check the very moment the Mining Skill gains a level and that at this very moment a notification appears? I tried with a conditional branch using variables and also with script call. In the last day I read the plugin.js over and over, tried what I could (a lot xD). Tried Scripts...

The max I could do is this:

1580834063618.png


I can already mine and earn XP, my Script have a common event linked to notify me when the Mining Skill levels up. When I get Level 1, the game notifies me but then it notifies me every time I mine (without getting a new level). I got that logically, the code is "locked" in the "skillMasteryLevel(17) == 1" but how do I get out of this? I'd need to store the mining skill level and to add a new value each time it levels up and then make the common event to check it? How do I do this in this case?

Please Help!!
hmmmm see i can think of a method but it wouldnt be random times. Similar to faction gain there is a notification when the player becomes friendly with that faction, however i have used the Kru factions plugin for the script and then its placed events at certain points on quest rewards that trigger the message. So say if you have map variants as game progression, when the player reaches a certain point/map in game that mining node could trigger the next message, so like you have 50 mining nodes throughout 50 maps, every tenth put up the proff via eventing. Thats my method without writing a completely new script 🙂
@Munchy

Very interesting! Before using this plugin I was thinking to do something similar but my project grew beyond what I imagined. It's quietly an Open Word now and the player have a lot of freedom to go where it wants and do what it wants.
well ive done the same but for every new thing that happens so new quest chain, new party member i create a copy of the map variant with say what it is so World Map is the first then say World Map Fetch Quest Start and then transfer each map to the connecting one, its a bit longer than using the inbuilt progression events or scipt calls or common events but you have alot of control over what happens on each map, and will definitely give you the ability to do profession progression as and when you see fit. providing each map is linked correctly the player can do what they wish when they wish but wont ever loop or get stuck in a map
its a bit longer than using the inbuilt progression events or scipt calls or common events but you have alot of control over what happens on each map

I used to do this a lot in other projects but this time, things are way different.

1580838572087.png


Ignore the description, the face and gauges xD. I am trying to be very "HUD-Friendly" by giving the player control over technically everything. I want the player to consult anything he wants about his character, the fastest and practical way possible. As such, I am very focused in Optimization this time. Sadly, the only way to achieve this is through this plugin (the only one I found) and figuring out this Script.
I do think that I am close to solve this!

1580839069079.png


Each line of code marked with (Works) works to some extent. It allows me to mine, it checks the Mining Level... But when I go from Lv: 0 to Lv: 1, the Common Event keeps notifying "Level Up" every time I mine without leveling up... I don't think it is a problem with the Common Event (it is just a message right now) triggered by the Script Call. I don't know if I am missing something or if this Plugin has some limitation on this... =(
so looking into the plugin itself i found this section within the scriptcall help section
battler.gainSkillMasteryUses(skillId, value)

- 'battler' is a variable that represents an actor/enemy. Replace 'skillId'

with the ID of the skill whose current mastery usage amount to be changed.

Replace 'value' with the amount to increase/decrease. If the usage amount

exceeds the need to reach the next level, the skill automatically update

to the next mastery level and set the mastery usage amount to 0.

Which is what you have up there so your script looks fine to me, could you possibly screen shot me the common event youve created please?
battler.gainSkillMasteryUses(skillId, value)

- 'battler' is a variable that represents an actor/enemy. Replace 'skillId'

with the ID of the skill whose current mastery usage amount to be changed.

Yes, I tried using the gainSkillMastery but in this case, it will increase only the XP of the skill, not the level so I can not do a check with this. But I'll try something!

Which is what you have up there so your script looks fine to me, could you possibly screen shot me the common event youve created please?

1580884604871.png


As I said, it's just a prototype message, just to test and show that it works. It'll appear for the first time when I get the Mining Skill to Lv: 1 and then will always appear when I mine.
so in the common event i would put an event break in it so after each message the game removes the event until triggered again in the script call. so after that text, whack an erase event in there then exit event processing and see if that fixes it coming up again every time mining is used 🙂 also make sure you have the trigger set to the same switch in your script call youve set up, so i do the same with lighting. I have the lighting script call set on a common event autoran on a map event. all it takes is a switch to turn it on/off 🙂 if you need me to ill do the screen shot for you but hopefully what i wrote makes sense to you lol
I improved the common event. It's like this now:

1580944422177.png

Still, it doesn't work!

I am sure that the problem is the script call though!

1580944494024.png


The issue is in the very first line, the IF. The script is calling the common event, it is checking the mining level but the problem is the progression! It checks the level 1 but then it locks because " == 1". Logically speaking I know what the problem is but, don't know how to fix this. It would be necessary a progression based codeline in this!

I tried some progression operators but they also didn't worked. Don't know what do to!
So... I did some more tests and still nothing...................

I came up with this new script:

1581031847397.png


I am compressing it to put in the script call:

1581031897955.png


The issue still remains though... I don't know what to do, I am feeling I am about to hit the wall on this!

With this new code, I can mine, gain XP and LV, but, the common event will not activate nor the animation which makes me think that "if (levelup && Yanfly.Param.SMLAnimation > 0)" is not starting... I don't know!

Heeeelp! 😳😳😳😳😳😳😳😳

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-skill-mastery-levels-level-up-notification-in-map-script.117930/