Unequip armor by item ID, or check armor in specific slot

Hi folks,

I have two equipment slots in my game with the same name (ring), which both accept the same armor type (ring).

I have an item that, on death, if equipped, will break. I need to somehow check both these "ring" slots (slots 8 and 9) for this item, and if it is equipped, unequip it so I can use "change armor" to remove one from the player inventory.

The problem is that, with the usual event commands, all I seem to be able to do is check whether the player has it equipped at all, but then when it comes to removing it, I can't check which of the two ring slots it is equipped to so I can remove it. The closest I seem to be able to do is set the equipped item in both ring slots to "none", but I can't determine which of the two has the ring equipped and just remove that one.

Is there some kind of script call that will let me check if a specific slot ID has a specific equipment ID equipped? That, or any alternative method for unequipping a specific armor from one of multiple potential slots.

Something like:

Code:
if slot 8 = $dataWeapons[1] {
$gameActors.actor(1).changeEquip(8, $dataArmors[0]);
} else
if slot 9 = $dataWeapons[1] {
$gameActors.actor(1).changeEquip(9, $dataArmors[0]);
}

Thanks!
I use YEP_equipcore by yanfly, but that is for MV. With (or maybe even without) fossil this might work for MZ as well.

Edit: nevermind, I totally misunderstood the question.
$gameActors.actor(X).equips()[Y].id

First check that it returns a value, or it will give error that it can't get an id
$gameActors.actor(X).equips()[Y].id

First check that it returns a value, or it will give error that it can't get an id
What will this return, exactly? The slot ID for a particular item?
The id of your equipment in particular slot. But check it without the .id first that it returns truthy value.

edit: Y is the slot (starts from 0)
The id of your equipment in particular slot. But check it without the .id first that it returns truthy value.

edit: Y is the slot (starts from 0)

It's returning 0 when I set a variable to $gameActors.actor(1).equips()[8] after setting equipment slot 8 to armor ID 374.

If I add the .id, it sets the variable to 15 for some reason.

edit: also tried $gameActors.actor(1).equips()[9] since the slot is #8 but it starts from 0, but same result (with or without anything equipped).
Yeah but like I wrote slots start at 0. Like weapon is usually 0. So wouldn't your slot 8 be 7?
Yeah but like I wrote slots start at 0. Like weapon is usually 0. So wouldn't your slot 8 be 7?

Ahh, yeah that makes sense, haha. I was math-ing backwards

Changed to 7 and its working perfectly now, thanks!
I see it like this:

Weapon = slot 0,
Armor = slot 1 and up.

So shield is 1 and so on. Idk, but looking at it like that, makes so much sense in my mind, that I never got it wrong since I look at it that way. 😛

And uhm... Keep experimenting like this. This is how you make huge progress. Especially when you walk into problems you can't seem to fix. (Because the more time you spend on fixing it, the better the final solution will be implanted in your memory. It's basically just like practice.)

Original thread: https://forums.rpgmakerweb.com/threads/unequip-armor-by-item-id-or-check-armor-in-specific-slot.175329/