Rhino

~Inactive~
Regular
Joined
Feb 28, 2017
Messages
482
Reaction score
805
First Language
English
Primarily Uses
RMMV
“Select Item” is a new feature that was introduced to RPG Maker MV. This tutorial aims to explain and give some examples on how to use it.

Covering the following:

  • (For beginners) What the select item does and how to use it
  • Eventing a gift giving system
  • How to gift weapons and armors
  • Bonus: Explanation of Hidden item A & B

Although the tutorial is focused on a giving presents, it’s basically a ‘give item to event’ tutorial, meaning it can be used on doors/chests or any other kind of puzzle. You can also play through this tutorial by checking out my Select Item lesson for the MV School!

Recommended (but entirely option plugins):

Yanfly’s Message Core – So the event can react and say the name of the item that has been selected

Mjshi ‘s Conditional Branch+ – Makes eventing the conditional branches a lot simpler

Yanfly’s Map Select Equip – Lets you select weapons and armors.

Yanfly's Map Select Skill- Lets you select skills.

Ossra's Show Description- Displays the item's description to aid the player in making their decision.

I hope you enjoy this tutorial! So, without any further ado, let’s begin!

Note: If some of the pictures aren't loading, try refreshing your page. If they're still not working, please send me a message.

The select item command can be found on page one under “message” 1.png

Press it, and you’ll see this pop up asking for you to choose a variable, and the item type. 2.png

You can choose any variable you like, just be sure to remember which you’ve picked. The best way to do this is by naming the variable.
3.png

Item type refers to the items tab in the database. When making an item, you can set the type.
4.png

As you can see, the types you can chose are the same are the ones in the select item pop up. This lets you easily group the items, so the player doesn’t have to look through their entire inventory.

‘Regular Item’ is used to make items that show up under the players ‘item’ tab in their menu, and can also be used in battle (if you’ve set the occasion to always/battle menu.) They’re normally used to make items such as potions, food, books etc, anything that will affect characters/enemies.

Key Items however, are items that are connected to the story. It might be the metal that you owe a blacksmith, the toy you’ve found for a child, or well.. the key you need to open a dungeon door. These items can’t be used/consumed by the player, they are plot-related only.

With that covered, let’s try selecting an item! Using the ‘select item command’ a box will appear at the top of the screen allowing the player to choose their item.
5.png
It will also show the how much of that item the player possesses. Remember: the select item let’s the player select from their inventory, not from all the items you’ve defined in the database. Make sure your player has actually received the item you want them to choose before using this command.

Now that we’ve seen how the select item command works, let’s try using it in an event!

Here’s Harold, going about his regular hero business, on a dungeon crawl.
6.png

Oh dear, he can’t get through without using a key. Now that’s a conundrum... Luckily for Harold, we can create a key item!
7.png

Create the key, and set it up so that the price is 0 (so the player can’t accidentally sell it in a shop), it’s none consumable and can never be used (so the player can’t use the item on themselves.)

Take a note of the item ID (the number next to the item name.) For me, the key is number 5. Add the item to a chest/loot in a forced battle (not a random encounter/battle you can escape from) or however else you’d like as long as you can be sure the player will be able to find it.

Let’s make our door event...
tumblr_ox8wl2GY831vkacpbo8_r1_1280.png

When the player interacts with the door, it will show select item from a choice of all the key items in the players inventory. I’ve set the variable to be 1.

Using a conditional branch, I’m checking whether variable 1 = 5. Remember that my key item has an ID of 5. If the player has chosen the key, the door will unlock, however, using an ‘else’ branch, if the player has chosen anything other than the key, or pressed ESC to get out of the menu, it’s not going to open.

The select item command won't automatically add or remove any items, so you'll have to do that manually using the "Change Items" command. Alternatively, you can leave it in for use in another puzzle.

You could also add in several red herrings to make it harder for the player to guess which item is correct, but try not to go overboard. No one wants to be scrolling through tons of items.

door.gif

Success!

Note: this step assumes you already know the basics of how to use a select item event, if you don’t, make sure to check out the Basic Select Item Event step.
11.png

Ahh, it’s Christmas Day. After a whole year of going around and being a hero, Harold is certain he got into Santa’s ‘nice list’. He’s anxiously waiting to open his presents.

Let’s take a look in Santa’s Sack..
12.png

Item 1+2 are gifts that Harold would love to receive, whereas 3 is a little disappointing, and 4+5 are just plain awful.

