Most efficient way to use items manually?

Joined
Jul 12, 2020
Messages
63
Reaction score
15
First Language
English
Primarily Uses
RMMV
I know I've asked this question before, but I just can't seem to find a simple way to do it.

What I mean by this...
-Player comes to a locked door and can't pass it. They are standing in front of the door and facing it.
-Player then opens their menu, goes to items, and selects an item (in this case, a key!).
-When the key is selected, a prompt should appear that would ask "Use the key?" (Yes, no)

Boom.

Does anyone have any suggestions/tips about using items manually at an event to trigger something?
What do you guys believe would be the most efficient way to create something like this?
I'm looking to experiment with pretty much anything at this point...
 

SmashArtist

Lazy Artist
Veteran
Joined
May 31, 2016
Messages
892
Reaction score
1,650
First Language
English
Primarily Uses
RMMV
Well one idea is to have each item run a common event when used.
In that common event check which map the player is on and their coordinates.
If it matches the map and coordinates that that item should be used on, then add the "Use the key?" text and so on.

I haven't tested this myself, but it should work.
 

Hyouryuu-Na

Sapphire Sodium
Veteran
Joined
Jun 15, 2017
Messages
842
Reaction score
1,957
First Language
Not English
Primarily Uses
RMMV
I prefer to not give the player any hint that the item can be used at all. They'd interact with the door and it could say a message "It's locked" or something like that. Going into the menu would be very tiresome again and again so I've made it so that the 'I' key directly opens up the inventory where the player selects the item and a common event checks if the item id, map id, player position, player direction and any extra condition are all right. If any of these condition aren't filled, the key doesn't work. If all the conditions are met, the door opens. Personally I don't like to include confirmation for reusable items like keys because they won't disappear anyways. Confirmation for usable items like food, drinks is necessary because impatient players mashing buttons might accidentally use them up.

Btw, you can also make a quick-select item sort of system where you can press two buttons to go back and forth between items to select them right on the map. It saves a lot of time while selecting items.

I wish I could actually give you a graphical representation of this but my laptop broke :")
 
Last edited:

Nolonar

Veteran
Veteran
Joined
Feb 18, 2018
Messages
160
Reaction score
232
First Language
French, German
Primarily Uses
RMMZ
If by "most efficient" you mean most convenient for the player, I'd solve it this way:

A conditional branch that checks if you have at least one of the right keys.
If yes, ask if player wants to use the key.
If no, say "it's locked" or similar.

If selecting the key is part of a puzzle, for example the door has a "statue missing a nose" and the key is a "broken piece of stone", I'd do this:

Say "it's locked" or similar.
Open item selection.
Check if player chose the right item.
If yes, open the door (no need for confirmation here).
If no, say "that's not right" or similar.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,221
Reaction score
1,198
First Language
Spanish
Primarily Uses
RMVXA
using items manually would require a proximity check to the target event.
triggering the event, and having the event check for the item, is just one conditional.
(as in, watch the door not the key... have the player interact with the door, and have the door check for key, and when it's missing it'd print "locked!" and when it's found it'd open itself, instead of having the player interact with the key and have the key look for a door)

also, the item requires a common event, triggered through the item effect.
for the purposes of *eventing*, you might as well use an actual *event*, and handle everything at event level, at map level, as opposed to at common event level, *above* map level.
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
778
Reaction score
420
First Language
Poland
Primarily Uses
RMMV
Most efficient way IMO is to use conditional branch to check if party has key and show proper choices:
 
Joined
Jul 12, 2020
Messages
63
Reaction score
15
First Language
English
Primarily Uses
RMMV
Wow! Thank you all for the ideas! I didn't even realize some of these things were done using common events haha.
I'll be sure to test them out and see what fits when I get some time!


Just an explanation on my end:
The reason I really want to implement manually-selecting items from your inventory is because my game is gonna be very puzzle-based. I know I can use conditional branches to check If Player has (item), but the engine sort of designs it to where you just automatically pass the obstacle once you have the right thing. I don't think that's a good foundation since I want players to think about what items they're using, and there'll be traps/consequences if the correct item isn't used...etc.
Hope that helps you guys understand my POV! :)
 

