I've run into an issue that there doesn't seem to be an in-built way to have a conditional branch run based on an armour type being equipped. I want to have it so that different things are said depending on what type of armour the player is wearing, but i can't figure out a way of doing that, and it would be hugely inefficient to do it based on the specific armour pieces.
I've tried googling but i couldn't find anybody else with this issue oddly enough, so i'm worrying i'm missing something obvious lol.
Relatively new to this.
Go to the 4th tab on the conditional branch settings and set it to "Script", then enter the following code:
(actor.equips()[armour].length != 0) && (actor.equips()[armour].atypeId === type)
where 'actor' is the actor who you want to check (normally found using '$gameActors.actor(x)' or '$gameParty.members()[x]' ), 'armor' is the number of the equipment slot that armour is worn in (slots start at 0, so it should be the number shown on the database "types" screen -1) and 'type' is the armour type you want to check for (these do not start at 0, I believe, so just the number on the "types" screen).
Sadly, this won't work if you have a bunch of different armour slots and want to check if any of them are your desired type.
Game_BattlerBase shows a possibility to check the armour type.
equip_atype_ok?(atype_id)
So you could do an extensive conditional branch to check for the armour type (maybe a common event), then turn a specific switch on and then your conditional branch is an easy check for which switch is on.
So as the code was suggested above
$game_switches[1] = $game_party.members[0].equip_atype_ok?(#id)
will return true or false.
repeat for all armour types and all actors you want to check.
It's $game_actors not $gameActors...
$game_actors is an array, that means it never needed any actor method to access any given actor.
Use this instead:
$game_actors[number] where number is a value greater or equal to 1.
Even so, $game_party.members[index] would be your best option here unless you always wanted to apply the effect on very specific actors. Yes, index is just a placeholder, use a real value instead.