MV YEP Skill Core Custom Show Requirements (Events?)

So one of the core mechanics of my project is that your party's battlers are always in 1 of 4 states (power, magic, speed, defense) which alters their stats and skills (the states utilitize the Learn: Skill trait for this). This is going fine for me while testing and building a demo. However I realized that during the game I wanted skills to be learned through events. For example paying a tutor, ,going to class, beating a boss, finding an item etc.
So I asked myself if all the skills are learned from the states using the Learn: Skill traits is there a way to hide them from the player until the event switch is activated.

The closest solution I could come up with was to use the TEP Skill Core plugin and the Custom Show note tag

this is their example on the page.
Skill Notetag:
<Custom Show Eval>
if (user.level > 50) {
visible = true;
} else {
visible = false;
}
</Custom Show Eval>

What I think I need is the event ID and switch state to be able to replace the "if (user.level" part but I'm not sure what to put in there. So I've come to ask you all for help.

Edit for clarification: one of the reasons I'm not using the level up for skill learning is that between parts of the plot, your party is a "free roam" state with action points to improve your party before moving on to the next major story part. Think of it as time passing in between major parts of the story and your actors are busy improving themselves or acquiring resources.
What I think I need is the event ID and switch state
  • Event ID is for indexing map events...not sure how that's relevant.
  • Switches have 2 states: ON (true) and OFF (false).
I think this should make the skill visible iff switch ID 123 is ON:

<Custom Show Eval> visible = $gameSwitches.value(123); </Custom Show Eval>
Is that what you wanted?
Thank you, I'll test it out and see if it works
Yes that worked perfectly! Thank you
Just to put it out there, if you're learning skills from events anyway, you could've simplified your whole system.

You could put the Change Skill event command in there, then you don't need the Add Skill on the states and don't need any Show Eval notetags.

Or have the skills all on the battlers already and hidden with that notetag, no need to put it on the states.
@ic1025
There is something else that you should know:

There is no "learn skill trait", only an "add skill trait".
An added skill never counts as learned for the engine and as such will not trigger the event checkk "is skill learned".
Only those skills learned by event command and in the class list count as learned for the engine.

That might change something if you ever use the event command to check on skills learned.
Just to put it out there, if you're learning skills from events anyway, you could've simplified your whole system.

You could put the Change Skill event command in there, then you don't need the Add Skill on the states and don't need any Show Eval notetags.

Or have the skills all on the battlers already and hidden with that notetag, no need to put it on the states.
The issue I had with that was I couldn't make the skill only show up while in a specific state. The add skill trait was how I figured out how to have the skill show in a specific state and then I remembered reading in a plugin that there was a way to hide skills so that's why I went that direction. Again, I'm still learning right now.
After that I did try to use the custom show code to have the skill be visible when in a specific state, but I also couldn't get that to work. I guess I could have asked that on this forum too.
The issue I had with that was I couldn't make the skill only show up while in a specific state.
There's a pinned thread in the JavaScript forum that has basic script calls in it. You can do this with:
Code:
<Custom Show Eval>
visible = user.isStateAffected(X);
</Custom Show Eval>
where X is the state ID (no leading zeros).

Then you bypass the whole added vs. learned bit.
There's a pinned thread in the JavaScript forum that has basic script calls in it. You can do this with:
Code:
<Custom Show Eval>
visible = user.isStateAffected(X);
</Custom Show Eval>
where X is the state ID (no leading zeros).

Then you bypass the whole added vs. learned bit.
Thank you very much.

I found the google doc with the script call references.

Original thread: https://forums.rpgmakerweb.com/threads/yep-skill-core-custom-show-requirements-events.154459/