Hi everyone. So I'm using Hime's Choice Option to hide some choices based on which item the player have in their inventory but I don't know what to do. I've read this post but the solution is not working for me. Is there anyhow I can do it? Thank you for your help.
VXAce How to hide choices based on the item the player have in inventory using Hime's Choice Option?
RPG Maker VXAce SupportTry $game_party.items.include?($data_items[item_id]). I think I used this in my game, couldn't find in which dialogue, though. But I had this in my notes on script calls, so it should work.
Edit: Also, I found this for number of items in inventory: $game_party.item_number($data_items[Y]).
Edit: Also, I found this for number of items in inventory: $game_party.item_number($data_items[Y]).
Somehow the latter code works hmuhmu tysm!!!
Cool
I forgot to say that in the first one, item_id (just like Y in the second one) should be replaced by the number assigned to the item in the database. Just in case someone reads this later and isn't aware 
I forgot to say that in the first one, item_id (just like Y in the second one) should be replaced by the number assigned to the item in the database. Just in case someone reads this later and isn't aware 
Oh I just realised that I need the first code to work more than the latter bc I tried to obtain the item using the 2nd code and the choice does not appear.
Can you give more detail about what exactly is (or isn't) happening?
So I enforce this script before the texts and choices.
And I need the 2nd choice to appear like this when item 16 isn't in the player's inventory.
Instead it appears like this.
This is my script list just in case.
Ruby:
hide_choice(2,"$game_party.items.include?($data_items[16])")
And I need the 2nd choice to appear like this when item 16 isn't in the player's inventory.
Instead it appears like this.
This is my script list just in case.
Either
hide_choice(2,"!$game_party.items.include?($data_items[16])")
or
hide_choice(2,"$game_party.item_number($data_items[16]) == 0
for the opposite effect.
Also both Roninator's solutions in your link worked for me and EntangledPear even posted one that you stated worked for you?
Edit: Moved the ! to the correct place.
hide_choice(2,"!$game_party.items.include?($data_items[16])")
or
hide_choice(2,"$game_party.item_number($data_items[16]) == 0
for the opposite effect.
Also both Roninator's solutions in your link worked for me and EntangledPear even posted one that you stated worked for you?
Edit: Moved the ! to the correct place.
The first code works for me omg tysm.
EntangledPear's 2nd code does hid the choice, but when I obtained item 16 in my inventory the choice doesn't appeared at all (I read too fast and misread its usage). Your 1st code however hides the choice and makes it appear when I have item 16 in my inventory (haven't try the 2nd code yet).
While learning code can take time, I'd recommend learning truthy and operators since they're simple.
Eg. the difference between $game_party.items.include?($data_items[16]) and !$game_party.items.include?($data_items[16]) is simply the !, which turns the condition from true to false. So your asking 'if item 16 is in my inventory' vs 'if item 16 isn't in my inventory'
Eg.2 changing the operator from $game_party.item_number($data_items[16])>1 to $game_party.item_number($data_items[16])==0 is changing 'greater than 1' to 'equal to 0', there are other operators too, >= for 'greater than or equal to', < 'less than' and <= 'less than or equal to'. So your asking 'if there are more than 1 of item 16 in inventory' vs 'if there are 0 item 16 in inventory'
All these fit nicely into a if then statement for your hide_choice's condition.
Eg. the difference between $game_party.items.include?($data_items[16]) and !$game_party.items.include?($data_items[16]) is simply the !, which turns the condition from true to false. So your asking 'if item 16 is in my inventory' vs 'if item 16 isn't in my inventory'
Eg.2 changing the operator from $game_party.item_number($data_items[16])>1 to $game_party.item_number($data_items[16])==0 is changing 'greater than 1' to 'equal to 0', there are other operators too, >= for 'greater than or equal to', < 'less than' and <= 'less than or equal to'. So your asking 'if there are more than 1 of item 16 in inventory' vs 'if there are 0 item 16 in inventory'
All these fit nicely into a if then statement for your hide_choice's condition.
Original thread: https://forums.rpgmakerweb.com/threads/how-to-hide-choices-based-on-the-item-the-player-have-in-inventory-using-himes-choice-option.180051/