is it possible to have a conditional branch based on an armour type being equipped

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.
The Conditional Branch command has an option: Actor -> Armor ____ Equipped.

vxa-branch-actor-armor.png

If you want to check the party leader rather than a specific actor, I think the VX Ace script call would be something like this?
Ruby:
$game_party.members[0].equips[1].is_nil? ? 0 : $game_party.members[0].equips[1].id
In theory this checks equip slot 1 (second slot, first slot is 0) of the party member in position 0 (leader). It should return the ID of the item in that slot, or 0 if the slot is empty. Hopefully it's correct, I based it on the info in this post by Archeia:
Code:
# Check Conditional Branch: if [Actor] has [Weapon] Equipped
# ----------------------------------------------
$game_actors[actor id].weapons.include?($data_weapons[weapon id])
right_hand = $game_actors[actor_id].equips[0]
left_hand = $game_actors[actor_id].equips[1]

[Edit: corrected .isnil? to .is_nil?.]
I appreciate the response, although i meant i wanted it to change based on armour type rather than specific armour pieces, which is what that checks for.
The Conditional Branch command has an option: Actor -> Armor ____ Equipped.

View attachment 365569


If you want to check the party leader rather than a specific actor, I think the VX Ace script call would be something like this?
Ruby:
$game_party.members[0].equips[1].isnil? ? 0 : $game_party.members[0].equips[1].id
In theory this checks equip slot 1 (second slot, first slot is 0) of the party member in position 0 (leader). It should return the ID of the item in that slot, or 0 if the slot is empty. Hopefully it's correct, I based it on the info in this post by Archeia:
​
Oh, oops! Try replacing .id with .atype_id, i.e.
Ruby:
$game_party.members[0].equips[1].is_nil? ? 0 : $game_party.members[0].equips[1].atype_id
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.
Thanks for responding. I'm getting an error whenever i try to use the script

The script i'm trying to use is "($gameActors.actor(001).equips(001)[3].length != 0) && ($gameActors.actor(001)[3].atypeId === 03)"
Screenshot 2026-05-05 021919.png


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.
It's $game_actors not $gameActors...
That was what Not-Red had originally put but i'll try this then
It's $game_actors not $gameActors...
That was what Not-Red had originally put but i'll try this then
He must have gotten confused; what he posted is for MV or MZ, he probably didn't see that your topic is for VXACE.
.actor(001).equips(001)[3].
NEVER use leading zeroes in a script code.

The ID is 1 and not 001

it doesn't make a difference in this case, but 00 leading to numbers forces the engine (and any script engine) to read the number as octal.
and for example 0011 (octal) is decimal 9 - you'll get the wrong IDs if you use leading zeroes with higher numbers than 7.
He must have gotten confused; what he posted is for MV or MZ, he probably didn't see that your topic is for VXACE.

Ohhhh, my bad, feel like quite a fool now 😅
Could you clarify how this would work and what the different elements represent? I've been trying to use it but i think i'm not understanding it right since i don't understand what part represents what i'm checking. And to clarify, it seems i'm looking for a script for the conditional branches.
Oh, oops! Try replacing .id with .atype_id, i.e.
Ruby:
$game_party.members[0].equips[1].is_nil? ? 0 : $game_party.members[0].equips[1].atype_id
He must have gotten confused; what he posted is for MV or MZ, he probably didn't see that your topic is for VXACE.
So should it work with it being changed to $game_actors, or does that mean that it won't work with VX Ace at all? Since i'm still getting errors with it as $game_actors, although a different one than before
Screenshot 2026-05-05 174534.png
$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.
Could you clarify how this would work and what the different elements represent?
Spoiler: explanation
What I suggested should literally just return the Armor Type ID of the armor in the specified slot on the specified actor. In my example, the actor is the party leader (member in position 0) and the slot index is 1 (second equip slot - the first is index 0).

You could either:
  • Use it in Control Variables -> Script to store the armor type in a variable, then check the value of that variable using Conditional Branch -> Variable; or

  • Add an equality check and use it in Conditional Branch -> Script, e.g.
Ruby:
($game_party.members[0].equips[1].is_nil? ? 0 : $game_party.members[0].equips[1].atype_id) == 3

However, I recommend trying Roninator's more elegant approach instead:
$game_party.members[0].equip_atype_ok?(#id)
This could be used directly in Conditional Branch -> Script. E.g.
  • "Does the party leader (index/position 0) have armor type 3 equipped?":
    Ruby:
    $game_party.members[0].equip_atype_ok?(3)
  • "Does actor ID 1 have armor type 3 equipped?":
    Ruby:
    $game_actors[1].equip_atype_ok?(3)

Original thread: https://forums.rpgmakerweb.com/threads/is-it-possible-to-have-a-conditional-branch-based-on-an-armour-type-being-equipped.183493/