Not being able to exit until you use an item!

I suck with variables, so it would be awesome if someone could help me out  🤣

I have an event where the player is told to use an item, and then forced into his/her inventory. It is completely possible for the player to exit out of the menu without using that item, so I was wondering if it was possible for it to keep sending the player into the menu until he/she has used that item.

Like I said, I'm not very good with Variables, so if you could please be more specific than "Set up a variable" that'd be awesome!  😎

If it helps, I'm using Galv's menu script.

Thanks in advance  :stache:
If there is only one of the particular item I wouldn't use a variable, but a conditional "is X in the inventory?"

Create a label at the beginning of the command which forces the player into the inventory.

Have the conditional check if the item is still in the inventory

If it is, then jump back to the label which starts the process again; if it isn't then the 'else' is left blank.
Ok this can be done several ways. But most of the ways would require you to make a specific variable for the item, to check whether it has been used or not. But I don't think this would be a good choice since you would have to do different variables for each time you wanted to do that. So I came up with something that goes outside the box but it seems to me far more simpler and it's something you can re-use to everytime you wish to make that happen.

So this is how you should do. (Note that this is not a usual way of doing this kind of stuff, so don't get confused.)

Go to the "States" tab in the Database. Create a new state with no name and no icon. But in the note box write "This is the state that I give to characters when I want bla bla bla" you get the idea..

Then go to the specific item and make it remove that one state.

So now in your event what you will do is the following:

-Inflict this state to the character you want to use the item.

-Make a conditional branch and on the 2nd tab check "Actor" and then "State" and choose the state you just made.

-Then make what it happens if the state is on the player (he hasn't used the item yet) probably you just want to make the menu pop up again.

-Then what happens if the state is off (the player used the item which cured the "State"). If it is, there you have it 🙂

I haven't tried this out, but it should work 🙂

@ksjp - That isn't a very good option since he could have more than one of this item. He just wants to check if it has been used 😛
Solved! Thank you both for your help!
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/not-being-able-to-exit-until-you-use-an-item.21618/