Okay, I am really confused as to how this event command ('select item') works. Can someone explain it to me?
"Select Item" Event Command
RPG Maker MV Support@Minty Starbound...
This command will display a List of Items held by the Party, and gives the opportunity for the Player to select one of these Items. The Item ID of the Item selected will be affected to the Variable defined at the creation of the command, which can be tested to see what selection was made from the list of Items displayed.
Of what use is it..? Take the case of a Key in a Chest. The Hero has, perhaps, in his possession, a Potion and some Magic Water, but no Key. An NPC asks 'Do you have the Key', then displays the 'Select Item' window. There is no Key to select, only Potion and Magic Water, so a following test fails. The Hero now opens the Chest, and takes the Key. Returning to the NPC, the 'Select Item' windows once more, but now there is a Key to be selected..! Good; the following test is passed and the Game can continue..! Yippee..!
The 'type' of Item shown in the 'Select Item' window can be Regular, Hidden A, Hidden B or Key Items. A useful command.
Hope this helps...
This command will display a List of Items held by the Party, and gives the opportunity for the Player to select one of these Items. The Item ID of the Item selected will be affected to the Variable defined at the creation of the command, which can be tested to see what selection was made from the list of Items displayed.
Of what use is it..? Take the case of a Key in a Chest. The Hero has, perhaps, in his possession, a Potion and some Magic Water, but no Key. An NPC asks 'Do you have the Key', then displays the 'Select Item' window. There is no Key to select, only Potion and Magic Water, so a following test fails. The Hero now opens the Chest, and takes the Key. Returning to the NPC, the 'Select Item' windows once more, but now there is a Key to be selected..! Good; the following test is passed and the Game can continue..! Yippee..!
The 'type' of Item shown in the 'Select Item' window can be Regular, Hidden A, Hidden B or Key Items. A useful command.
Hope this helps...
@Dad3353 Thanks! That makes sense! Do you know if there is a way to make more than one item have an effect when selected?
just make one conditional branch for each iterm or effect
Yes; although only one Item can be selected from those displayed, having a following treatment of several of the Items is possible, one conditional statement for each. Go for it..!
Guys, anyone know how to make sure the item decreasing by one? Because I want to make an event that could give something to NPC. And I'm about to make every item that the player give will have different reaction from NPC depend on what is the item that the player gave to them.
A few days late, but you might want to try this:
$gameParty.loseItem($dataItems[ID], amount);
Where ID is $gameVariables.value(X) and amount=1
X= Variable you used when asking for an item. Example if you used variable 58, it would be
Script: $gameParty.loseItem($dataItems[$gameVariables.value(58)], 1);
What it does is remove 1 item with the ID that matches the Item ID you chose in your list.
Here is an example of what it could look like:
As you can see in this example I used Variable ID 1 to save what item I used therefore my $gameVariable.value(X) had X set to 1.
Warrning!: It would be possible to empty ones whole invetory by just spamming items to the poor NPC, so you might want to be sure that the player can't give more than Y number of items to said NPC.
Also make sure that they player can't give the npc any key items needed to progress.
Away to do this without scripts however would be to simply choose the option "Change Item" and insert it inside each and every "IF" with a "decrese by 1" option selected.... (Just as you select to add an item, just the other checkbox.)
After all, if you plan to make an option for each and every option in the game, the list would have to be massive anyway... (unless you have very few items in total...)
Oh, and the msg I put in the "If" states were just a filler... you can have the NPC jump, show a ballon, or anything else you want... It was just filler to show were to put the stuff.
Good luck!
$gameParty.loseItem($dataItems[ID], amount);
Where ID is $gameVariables.value(X) and amount=1
X= Variable you used when asking for an item. Example if you used variable 58, it would be
Script: $gameParty.loseItem($dataItems[$gameVariables.value(58)], 1);
What it does is remove 1 item with the ID that matches the Item ID you chose in your list.
Here is an example of what it could look like:
As you can see in this example I used Variable ID 1 to save what item I used therefore my $gameVariable.value(X) had X set to 1.
Warrning!: It would be possible to empty ones whole invetory by just spamming items to the poor NPC, so you might want to be sure that the player can't give more than Y number of items to said NPC.
Also make sure that they player can't give the npc any key items needed to progress.
Away to do this without scripts however would be to simply choose the option "Change Item" and insert it inside each and every "IF" with a "decrese by 1" option selected.... (Just as you select to add an item, just the other checkbox.)
After all, if you plan to make an option for each and every option in the game, the list would have to be massive anyway... (unless you have very few items in total...)
Oh, and the msg I put in the "If" states were just a filler... you can have the NPC jump, show a ballon, or anything else you want... It was just filler to show were to put the stuff.
Good luck!
Uh - if you already have conditional branches to do different things depending on what the item was, just put a Change Items to remove that item inside the conditional branch. No need to use a script call.
@Zeecry Please don't "hijack" topics to ask your own questions that are different from the original question asked by the thread starter (see our forum rules here, specifically Rule #4). It's much better to start your own thread so that each question can get the attention it deserves. If the answers already given above don't solve your question, feel free to create your own thread for this issue.
I'm really sorry for that. I haven't read all the forum rules yet, just some of them. I thought it would be very bothersome if I create a new thread for my question. I'll be more cautious next time. I hope anyone who read this won't do the same thing as I did. 🙁
And for @Maidlyn please forgive me since this thread is yours and I made it out of topic.😢
Wow, thanks a lot. It explain more than a video that I watched before 😀 it's a bit different, but I'll try
I already try it too and it worked. But I think for some other type of event would be better if I could using script call.
No worries at all - don't feel bad about it! I can see why you thought asking here would be a good option. Just in the future, unless the new question is an immediate follow-up from the discussion, it's better to create a new thread to ask your question. 🙂
Thanks for the explanation, you're a great teacher.
Whoa, 2016.
@STORMFATH3R, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.
Good to hear it helped, though!
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/select-item-event-command.71203/