in the conditional branch you are able to check if an actor has a specific skill or item etc, but I want to know if there is a script for checking if it exists anywhere across the party. Rather than checking each actor individually.
Conditional branch check for whole party
RPG Maker MV Support$gameParty.isAnyMemberEquipped($dataWeapons[id])
will tell you if ANY member has the weapon equipped. Using $dataArmors[id] will instead tell you if ANY member has an item of armor equipped.
For skills, there isn't a function, so you have to do a bit more work:
$gameParty.members().some(function(actor) { return actor.hasSkill(id); })
So for the first, you need to pass in an actual weapon or armor object, but for skills, you only pass in the skill id.
will tell you if ANY member has the weapon equipped. Using $dataArmors[id] will instead tell you if ANY member has an item of armor equipped.
For skills, there isn't a function, so you have to do a bit more work:
$gameParty.members().some(function(actor) { return actor.hasSkill(id); })
So for the first, you need to pass in an actual weapon or armor object, but for skills, you only pass in the skill id.
I'm specifically looking for skills here, so I copied that script. But I got an undefined function error. All I did was replace the id with the number, so is there something else I'm missing?
Please show a screenshot of your command (or copy/paste it - don't retype it) as well as one of the error message.
For some reason that I may never understand, in the 1.2.0 version of rpg_objects.js the command is isLearnedSkill, but in the 1.5.0 version they've also introduced hasSkill.
So just change hasSkill to isLearnedSkill as it seems you aren't on the latest and greatest.
So just change hasSkill to isLearnedSkill as it seems you aren't on the latest and greatest.
Original thread: https://forums.rpgmakerweb.com/threads/conditional-branch-check-for-whole-party.81833/