RPG Maker Forums

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. 

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,466
Members
137,821
Latest member
Capterson
Top