One part of a script I'm working on includes counting the number of weapons and armors that all party members are equipped with, and for some reason I am having the hardest time getting this count. Please note I am very new to coding, and javascript, so I apologize if I'm not clear.
Example: Equipment count is 0, and our adventuring group finds a chest. In the chest is 2 long swords and leather armor. Character A equips a long sword, Equipment counts goes to 1. Character B also equips a long sword, Equipment count goes to 2.
Later on, character B finds he likes fighting with his fist, so he unequips his weapon, Equipment count goes back to 1. Then character 1 remembers they found the leather armor and equips it, having the Equipment count go back up to 2. Finally, character c equips the longsword character b didn't want, and Equipment count goes up to 3.
About the closest thing I can find is too go through $gameParty.members and loop through .hasWeapon($dataWeapons), but I would have to script it for each character, and for each weapon, then count the boolean trues that come out of the script, but I'm even having a problem figuring out how to do that.
Is there an easier way to do this? Am I making this harder than it really is?
Thanks ahead of time for all help provided.