My apologies for the double-post. I didn't realize it was against the rules.
Thank you for the edit! I must admit, however, I messed around with it and came up with another solution as well. I also figured out a way to make it work with more than one weapon slot (since barehanded having no element set was the problem). I'd like to post that here so anyone else with similar problems can fix it as well:
IF USING ONE WEAPON SLOT:
class Game_Actor
alias aqua_weapon_specific_skill_can_use? skill_can_use?
def skill_can_use?(skill_id)
unless $data_weapons[@weapon_id] == nil <-----ADDED THIS LINE
for i in 0...Aqua::WeaponSpecificSkills::DUMMY_ELEMENT.size
dummyele = Aqua::WeaponSpecificSkills::DUMMY_ELEMENT
weapon = $data_weapons[self.weapon_id]
if $data_skills[skill_id].element_set.include?(dummyele) &&
weapon.element_set.include?(dummyele)
return super
end
end
end
end
a = Aqua::WeaponSpecificSkills::DUMMY_ELEMENT.any? {|e|
$data_skills[skill_id].element_set.include?(e)}
return false if a == true
aqua_weapon_specific_skill_can_use?(skill_id)
end
By adding the line:
Quoteunless $data_weapons[@weapon_id] == nil
It just bypasses the whole check if the player doesn't have anything equipped instead of thinking it needs an element set that isn't there.
TO MAKE IT WORK WITH MULTI SLOTS (SPECIFICALLY, GUILLAUME's):
When I tried it with multi-slot equipment (which I am using), there was another problem. Although it wouldn't bug out, it assumed that if the first equipment slot == nil, then it didn't bother to check the second slot. Therefore, if I equipped the required weapon in the first hand slot, the skill would work, but if it was in the second, it wouldn't. So, I did the following:
class Game_Actor
alias aqua_weapon_specific_skill_can_use? skill_can_use?
def skill_can_use?(skill_id)
unless $data_weapons[self.weapon_ids[0]] == nil
for i in 0...Aqua::WeaponSpecificSkills::DUMMY_ELEMENT.size
dummyele = Aqua::WeaponSpecificSkills::DUMMY_ELEMENT
weapon = $data_weapons[self.weapon_ids[0]]
if $data_skills[skill_id].element_set.include?(dummyele) &&
weapon.element_set.include?(dummyele)
return super
end
end
end
unless $data_weapons[self.weapon_ids[1]] == nil
for i in 0...Aqua::WeaponSpecificSkills::DUMMY_ELEMENT.size
dummyele = Aqua::WeaponSpecificSkills::DUMMY_ELEMENT
weapon = $data_weapons[self.weapon_ids[1]]
if $data_skills[skill_id].element_set.include?(dummyele) &&
weapon.element_set.include?(dummyele)
return super
end
end
end
a = Aqua::WeaponSpecificSkills::DUMMY_ELEMENT.any? {|e|
$data_skills[skill_id].element_set.include?(e)}
return false if a == true
aqua_weapon_specific_skill_can_use?(skill_id)
end
end
By making more than one unless block, it checks each slot independently. Voila!
Hope this helps anyone else who has the same problem as I did.