Using a script to check if an Accessory is Equipped

● ARCHIVED · READ-ONLY
Started by LazESigma 5 posts View original ↗
  1. Hello, I found this script to check if an actor has a weapon equipped.

    $game_actors[actor id].weapons.include?($data_weapons[weapon id])

    How can I use this to check if a specific Accessory is equipped?

    The accessory ID is 73 in my case.

    I want to basically put this in a Conditional Branch to check if my Actor is wearing

    a specific Accessory.  

    Thanks in Advance!
  2. You can do that without a script. Just go to the codentional branch and look in the Armour option.
  3. Well, i saw that.  I needed this to be a little more dynamic.

    Basically.  I have an Accessory called "Sprint Shoes".

    I only want my script for dashing to be ON when one of the 4 "Active" party members has them equipped.

    Therefore, I can't check a specific character like the UI lets you do.

    I already have the Variables setup so I know which Actor ID is in Formation 1,2,3,4.

    So really all I am missing is a script call to check the Accessory slot.
  4. Well actually you can do that too. Have a common event run on parallel process so it can constantly check if a person is wearing the accessory or not. If they are switch goes on if not it turns it off.
  5. I found a good way using both a Common Event and a script call.

    Here was my solution using the "script" window inside a Common Event.

    I set my variable "accessory" passing in the Actor in Formation 1  (var 34)

    The equips[4] is what looks at the "Accessory" Equipment Slot.

     accessory = $game_actors[($game_variables[34])].equips[4]

    if !accessory.nil? && accessory.name.eql?("Sprint Shoes")

      $game_switches[94] = true

    end