Item Selection Menu
The Item Selection Menu is called by the assigned key on the keyboard and lists whatever items, which call common events, you (the programmer) desire.
This script primarily uses Formar0153’s Improved Item Processing (IIP) script, but also needs anything that can call a common event, so I went with Yanfly’s Button Common Events (BCE) script, because I thought it would be the most appropriate, since calling it with a button press and being able to assign the other keys for items in the menu made it more like Zelda, especially if you find a good hud script to go with this. Read both scripts before going on. They’re both pretty simple, but effective scripts.
Here’s a video of the Pick Screen followed by the Item Selection Menu:
Item Selection Menu
In the example the player presses the Q key and brings up a menu of select items. The Level Up Badge item when used adds a level to every party member and is then consumed. The Bow & Arrows item has the player decide which key to assign it to, instead of running the actual event itself.
First, we need to set up the script:
The IIP script is not adjusted except I changed the CAT variable to 2 instead of the default 21. I also like to note what I’m using each CAT variable number for in the script, for quick reference.
This is how I’ve chosen to configure the script for this example.
Then, we need to set-up the items.
If you notice in the image of the IIP script above I listed CAT variable 7 as the Item Selection Men. This is why each of them have the tag <itemp 7>. I have used items for this example, but the script allows you to use weapons and armor as well. Just remember to not use items, weapons, and armors that have the same id number in the same menu.
Finally, here’s the common event I have chosen to be run when the player presses Q:
If you have read any of my other tutorials you may have noticed I tend to use a simpler method to return the player to the menu, than the Jump to Label: Begin Item Menu in every conditional branch. I used this method because there may be items that when used you don’t want the player to return to the Item Selection Menu. To do so simply don’t include the Jump to Label: Begin Item Menu. I meant to do that with Bow & Arrows item’s conditional branch, but in my hurry I forgot.
Now the only lines necessary for this to work are these:
First, the CAT variable is changed to the appropriate category, in this example that is 7.
Then, the Item Selection variable is cleared out to prevent any hick-ups in case the player cancels out of the menu.
Finally, we have the Item Selection Processing event command to bring up the Item Selection Menu.
Everything else is conditioned off the Item Selection variable. I’ve provided some examples (not many).
Item 5: Area Journal
This is just an example of an item, Level Up Badge, that gets consumed after using it:
Pretty simple. The nice part is that the Item Selection Menu by design eliminates the need to make sure the item is in the player’s inventory before using it, because if the player doesn’t have any the item won’t show in the menu.
Item 9: Area Journal
This is to show how you can call another common event:
The one called here, Area Journal, is detailed in the tutorial Making a Variable Display Window.
Item 7: Bow & Arrows
This is to show how you can change which key is assigned to the item, that the player will presumably be able to use on the map screen:
A Display Choice command is the basis and then depending on which key they select it changes the variable assigned to the selected key the item’s id number. I use the item’s id number for consistency, which to helps me check for errors. The next two conditional branches check to see if the item’s id number is already assigned to one of the other keys and if it is it clears the key’s variable. It would be possible to have the item’s assigned to each key switch places using a Call Common Event instead:
This is actually much cleaner and easier to use than the original method. I don’t know what I was thinking before. You could also use this to clear out the appropriate keys variable. Just use 0 instead of the currently assigning key’s variable.
Here is the A Key common event:
It just checks what variable is assigned to the key and runs the applicable event.
For reference here is the variable window:
If you need clarification on any part of this or have questions feel free to ask.