We want Harold to be able to react to all of these items, but writing out a conditional branch for each one is going to be a nightmare, so let’s try using mjshi’s conditional branch +

With this plugin installed, we can check if variable 1= items 1 or 2 in one single branch!

Use the conditional script: Check.is_any(variable, *values)

To check for item one or two, we’re going to use the script;
Code:
Check.is_any(1, 1, 2)

Now that we're checking for multiple item ids in one branch, it makes things a bit trickier if we'd like to gain or remove that item after it's been selected. (As mentioned earlier, the select item command doesn't automatically change items, it has to be done manually.) Last time, we used the "change item" command- but we no longer know the exact item ID! Instead, we need another script.
Code:
$gameParty.gainItem($dataItems[$gameVariables.value(x)], n);

This script is to gain items. You could also use "$gameParty.loseItem" to remove them, but simply adding a negative number works as a negative gain to remove items!

So x in "$gameVariables.value(x)" needs to the number of the variable you've used to store the item IDs in the 'select item' command. In our case- that's variable 1.

And N will usually always be either 1 or -1.

Finally, we also want there to be a response if the player cancels their choice, so we add a conditional branch checking if the variable = 0. Poor Harold!

Let’s try making this event.

tumblr_ox8wl2GY831vkacpbo9_r1_540.png


Now Harold is going to react to the gift you give him, but hm.. It’s not very dynamic. Let’s have Harold say the name of the item you just gave him. For this, you’re going to need Yanfly’s Message Core. Use the text code \ni[\v[x]] Where x= the variable you’re checking.

14.png
Much more interesting!
15.gif
That’s all for this basic system, it’s up to you to decide how you’ll use it. Will Harold and Santa’s friendship meter increase/decrease? Will Harold be offended and challenge Santa to a fight? Are you going to unlock some super secret side story about Harold’s Grandma’s cookies? Anything is possible!

The select item command lets you choose regular, key, or hidden items, but what if you want an equipable item to be chosen? That’s where Yanfly’s Map Select Equip comes in!

When you install the plugin, I recommend changing the default Y position to be ‘top’ so that the select equip window looks the same as an ordinary select item window.
16.png

To open the window, instead of using the event command ‘select item’, you should use a plugin command “MapSelectEquip var type” where var is the variable you want to store the item ID to, and type is either 'weapon', 'armor', or 'both'.

Now Santa can give Harold an awesome new weapon instead!

17.jpg

When you’re using a weapon/armor, make sure to change \ni[\v[x]] to be \nw[\v[x]] or \na[\v[x]] respectively, or Harold won’t say the correct name!

So, we know what Regular Items and Key Items are, but what about Hidden Items A & B? Simply put- these are items that won’t show in the inventory.

You can use them as a hidden mechanic during eventing, so, instead of having an event check for a switch, you can have it look for the item being in the players inventory instead.

Their true purpose is of course, for the Select Item command! You can use hidden items to have minigame parts that you don’t want showing up in the players inventory, as a replacement for the ‘show choice text’ or to make a ‘skill/action’ with a limited number of uses (as the item will run out when it’s been selected.)

For some ideas on how to use the select event and hidden items, check out this youtube video:

Note: this video wasn't made by me and I'm not affiliated with CrackedRabbitGaming, I just thought it was helpful hence why I'm sharing it here.

Hope you've enjoyed this tutorial! Let me know if you come up with any other cool ideas/systems that use the select item event :D
 
Last edited:

SatansAngel

THE RPG Maker 2003 World Champion (retired)
Regular
Joined
Apr 22, 2017
Messages
32
Reaction score
17
First Language
English
Primarily Uses
RMMV
You have got to be kidding me...

I invented a script like this for RPG Maker 2003 about 10+ years ago and I just got MV a month or two ago. I'm sitting here already re-making the old scripts and I COMPLETELY... COMPLETELY overlooked this command in the menu. LOL!!!!!!!! OH GOODNESS.

Be back in a few days ;)

and kudos on the little javascript script commands here, that saves me a lot of time.
 

Rhino

~Inactive~
Regular
Joined
Feb 28, 2017
Messages
482
Reaction score
805
First Language
English
Primarily Uses
RMMV
I COMPLETELY... COMPLETELY overlooked this command in the menu. LOL!!!!!!!! OH GOODNESS.

Aw, what a shame! I spent a while looking for a plugin before I randomly happened to find a video talking about the select item command, so I understand :guffaw:

