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,246
Reaction score
7,627
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

Just finished composing a boss battle theme!
Scripted a multi-variable weather system that randomizes wind speed, cloudiness, rain, fogginess, etc, while attempting to realistically account for interactions between them (e.g. wind speed affects fogginess, cloudiness affects rain, etc), the current weather pattern, and the player's biome e.g. swamp, beach, etc. Now I "just" have to tie visuals and sounds to the variables so stuff actually happens...
I'm having a headache balancing the combat using flat defense so I'm gonna use percentual armor, in this pic, Simon has 16 on Defense which means all the incoming damage will be reduced by 16% this will ease my burden a bit.
!Have a nice day everybody¡
SO glad they patched outer worlds for switch! I can finally play it! Weird that other peeps are still having issues. I know it was really chugging on my lite when it first came out.

Forum statistics

Threads
105,555
Messages
1,014,623
Members
137,231
Latest member
anjing_gila
Top