I have a huge issue with skills that are "learned"

Before explaining my problem, I think it is better to context the mechanics in my game. I am using RPG Maker VX Ace, of course.

In my game skills are not acquired by leveling up: instead they are all bounds to piece of equipment (weapons, armors, etc...). An actor has and can use a skill as long as he is equipping the piece of gear that provides it. This is handled really well by RPG Maker, since every item comes with the "Add Skill" feature.

Now, among active, usable-in-battle skills, gear provides "passive skills" that I want to use to make checks around the game when needed. For example, an accessory can provide the "Improved Dodge" passive skill: if an actor with that skill uses the "Dodge" skill, the game handles what happens differently (for istance, using HIME's Conditional Effects I could make "Dodge" applying different type of "dodge statuses" based on conditionals).

The problem comes with the fact that AFAIK for RPG Maker a skill is "learned" only when the actor gets it by levelling up, as a class feature. If I create an accessory that "Add Skill" -> "Dodge", a Conditional Branch "If Actor has Dodge learned" will always return FALSE.

Considering that my entire skill engine revolved around checking for skills, this is forcing me to find a solution or scrap everything and move the check to statuses (using scripts like Yanfly's Passive State). I don't like the latter, I prefer working with dummy skills to use as arguments to check conditionals.

I am a complete noob when comes to scripting, but I am sure that it should exist a script call that returns TRUE or FALSE if an actor HAS a skill, that is different that having that skill LEARNED.

On a side note, I tried using Neon Black's Passive Skill to entirely skip certain checks and sanitize the workflow of my game, but I completely gave up trying to make it works with Yanfly's stuff (especially Lunatic Engine). Any ideas? I could get rid of it if I could be able to replicate Lunatic damage effects and other effects like element absorbiption, etc. Maybe I could do that with HIME's scripts? If yes, I failed to see how.

Thanks everyone.
You can use include? on the actor's skills array for this:

Code:
$game_party.leader.skills.include?($data_skills[45])

For example, the above line would check whether the party leader has skill 45, and will include skills added by equipment.
You can use include? on the actor's skills array for this:

Code:
$game_party.leader.skills.include?($data_skills[45])

For example, the above line would check whether the party leader has skill 45, and will include skills added by equipment.

Interesting: while searching around the other day I found the "include" thing but I guess I was using it wrong.

By using HIME Conditional Effects and changing "$game_party.leader" to "a" ("a" should be the alias for "who is using the skill"), the code in the skll's notetag is this:

Code:
<effect condition: 1>
!a.skills.include?($data_skills[119])
</effect condition>
<effect condition: 2>
a.skills.include?($data_skills[119])
</effect condition>

That reads "Apply effect 1 (Dodge status) if the user has not Improved Dodge (ID 119) skill. Apply effect 2 (Improved Dodge status) if the user has Improved Dodge (ID 119) skill". And the game does exactly that, works like a charm.

Thank you! There is a reference (a manual, a blog, something) that can tell me how to effectively use things like "$game_party.leader", etc.? It may come in handy for the future. I am particularly interested in checking for specific users of skills (i.e. skill does that, but if the user is specifically X then it does other things).

Other than that, any clue about Neon Black + Yanfly, or how to get rid by Yanfly's Lunatic using HIME's scripts?
I'd probably be able to figure your last query out, but I don't currently have the time required to look into it unfortunately.

I don't know that there's a specific reference just for effectively using global variables in RGSS, but check out my Slip into Ruby series for a comprehensive teardown of all the default code and how it works.

Original thread: https://forums.rpgmakerweb.com/threads/i-have-a-huge-issue-with-skills-that-are-learned.75776/