RMMZ Check for hasitem with ALL items

Rixxus

Villager
Member
Joined
Oct 23, 2020
Messages
5
Reaction score
2
First Language
English
Primarily Uses
RMMZ
Hi all,

Sorry if this question is silly - I'm a noob.

I'm making a common even for chests where the player can donate items using Select Item and incrementing a variable to keep track of how many things the player has donated.

However, if the player has nothing to donate the the count continues to increment as if they did.

One solution I'm trying is to use an if statement checking if the player possesses anything, else they get a message saying they have nothing to donate, but I don't know of any way to select a range of items and doing the if statement once instead of 60 times to cover all the items.

I'd be super grateful for any suggestions!

Screenshot 2020-10-23 133658.png
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,293
Reaction score
7,637
First Language
German
Primarily Uses
RMMV
much easier, and absolutely no need for any script command.

when using the select item command, the ID of the selected item is stored into the variable - exactly so that you can check what has been selected.

do not place the check for items above that command, make it below it and check what has been donated. The command can't select an item that the player doesn't have, so there is absolutely no need for a hasitem check before.
and if the variable contains zero after the select item command, then it was aborted and nothing donated. if the variable is higher than zero, that number is the id of the donated item.
 

Rixxus

Villager
Member
Joined
Oct 23, 2020
Messages
5
Reaction score
2
First Language
English
Primarily Uses
RMMZ
much easier, and absolutely no need for any script command.

when using the select item command, the ID of the selected item is stored into the variable - exactly so that you can check what has been selected.

do not place the check for items above that command, make it below it and check what has been donated. The command can't select an item that the player doesn't have, so there is absolutely no need for a hasitem check before.
and if the variable contains zero after the select item command, then it was aborted and nothing donated. if the variable is higher than zero, that number is the id of the donated item.
Thank you Andar!
This worked great.
I have much to learn.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Evil7 added!


I did a bit of a remake on one of the maps, also I made a particle for jumping into the portal, and one for traveling through the portal. I'll probably add more sparkles later to embellish it. :LZSwink:
Polished the animation and added details :kaojoy:
Ami
What do you think about the Wood Bridge inside of Volcano?
Yet another gaming question, i'm currently playing Last of Us 2 and want to get another game to play next but can't decide between Ghost of Tsushima, Miles Morales & Jedi Fallen Order. After the latest mandalorian i AM on a star wars kick, but i also LOVED the last spiderman game that prequels Miles Morales. Ghost of Tsushima is the bottom of my list but i heard it was AWESOME. Just want a good story & fun gameplay.

Forum statistics

Threads
105,686
Messages
1,015,538
Members
137,362
Latest member
sdramose
Top