I used the "select item" event command in a part of my game. There is a door to unlock, and you need the rusty key to open it. I set the variable used in the command to 1, since the id of the rusty key in the database is #0001. However, when I tested the game, you can also unlock the door with the sink handle, item #0002. This is not supposed to happen. Can somebody help me with this? I'm not sure I did it right...
Select Item Command Question
RPG Maker MV SupportI think you misunderstood the function of that command - the ID of the item has nothing to do with the ID of the variable.
If you use for example variable #99 and the player selects the item #1, then you need to check if the value stored inside variable #99 is the number 1.
If that doesn't help you to solve your problem, we need a screenshot of your event to tell you where you made a mistake.
If you use for example variable #99 and the player selects the item #1, then you need to check if the value stored inside variable #99 is the number 1.
If that doesn't help you to solve your problem, we need a screenshot of your event to tell you where you made a mistake.
I'm not sure if I understood correctly, but it sounds like you expect the variable to be compared to the item ID in the "select item" command itself? That is not the way it works 😉
This is how "select item" works:
You specify a variable and the item category the player can choose from (Key Item, Nomal Item, Hidden Item A/😎. The ID of the item the player chooses will then be saved in the variable specified so that you can check its value to find out which item the player selected.
Example in the spoiler
If that doesn't help, please show a screenshot of your event page so that I can see what's wrong 🙂
This is how "select item" works:
You specify a variable and the item category the player can choose from (Key Item, Nomal Item, Hidden Item A/😎. The ID of the item the player chooses will then be saved in the variable specified so that you can check its value to find out which item the player selected.
Example in the spoiler
If that doesn't help, please show a screenshot of your event page so that I can see what's wrong 🙂
@Minty Starbound...
The 'Select Item' command gives the opportunity of choosing an Item in the Party's possession. The ID of the Item selected is returned to the Variable that is designated in the command ('1' in your case...). To unlock the Door, you'd have to check that the contents of the Variable '1', returned by the command, is, in fact, Item ID '1' (the Key'...), and not any other Item, such as a Sink Handle. Did you make that test when conditioning the Door opening..? It would seem not.
If the issue persists please post here a screen shot of the entire Event that opens the Door, so that we may see where the solution lies...
The 'Select Item' command gives the opportunity of choosing an Item in the Party's possession. The ID of the Item selected is returned to the Variable that is designated in the command ('1' in your case...). To unlock the Door, you'd have to check that the contents of the Variable '1', returned by the command, is, in fact, Item ID '1' (the Key'...), and not any other Item, such as a Sink Handle. Did you make that test when conditioning the Door opening..? It would seem not.
If the issue persists please post here a screen shot of the entire Event that opens the Door, so that we may see where the solution lies...
Yes, that is exactly how it works as you prove yourself in the screenshot you gave - see the second line, the conditional branch - there you compare the variable (named "item variable") with the item ID (in this case 1). Why do you claim it wouldn't work that way if you do it exactly that eway? ;-)
@Andar Sorry, phrased it badly. What I meant was: It sounds like the OP was expecting the comparison to be somehow done automatically, without the need for a conditional branch. I'll edit my response to make it more clear.
Semantics, that's all. One has to carefully distinguish between the Variable ID and the contents of that Variable. It's simply a quirk of the English language allowing a certain ambiguity. No need to draw pistols.
Thanks! I realized my mistake and understand what I need to do know. Thanks. 😀
Original thread: https://forums.rpgmakerweb.com/threads/select-item-command-question.71236/
