Use items on the map to trigger events

Hey everyone! I have a question in regards to making it possible for my character to open up their inventory and for a common event to trigger if the right item was used in the right location (and with the character facing the right way).

For example: you find a locked door. Yes, you could just do a simple conditional branch and make it unlock, but I want the player to be able to open up their inventory in front of said door and choose an item they want to use on it. If they use the right one, a common event will trigger (in this case, the door will unlock).

I used to use this method back in VX with the Scrip Call command within the Common Events section and it worked like a charm. However, I've forgotten how to do that, as the code is a bit lengthy. I'd appreciate if someone could help me out with this and tell me if they're familiar with the aforementioned (or any other) method that could solve my issue.
Use the "Select Item..." event command, which will store the ID of the item the player chose in the variable you select. Then you can create a conditional branch for the variable value being the ID of the correct item, and nest that with a conditional branch checking that the direction of the player is the one you want it to be, then inside those two branches put your door unlocking sequence.
Thank you! I actually want the player to open up their inventory tab on their own, without the "Select Item" command. I've come up with this and it's working so far. Didn't know I had it in me.

example.png

I just applied this Common Event to my Key Item.

However, I will be using your suggestion for some other events that I have in mind. Thank you again!
You can use Trihan's method to tell the player to select something. But if you want to leave it to the player to go to the menu to select an item themselves, you can do these stuff:
[I answered this previously here: https://forums.rpgmakerweb.com/inde...manually-select-an-item-for-something.125266/
Just copy pasting. If you have any queries then just ask]
--------------------------
In items, there's a place where you can enter common events:
1597435494728.png

You can make a common event that will check for the player's map position. Like,
if ($gamePlayer.x==a && $gamePlayer.y==b) then the door opens.

It'd be a pain to make a common event for all items so here's a new way. Use one common event for all items on all maps:


1597438739805.png

Edit:
Forgot to put in condition checks for directions. Use $gamePlayer.direction()
2-down, 8-up, 4-left, 6-right
--------------------------------
Worked like a charm, thank you!
this sounds like something i'd just hate seeing and hasnt been done this way since mid SNES era.
cant just 1) talk to the door, 2) confirm using a key? going to make me
1) stop dead in my tracks, 2) open main menu, 3) open item menu, 4) switch item tabs,
5) find the key, 6) use the key
and hope its the right key and facing the door or have to try step 1-6 again with the jail key instead of the magic key. most game nowadays its only 1 step, talk to door and hear a sound effect.

better be consumable keys so there at least the purpose of seeing how many you have left in the menu.
I understand where you're coming from but for games of certain genre (puzzles and horror games mostly), this going into the inventory and actually choosing the right item plays a very important part in the whole gameplay. Hoping that the item fits is the point for these games. For typical rpg games? Not so much.
this sounds like something i'd just hate seeing and hasnt been done this way since mid SNES era.
cant just 1) talk to the door, 2) confirm using a key? going to make me
1) stop dead in my tracks, 2) open main menu, 3) open item menu, 4) switch item tabs,
5) find the key, 6) use the key
and hope its the right key and facing the door or have to try step 1-6 again with the jail key instead of the magic key. most game nowadays its only 1 step, talk to door and hear a sound effect.

better be consumable keys so there at least the purpose of seeing how many you have left in the menu.

Being able to automatically use items would defeat the purpose of the game I'm working on. I understand that certain genres and gameplay methods don't require this kind of approach, but for me it is the cornerstone of everything else.

Original thread: https://forums.rpgmakerweb.com/threads/use-items-on-the-map-to-trigger-events.126607/