If you're still thinking of making a plugin like this, I have a few suggestions (ignore if not)..
There's no way to change the default select item window. Yanfly's plugin lets you change the position, rows/columns, hide the item quantity and other cool features. It'd be nice if there was a way to jazz up the select item window like this, otherwise you if you're going to be using both select items and equips, you can't really use any of these features, it's too noticeable.

The only thing I don't like about Yanfly's Equips, is that it closes the message window. (I guess since it's defaulted to appear over it.) But again, it looks weird if you're using the select item as well. (You can see in my screenshot where Santa is giving Harold a sword- the message window is closed.. I really like having it open, just so the player can remember what they're selecting the item for.)

Alternatively, if you're just going to make a different 'item to event' I think it would be nice to be able to open the whole inventory (-minus key item/option for key item alone.) It makes the gift giving part smoother, since you don't have to show a choice "Do you want to give an item, weapon, or armour?" and can just jump straight in "give anything from your inventory!"

Though, I have no idea how you'd get that to work with all the different item IDs and get the \ni,\nw,\na to work. Maybe store each in a different variable? That's going to need a whole lot of conditional branches though :guffaw:

And the other thing I think would be really neat is a way for the event to refuse/return the gift. You can do that by making a conditional branch for each id and having it change items back to +1, but that's really messy and doesn't work for the way I'm doing it with mjshis conditional branch +;_;
 

SatansAngel

THE RPG Maker 2003 World Champion (retired)
Regular
Joined
Apr 22, 2017
Messages
32
Reaction score
17
First Language
English
Primarily Uses
RMMV
Well, since I just found this in the menu and it's 5am now - I'll start looking at it another day and re-read what you posted once I'm more familiar with it on MV.
 

Rhino

~Inactive~
Regular
Joined
Feb 28, 2017
Messages
482
Reaction score
805
First Language
English
Primarily Uses
RMMV
I think you should definitely get to bed. Sleep is important :guffaw:

Of course there's no rush for this to be done by, I'm happy you're even considering it! :kaoluv:
 

kaiijuu

Regular
Regular
Joined
Dec 9, 2017
Messages
106
Reaction score
88
First Language
English
Primarily Uses
RMMV
Ah! I love this! I really wanted to create a gift giving system in my game. Would this be doable the other way around? Like the actor giving another actor a present from the party?
 

Rhino

~Inactive~
Regular
Joined
Feb 28, 2017
Messages
482
Reaction score
805
First Language
English
Primarily Uses
RMMV
@kaiijuu By default the party shares an inventory so mechanically that'd be a bit pointless, but of course where there's an event you can use the "select item" command! (Mentioned by default as there are plugins to create multiple inventories, but I'm not sure whether they'll be compatible with this method.)

So the simplest way would be to go about making something like 'tent cutscenes', or any general places where your party splits up so they're no longer just followers, and you can give each actor an event. Then you can set up the system as you like! If you want it to look like the event is giving the player an item- I'd recommend taking advantage of the hidden items type. That way the player can choose some unique items they don't already have 'in their inventory' and make it feel more like they're actually getting a gift! Just remember that you'll have to make a duplicate of these item- one that's a hidden item already in the player's inventory so they can pick it from the list, and one that's either a regular or key item which they gain after selection!

A point I seemed to have missed in this tutorial is that selecting an item doesn't automatically cause that item to be increased or decreased, you have to add that part in manually. (You would also want to create a conditional branch for ItemSelect=0 in case the player backs out of the choice.) I wrote this tutorial as I was actually figuring the system out myself, so it's a bit outdated :kaoswt2: You can check out a newer version here, though I've also gone back and updated the thread now!

If you want the player to be able to give or get gifts from other party members whilst they're followers, you'll have to set it up in a common event and use this system.
 
Last edited:

about7

Regular
Regular
Joined
Oct 30, 2018
Messages
31
Reaction score
9
First Language
English
Primarily Uses
RMMV
Hey great tips. Thanks for everything!
 

CrypticSpoon

Warper
Member
Joined
Dec 28, 2018
Messages
3
Reaction score
0
First Language
english
Primarily Uses
Other
*deleted*
 
Last edited:

Kes

Regular
Regular
Joined
Aug 3, 2012
Messages
23,887
Reaction score
13,896
First Language
English
Primarily Uses
RMMZ
@CrypticSpoon Your image is not showing up. Could you edit your post and try again. It might be easier to use the 'Upload a file' button (you'll have to chose the 'More options' button in the edit window) and upload it straight from your HD.
 

Demonbane

a very cool bear
Member
Joined
Jul 25, 2018
Messages
24
Reaction score
12
First Language
Filipino
Primarily Uses
RMMV
I learned a lot about item eventing, thank you.
 

Blue-Starbie

Lurker in the skies
Member
Joined
May 28, 2015
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hello, I've been having some issues programming the gift giving mechanic. I keep getting a "ReferenceError, Check is not defined" in the game and I don't get why. I would even back out of the menu and it gives me that error after the End command.
Any help, please?
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,643
Reaction score
11,146
First Language
English
Primarily Uses
RMMV
@Blue-Starbie Just typing the error doesn't give us anything to work with for helping you.

You need to press F8, go to the Console tab, and take a screenshot of the full error trace.

You should also post a screenshot of the event that's causing the error.

It would also help yourself to do some basic troubleshooting - make sure this happens when you have no plugins turned on.
 

Blue-Starbie

Lurker in the skies
Member
Joined
May 28, 2015
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RMMV
@Blue-Starbie Just typing the error doesn't give us anything to work with for helping you.

You need to press F8, go to the Console tab, and take a screenshot of the full error trace.

You should also post a screenshot of the event that's causing the error.

It would also help yourself to do some basic troubleshooting - make sure this happens when you have no plugins turned on.
Sorry for the late reply, been busy.
Here's the errors given:
Error 1.png
And here's the code:
Note: I moved the "If: Gifting= 0" to the bottom of the stack and "gameVariables.value(3)" from 3 to 1 to make but still crashes.
Error 2.png
I plan to have loads of items to give to the NPCs like you would in Stardew Valley so it'll be a nightmare having to program each and every item. I really need this to work.

To describe what happens, I'll talk to the NPC, if I pick "Give present" and either select an item or back out, the error screen pops up with "ReferenceError, Check is not defined". I can pick the Talk and Goodbye option of the choices and nothing happens. Before moving the "If 0" code, selecting any item will bring up the "Oh, OK" text and crash. It seems like even coming across this code just seems to crash the game.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,643
Reaction score
11,146
First Language
English
Primarily Uses
RMMV
@Blue-Starbie Your script calls have the wrong syntax. As shown in the first post, there's a comma between the item and the quantity.
 

Blue-Starbie

Lurker in the skies
Member
Joined
May 28, 2015
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RMMV
@Blue-Starbie Your script calls have the wrong syntax. As shown in the first post, there's a comma between the item and the quantity.
I've added a comma for the "[$gameVariables.value(1)], -1);" but it still has the same exact errors. I even tried putting the plugin in a brand new project and only call for text to appear and it still gives the errors. I'm completely stumped.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,643
Reaction score
11,146
First Language
English
Primarily Uses
RMMV
@Blue-Starbie I can't duplicate your problem. I put the Conditional Branch plugin into a test project and it boots up fine.

The unexpected token error means there's a typo in code someplace. It could be in a notetag, a plugin parameter - it could be you somehow got a corrupted download of the actual plugin.

When you put it in a new test project, did you re-download the plugin file?
 

Blue-Starbie

Lurker in the skies
Member
Joined
May 28, 2015
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RMMV
@Blue-Starbie I can't duplicate your problem. I put the Conditional Branch plugin into a test project and it boots up fine.

The unexpected token error means there's a typo in code someplace. It could be in a notetag, a plugin parameter - it could be you somehow got a corrupted download of the actual plugin.

When you put it in a new test project, did you re-download the plugin file?
Oh my word, after redownloading it 3 times and testing it in a separate file, it finally works! Thank you for your help, you're a life-saver! Now my NPCs can love/hate the bottles of water I give them. XD
Time to make the first real NPC!
 

Latest Threads

Latest Posts

Latest Profile Posts

I decided that for the video game i will work next year i will use characters from my TCG as main characters for the RPGMAKER game, so expand the universe, that will be a cool :CoOoOL: Here some of my characters :

Ah also yes I'm accepting commission in case tat you ask for haha.
Some people shouldn't be parents. Someone put their toddler in the hallway of the apartment building I live in at 11 p.m.... and let her wander. The heck is wrong with people?!
Twitch! Strean is currently live with some more gamedev! Feel free to drop by~
If you need some maps done, but don't like mapping or just want to focus on other areas of your gamedev, my workshop is alway open! Hit me up!
Someone leaked the GTA VI trailer, so Rockstar just put it out today. Let the hype period truly begin!!!

Forum statistics

Threads
136,755
Messages
1,269,589
Members
180,504
Latest member
Zginc
Top