Checking if Hidden Item A Inventory is Empty (MV)

Frigg

Quiet
Veteran
Joined
Jun 15, 2017
Messages
31
Reaction score
6
First Language
English
Primarily Uses
RMMV
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!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,357
Reaction score
8,771
First Language
German
Primarily Uses
RMMV
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.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,839
Reaction score
1,660
First Language
English
Primarily Uses
RMMV
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
 

Piyan Glupak

Veteran
Veteran
Joined
Nov 14, 2016
Messages
126
Reaction score
63
First Language
English
@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.)
 

Frigg

Quiet
Veteran
Joined
Jun 15, 2017
Messages
31
Reaction score
6
First Language
English
Primarily Uses
RMMV
Thank you! I’ll give this a shot when I get home!
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,839
Reaction score
1,660
First Language
English
Primarily Uses
RMMV
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)
 

Piyan Glupak

Veteran
Veteran
Joined
Nov 14, 2016
Messages
126
Reaction score
63
First Language
English
@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.
 

Latest Threads

Latest Profile Posts

Well, I've got a party tomorrow, and my friends are coming over. I wanted to work a bit on the Fandom Scouts assets so I can be ready when that update arrives... in other news, Pizza Time Horror is getting a second teaser, and it shows Cabaret Helen's last performance before the location closed.
Also who used to be scared of Chuck E as a kid? I was! Now I love him!
The new cards and what they do:

(I am clearly not a youtuber... Haha)
Just for the record you CAN use the "Exclude unused files" successfully to trim a project down seriously even if you're doing calls to various assets via plugins and such. BUT you need to do a full playtest of pretty much every option to ensure you did get every one of those other assets added in. Then I dumped the assets into a fresh copy of the project and yay it was like 400 Meg......
party time.png
If you've played Knight Shift Chapter 1 this image'll mean something to you. If not, that's also fine!

Forum statistics

Threads
117,269
Messages
1,105,999
Members
153,445
Latest member
sweetchi
Top