zzmmorgan

I've used punchcards
Veteran
Joined
Jul 10, 2020
Messages
90
Reaction score
141
First Language
English
Primarily Uses
RMMV
Yeah common events can help you with a lot of logic since the regular events can call them.
Interesting thing is I saw a comment from Yanfly once about stuff he did with plugins that could actually be done with common events.
But in general I'm finding that if things start getting crazy with nested If statements then it's definitely time to work common events into the my logic.

Are you wanting them to have to dig through the entire inventory or are you going to have a separate category for the items that are keys to the puzzles?
 
Joined
Jul 12, 2020
Messages
63
Reaction score
15
First Language
English
Primarily Uses
RMMV
Yeah common events can help you with a lot of logic since the regular events can call them.
Interesting thing is I saw a comment from Yanfly once about stuff he did with plugins that could actually be done with common events.
But in general I'm finding that if things start getting crazy with nested If statements then it's definitely time to work common events into the my logic.

Are you wanting them to have to dig through the entire inventory or are you going to have a separate category for the items that are keys to the puzzles?
Yeah exactly. Efficiency is a very hard thing to determine, especially since I'm still relatively new to RPG Maker MV, and probably don't know it's full capabilities just yet.


The 2nd one.
There'll be Key items and Other items.
Thing is, this is gonna be an open exploration world. There's 1 main quest, and a lot of side-gigs you could trigger as well. You don't have to do any of them in particular order other than the 1 main quest, which is more straight forward than the side gigs you can discover. I'm very much trying to incorporate the idea that the player could visit any other part of the game while still possessing items for 1 particular location. As you could imagine, using manual-item entry would be pretty thought-provocative. (Or, at least I think it would be!).
 
Joined
Jul 12, 2020
Messages
63
Reaction score
15
First Language
English
Primarily Uses
RMMV
Well one idea is to have each item run a common event when used.
In that common event check which map the player is on and their coordinates.
If it matches the map and coordinates that that item should be used on, then add the "Use the key?" text and so on.

I haven't tested this myself, but it should work.
Actually, how would I go about doing that?

For my test, I linked the key to a common event using the "effects" tab.
But how do I make it to where it checks which map the player is on, and their coordinates?
 

Hyouryuu-Na

Sapphire Sodium
Veteran
Joined
Jun 15, 2017
Messages
842
Reaction score
1,957
First Language
Not English
Primarily Uses
RMMV
$gamePlayer.x==1 && $gamePlayer.y==1
Checks if player is standing on coordinate 1,1
----
$gameMap.mapId()==1
If map Id is 1
----
$gamePlayer.direction()==4
Checks if player is facing left. 2=down, 8=up, 4=left, 6=right
 

SmashArtist

Lazy Artist
Veteran
Joined
May 31, 2016
Messages
892
Reaction score
1,650
First Language
English
Primarily Uses
RMMV
You can do it through eventing as well.
You can set a variable to the current map id and there was a way to check map ids, but I don't have access to my computer right now.

I'll give you a better explanation and screenshots tomorrow!
 

Triangle45

Veteran
Veteran
Joined
Aug 26, 2020
Messages
81
Reaction score
22
First Language
Spanish
Primarily Uses
RMMV
what do you mean by most efficient? There is literally 1 common event called "Select item..." and assignt its ID to a variable
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Is there anyone need help with anything except art and music?
is Gotcha Gotcha Games Inc. = KADOKAWA CORPORATION? I haven't found this topic yet, Want to know for credits on my game. Thanks.
If you get everything you want, when you want it, it kills your creativity. If you never get anything you want, you're forced to be creative with what you have.
Old chiptune loops free for use.
I think I've got my hero designs pretty much finialised ( still got some tweaks. ) In the end it'll be the four outfit colour variants with four different skintones.

Forum statistics

Threads
104,299
Messages
1,005,377
Members
135,818
Latest member
Hennet91
Top