Hello. For a project I'm working on, I'm needing to check if any actor has a specific skill--that is, I know how to check just one at once, and am trying to check them all in a better way. After spending an hour looking for how on Google and turning up with nothing, I'd appreciate any help! I know that this could be done with a nice big wall of conditional tests:
if $game_actors[1].skills.include?($data_skills[1000])then<Stuff here>end if $game_actors[2].skills.include?($data_skills[1000])then<Stuff here>end if $game_actors[3].skills.include?($data_skills[1000])then<Stuff here>end....But was trying to figure out if there's a way to just check everything without making my code look messy/make it more universal should I end up sharing the script I'm working on. I tried to do something similar to how you'd make everyone learn or forget a skill:
$game_party.members.each { |actor| actor.skills.include?($data_skills[1565]) }But this seems to always returns true, never false (and I did double-check to ensure that it shouldn't be telling me someone knows the skill, haha). Is there a nice way to just check if a skill is known by any actor?
Thank you very much for any help!
if $game_actors[1].skills.include?($data_skills[1000])then<Stuff here>end if $game_actors[2].skills.include?($data_skills[1000])then<Stuff here>end if $game_actors[3].skills.include?($data_skills[1000])then<Stuff here>end....But was trying to figure out if there's a way to just check everything without making my code look messy/make it more universal should I end up sharing the script I'm working on. I tried to do something similar to how you'd make everyone learn or forget a skill:
$game_party.members.each { |actor| actor.skills.include?($data_skills[1565]) }But this seems to always returns true, never false (and I did double-check to ensure that it shouldn't be telling me someone knows the skill, haha). Is there a nice way to just check if a skill is known by any actor?
Thank you very much for any help!