Getting info about the equipement

Hello,

So, let's start with a little of background, I use Yanfly EquipCore, and my heroes have multiple slot.
"Weapon
Off-Hand
Body
Accessory
Accessory
Accessory"


Now what I want to check is does the Actor1 have equipped Accessory "Heal" in the slot 3,4 or 5.
I did some research and I think that the best solution would be in the script call :
$game_actors[X].equips[Y].id

So for now I started a conditionnal branch in wich I put this script :
if ($gameActors.actor(1).equips()[3].id) == 8
then
blablabla
else
blablabla

But it currentely doesn't work ... So I tried to ask the id, with return "$GameActor(1).actor(1).equips()[3].if" just for helping, but the command doesn't work neither ...

I would be glad to get some help ? Please ? I'm not really a scripter ...




Edit : Okay so now I'm trying using this sentence :
$gameActors.actor(1).equips(5) && $gameActors.actor(1).equips(5).aItemsId == 6

It "work" but always return false ...




Okay so I worked it over and found the solution :
In a conditionnal branch, script :
$gameActors.actor(1).equips()[3] && $gameActors.actor(1).equips()[3].id == 8
I'm glad you've found a solution. An alternative would be to use something like this:

Code:
$gameActors.actor(actorId).hasArmor($dataArmors[accessoryId]);
//replace actorId with the actor's ID.
//replace accessoryId with the armor/accessory's ID.

This will check every equip slot the actor has, rather than just one. This would save you having to repeat the same function 3 times with a different number, which you would have to do with the "equips()[slotId].id == x" method to check all 3 slots.

Hopefully that's helpful. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/getting-info-about-the-equipement.118771/