I want to do a puzzle in RPG Maker where, when interacting with an object, it opens your Item menu and asks you to choose which item to use. How would I go about doing this?
Adventure Game-esque Puzzles
RPG Maker MV SupportThere's a built in mechanic called "Select Item".
It doesn't open up the item menu but instead you can have the player select an item from the item type(Regular Item/Key Item/Hidden Item A/Hidden Item 😎.
The item the player picks has it's ID stored in a variable of your choice so all you have to do is make a conditional branch based on what the value of that variable is.
The "Select Item" command is on the first page under the "Message" section.
It doesn't open up the item menu but instead you can have the player select an item from the item type(Regular Item/Key Item/Hidden Item A/Hidden Item 😎.
The item the player picks has it's ID stored in a variable of your choice so all you have to do is make a conditional branch based on what the value of that variable is.
The "Select Item" command is on the first page under the "Message" section.
The way I'm designing the puzzle is that (to vastly oversimplify) you have three boxes and three items. It doesn't matter which goes in which, but they have to be the right three items. The game doesn't confirm the puzzle is solved until all three items are in the boxes. What I want is, when you put an item in the box, the game either flips the "correct" Switch or doesn't, but also takes that item. Then, if you go back to that box, it tells you what item is in it and asks if you want it back. Is there any way to do this without creating a ludicrous amount of Event Pages (I imagine not, but it's worth that ask 😛)?
You can do it with three events that are really only one event, copied with slight adjustments. You will need script calls, but just a few:
$gameParty.loseItem($dataItems[$gameVariables.value(15)], 1);
$gameParty.gainItem($dataItems[$gameVariables.value(15)], 1);
$gameVariables.setValue(15, 0);
I have the entire event in my RPG Maker, is there a quick and easy way to post the event script here to show how I did it? Copy n paste doesn't seem to work. Would the line from the .json file be useful?
$gameParty.loseItem($dataItems[$gameVariables.value(15)], 1);
$gameParty.gainItem($dataItems[$gameVariables.value(15)], 1);
$gameVariables.setValue(15, 0);
I have the entire event in my RPG Maker, is there a quick and easy way to post the event script here to show how I did it? Copy n paste doesn't seem to work. Would the line from the .json file be useful?
*EDIT*
Okay, using screenshots!
Three events, each like the above, should do the trick. You can copy and paste and just change the variables. E.g. 'If box a contents...' to box b and box c on the other two events. I used variables 15, 16 and 17, which are accessed in the script calls.
You can leave out the console.log lines, I just used them for debugging purposes.
*EDIT #2*
Sorry for the double post, I thought the screenshots were being inserted as an edit to the first post.
Okay, using screenshots!
Three events, each like the above, should do the trick. You can copy and paste and just change the variables. E.g. 'If box a contents...' to box b and box c on the other two events. I used variables 15, 16 and 17, which are accessed in the script calls.
You can leave out the console.log lines, I just used them for debugging purposes.
*EDIT #2*
Sorry for the double post, I thought the screenshots were being inserted as an edit to the first post.
Original thread: https://forums.rpgmakerweb.com/threads/adventure-game-esque-puzzles.118522/