if Actor has Accessory/Head/Body Armor "Equipped" and "Unequipped"

coboldRPG

Villager
Member
Joined
Mar 5, 2020
Messages
5
Reaction score
0
First Language
RGSS
Primarily Uses
RMXP
I want to ask, a script to call "if Actor has Accessory/Head/Body Armor "Equipped" and "Unequipped" ?

when i try this, the error is "undefined 'equips' for nilClass"
$game_party.actors[0].equips.include?($data_weapons)

thank you
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,394
Reaction score
12,926
First Language
English
Primarily Uses
RMMV
$data_weapons is an array containing all of the weapons. An actor cannot have an array equipped. Also, why are you using $data_weapons if you want to know if armor is equipped?

Are you just checking to see if SOMETHING is equipped? So you want to know if the actor has an accessory, head armor and body armor equipped or is missing something in one or more slots?

actor.armor1_id is the shield
actor.armor2_id is the helmet
actor.armor3_id is the body armor
actor.armor4_id is the accessory

So if you just want to know if they have something there, it would be:

Code:
$game_party.actors[0].armor2_id != nil && $game_party.actors[0].armor3_id != nil && $game_party.actors[0].armor4_id != nil
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

lunarrosecrow wrote on hiddenone's profile.
please don't lurk hiddenone I'm quarantining!!!
lunarrosecrow wrote on Edward.T's profile.
Hello Edward sorry to bother you and didn't start a conversation cause I thought i'd be a little weird or disrespectful but I was wondering do you still have your Generator resources you posted as the links on the page are dead?
Stream will be live shortly! It is my birthday, and thus I am doing an extended stream! I will be doing a variety of things. Among the activities I will be doing: Playing Oceanhorn: Monster of the Uncharted Seas, art, and some Text Adventure~ Feel free to drop by!
It would be cool if you could "copy as code" event commands :< .
Just managed to recover my Yahoo e-mail that i lost 3 months ago. Turns out an IP from U.S had hacked it and set the pass back to normal.. Like WTF ?

Forum statistics

Threads
99,485
Messages
965,924
Members
131,111
Latest member
HannyBee21
Top