Hello there. As you know, one can check if the player has a certain item, weapon or armor in their inventory through events, specifically via conditional branches. But as far as I know, you can't specify the amount of the item. For example, how do I check if the player has not only one, but two "long swords"?
How to check if the player has a x number of copies of an item?
RPG Maker VXAce SupportThe following puts the number of items 'id y' to variable 'x':
$game_variables[x] = $game_party.item_number($data_items[y])
For weapons:
$game_variables[x] = $game_party.item_number($data_weapons[y])
Then you just check if the variable is equal to or greater than or whatever you want...
$game_variables[x] = $game_party.item_number($data_items[y])
For weapons:
$game_variables[x] = $game_party.item_number($data_weapons[y])
Then you just check if the variable is equal to or greater than or whatever you want...
That's adorable. Thank you very much
Getting the number of items, weapons or armors is also available in the normal event-command for operating with variables as long as the item-ID is not flexible.
※ Equipped weapons and armors inside party don't count.
~炬燵あ
※ Equipped weapons and armors inside party don't count.
~炬燵あ
You can use "Control Variable"
then click "..." behind "Game Data"
then select the top option.
Then you can use that variable to see if you have enough/too much of an item.
then click "..." behind "Game Data"
then select the top option.
Then you can use that variable to see if you have enough/too much of an item.
Thank you guys!
Original thread: https://forums.rpgmakerweb.com/threads/how-to-check-if-the-player-has-a-x-number-of-copies-of-an-item.149619/