Check if player has learnt a certain type of skill

I'm looking for a way to test if the player has learnt a certain type of skill, regardless of which skill it actually is, i don't mind using a plugin or script but would rather not.

Let's say there are three fire skill:
Fireball, Firestorm, and inferno.

There is a gate of fire that will only let you pass if you have learnt any skill that is a fire type but how would you check, i know you could have it set up manually for each individual skill, but i would need to set up 100+ variables then.

any ideas?
Why would you use variables? Conditional Branch checks if the actor knows a skill. So you'd just need to do a conditional branch for each one.

Code:
Control Switches: Knows Fire Skill = OFF
If Actor[1] learned Fire Skill 1
  Control Switches: Knows Fire Skill = ON
  Jump to Label: all done
End
If Actor[1] learned Fire Skill 2
  Control Switches: Knows Fire Skill = ON
  Jump to Label: all done
End
If Actor[1] learned Fire Skill 3
  Control Switches: Knows Fire Skill = ON
  Jump to Label: all done
End
...
Label: all done
If Switch Knows Fire Skill is ON
  open gate
End

Yes, it's going to be long if you have many skills. But you said only 3 fire skills, but then you said 100 variables if you're checking all skills. Does that mean you have 100 fire skills? Or that you think you need to check every single skill when you're just looking for the fire ones?

The only other way to do it is to use a script call, but then you need to tell us how you're identifying the fire skills. Is it a skill type? An element? A tag in the note box? Or do you just have a list of skills that you want to check against?
Thank you for the swift reply.

The 3 fire skills i mentioned were just examples, i have over 100 fire skills i would have to check.

They are currently "Fire" as that is the element that they have been set but if there is a better way I would be happy to use that.
You don't think 100 fire skills is just a tiny bit overkill?

Can you please check your database and confirm that element #2 is Fire?

How many party members will you have by this stage? Do you want to check if just the leader has a fire skill, a particular actor, anyone in the party, or anyone in the active party (those who take part in battles)?

It can be done fairly easily via a script call in the Conditional Branch, but I need those answers first.
Yes 100 is slightly much but there are 300+ regions, element 2 is fire, it would be better if it worked like "if actor X has learnt fire-based turn switch y on" but I could also use the active party version
If you want to know if actor 5 has any fire-based skills you would use this in the Script box of a conditional branch:

Code:
$gameActors.actor(5).skills().some(function(skill) { return skill.elementId === 2 })

If you want to know if anyone in the active party has a fire-based skill, it would be:

Code:
$gameParty.battleMembers().some(function(actor) { return actor.skills().some(function(skill) { return skill.elementId === 2 }) })
Thank you, this is exactly what I needed! 😀

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/check-if-player-has-learnt-a-certain-type-of-skill.89105/