Checking if Hidden Item A Inventory is Empty (MV)

Hello!

I'm aware that there's a way to check if items/armor/weapons equate to zero in the player's inventory, but is there a particular way of checking if there are specifically no Key Items? Or Hidden Inventory Items? I ask because I'd like to have a way of not being able to access a combined item screen if there aren't any items in Hidden Item A, while there are still items in the Key Item scene.

Thank you in advance!
only by manual loop - checking each item if it is of type hidden A and if yes check its amount.
break if some is there, if no break in the loop then nothing is there.
You could also use a script call. Do Conditional Branch -> tab 4 -> Script:
Code:
$gameParty.items().filter(item => item.itypeId==2).length==0

will be true if you have no key items. I'm guessing that replacing that with itypeId==3 or itypeId==4 will check for hidden items A and B respectively. If you want to check for the absence of any hidden items, you could do itypeId>2
@ATT_Turan Works like a charm! Thank you. (I use Hidden A items to keep track of dead party members in two of my current projects.)
Thank you! I’ll give this a shot when I get home!
I use Hidden A items to keep track of dead party members in two of my current projects.
Without knowing exactly how your system works or what you do with that...if it's literally just to track who's died, there are a few ways you could go about that without having to define an item in your database for every party member, add it to the party, and then figure out how to ignore it.

You could simply use a switch for each actor, then check if HaroldDead = ON

You could also use a single variable and a few script calls. Have an autorun at the beginning of your game that initializes one as an array, e.g. $gameVariables.setValue(5, [])

Then when a character dies, you can add it in:
$gameVariables.value(5).push(actor._actorId)

And to check if a character has died:
$gameVariables.value(5).includes(character'sActorId)
@ATT_Turan - Dead characters get removed from the party and a Hidden A item with the dead actor's name gets given to the party. This works well if the actors don't get renamed by the player. One project has 4 party members except for a few instances where another actor joins for a short while, or for a couple of missions when the party splits. Another project has the player pick 4 actors from a choice of 16 pre-named actors with classes already assigned. The main benefit is that you can use the editor command "Choose Item" as an easy menu to choose dead comrades to revive, so no need to do a lot of work with the Himeworks hiddenChoices plugin.

When a party member is returned to life, the hidden A item with their name is removed, of course.

For the experimental project that has 4 party members that the player chooses face and sprite, gender, class and name for, I do use a switch for each, because I don't know of any way to change the name of a hidden A item during play. It is not cumbersome because there are only a small number of possible actors used in the party outside of cut-scenes.

I do like your suggestion of using an array, though. Might try it some time.

Original thread: https://forums.rpgmakerweb.com/threads/checking-if-hidden-item-a-inventory-is-empty-mv.141515/