how to have a key item trigger an event?

currently i am trying to do something simple, im making an adventure game and for that I want items to be a big part, basically I'm currently making a test event of obtaining a crowbar as an item, and then destroying a door, however I have trouble understanding variables and the select item command

I want it to go like this, you have a door you cant enter, so you need an item, you look for the item and obtain it, once you have you open the door, easy as that, I somehow haven't found a lot of answers to this or anything that's clear enough

I also want it that you can use other items that don't work, however still give dialogue
1649241135973.png

1649241189685.png


If I understood you right... It should be as simple as this.
View attachment 222387
View attachment 222388

If I understood you right... It should be as simple as this.
i have done that, but i was also wondering how you could select other items as well to grant special dialogue (like using lets say a bottle, then the event will say "you cant use a bottle.."), I don't know if constantly using if statements would help as I've heard its not a great thing to do in games
i have done that, but i was also wondering how you could select other items as well to grant special dialogue (like using lets say a bottle, then the event will say "you cant use a bottle.."), I don't know if constantly using if statements would help as I've heard its not a great thing to do in games

You'd use the "Select Item" command you mentioned initially.

Basically, it assigns the ID of an item you choose to a chosen variable. So if you pick item ID 7, it will assign 7 to that variable you pick.

What you'd want to do is to run a conditional statement checking the variable used in the Select Item command, and then have something happen if the variable is a specific value. That way, you can just add an extra conditional branch when you want an item with comment (like the bottle you mentioned).
i have done that, but i was also wondering how you could select other items as well to grant special dialogue (like using lets say a bottle, then the event will say "you cant use a bottle.."), I don't know if constantly using if statements would help as I've heard its not a great thing to do in games
I don't see why if statements would not be a great thing. They are quite literally mandatory if you want to check for something.
But yeah, what @arsMori said is also possible. There's multiple ways to accomplish the same thing.
You'd use the "Select Item" command you mentioned initially.

Basically, it assigns the ID of an item you choose to a chosen variable. So if you pick item ID 7, it will assign 7 to that variable you pick.

What you'd want to do is to run a conditional statement checking the variable used in the Select Item command, and then have something happen if the variable is a specific value. That way, you can just add an extra conditional branch when you want an item with comment (like the bottle you mentioned).
can you have visuals for this? sorry if I didn't understand it right away but I get confused easily
can you have visuals for this? sorry if I didn't understand it right away but I get confused easily
My bad, here it is:

1649243919130.png


"Door Unlock" is the name of the variable btw
My bad, here it is:

View attachment 222389

"Door Unlock" is the name of the variable btw
this worked, thank you!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-have-a-key-item-trigger-an-event.146476/