Is there a way to check how many weapons are equipped?

Recently asked a question and sorry to be back so soon.


Is there a way to check how many weapons the player has equipped? One of my classes has two weapon slots (specified with Yanfly's equip core) and I'm finding it impossible to tell


whether the play has one sword equipped or two e.g



Thank you so much for any replies.
I can think of a Workaround for that. In the Database every Weapon can give your char a skill as long the weapon is equiped.


(That skill will never be seen by the player its just for the workaround)


Make 1Skill for every sword. The skills are empty,they are just for our conditional branch to check if the hero has learned that skill.


We do the following pseudocode:


control Variable 1 = 0


Conditonal Branch skill1 learned


if yes control variable1 add 1


else do nothing


Conditional Branch skil2 learned


if yes control variable1 add 1


else do nothing


.....


Conditional Branch variable 1 is 2


if yes your hero has 2weapons equiped


Maybe a Scripter can offer a shorter better solution, but maybe this helps if you dont have hundrets of swords.
I can think of a Workaround for that. In the Database every Weapon can give your char a skill as long the weapon is equiped.


(That skill will never be seen by the player its just for the workaround)


Make 1Skill for every sword. The skills are empty,they are just for our conditional branch to check if the hero has learned that skill.


We do the following pseudocode:


control Variable 1 = 0


Conditonal Branch skill1 learned


if yes control variable1 add 1


else do nothing


Conditional Branch skil2 learned


if yes control variable1 add 1


else do nothing


.....


Conditional Branch variable 1 is 2


if yes your hero has 2weapons equiped


Maybe a Scripter can offer a shorter better solution, but maybe this helps if you dont have hundrets of swords.


Would this work if the player equips two of the same sword? Because then the player would already have the skill and it wouldn't change, right?
Exactly you are right, always these damn Bugs 🙂lol


Okay, no Problem here is an even easier Way.


control Variable 1 = 0


Conditonal Branch hero weapon1 equiped


if yes control variable1 add 1


else do nothing


Conditional Branch weapon2 equiped


if yes control variable1 add 1


else do nothing


.....


Conditional Branch variable 1 is 2


if yes your hero has 2weapons equiped


But the Problem is the same bug apears, it doesnt detect when you equip 2xsame sword.


Hmm...maybe someone else can think of something.
Exactly you are right, always these damn Bugs 🙂lol


Okay, no Problem here is an even easier Way.


control Variable 1 = 0


Conditonal Branch hero weapon1 equiped


if yes control variable1 add 1


else do nothing


Conditional Branch weapon2 equiped


if yes control variable1 add 1


else do nothing


.....


Conditional Branch variable 1 is 2


if yes your hero has 2weapons equiped


But the Problem is the same bug apears, it doesnt detect when you equip 2xsame sword.


Hmm...maybe someone else can think of something.



If only the iron sword and nothing else is equipped on a duel wielder then we know the player has either got one iron sword equipped or two iron swords equipped, nothing else is possible. So as long as we can check if the second weapon slot is filled or even just if both weapon slots are filled we'll know what's up. Unfortunately, I can't seem to find a check for this in MV, just this one in VX ACE http://www.rpgmakercentral.com/topic/26772-custom-script-to-determine-if-a-weapon-type-is-equipped-in-the-second-weapon-slot/. I guess that's what's needed for this to work - that or clever scripting.

Original thread: https://forums.rpgmakerweb.com/threads/is-there-a-way-to-check-how-many-weapons-are-equipped.62233/