MZ Using Item Set Number Of Times

Hi all.

I want the player to be able to use an item only a set number of times (let's say 3 times), then the item gets removed. I could accomplish this so far...but, here lies the issue:

The item is a lootable item (a lighter). If the player only has one of these items, the system I have works perfectly fine, but, as soon as the player had to, say, pick up a second item of the same kind (a second lighter) the system falls through.

Is it possible to use each item one at a time? So, the player has 2 lighters and each lighter can be used only 3 times. So, the player uses up lighter 1, and then the second lighter's 3 uses is still available?

Any advice, guidance or input would be appreciated.

I am attaching screenshots of the events etc for reference.


Spoiler: Event where I give the player a lighter, and adapt a variable.
Screenshot 2025-10-06 220117.png

Spoiler: Common event relating to the uses
Screenshot 2025-10-06 220247.png

Screenshot 2025-10-06 220343.png


Spoiler: And the item page
Screenshot 2025-10-06 220439.png

Spoiler: The common event that initiates the "countdown" of uses is tied to another event where the player lights a fire.
Screenshot 2025-10-06 220616.png
So, I know how I would do this; and it is neither the most elegant nor best solution I'd wager but it is A solution.

Rather than using variables in the common event as a countdown I would make multiple lighter items that look the same to the player and multiple common events. Each Lighter calls a common event to add the next lighter in the line to the player's inventory (the lighter items themselves would be consumable). Iterate until you get to the final lighter which won't even need a common event because it will just get used and then vanish. I do see with how you're calling the common event through you'd need a few more nested ifs so it's not elegant, but it is functional.

Alternatively, if you wanted to stay with the variable and single common event method instead of making the lighter itself lootable you could instead create a 'lighter fuel' item that resets your variable counter when used to allow players to recharge the lighter while sidestepping the issue you're running into.
Assuming all lighters in your game give 3 charges, and assuming the supply of lighters is somewhat limited, you could theoretically just expand this conditional branch you already have.

Let's say your game has a maximum number of 30 "Fire charges". You'd then make your common event with a large conditional branch, starting at 30.

INI:
If lighterCharges = 30
    Light is strong blahblah.
else
If lighterCharges = 29
    Light is not so strong.
else
If lighterCharges = 28
    The last light was struck
    Remove item Lighter 1
else
if lighterCharges = 27
    Light is strong blahblah

And so on.

Alternatively, rethink your approach. Keep only 1 lighter item and have the player find lighter fuel instead. This item would use a common event to check if variable lighterCharges = 0 and if so, reset the variable to 3, then remove the fuel item, else show message "Lighter not empty".

That way you only have 1 lighter and don't have to deal with a bunch of variable conditional branches.
So, I know how I would do this; and it is neither the most elegant nor best solution I'd wager but it is A solution.

Rather than using variables in the common event as a countdown I would make multiple lighter items that look the same to the player and multiple common events. Each Lighter calls a common event to add the next lighter in the line to the player's inventory (the lighter items themselves would be consumable). Iterate until you get to the final lighter which won't even need a common event because it will just get used and then vanish. I do see with how you're calling the common event through you'd need a few more nested ifs so it's not elegant, but it is functional.

Alternatively, if you wanted to stay with the variable and single common event method instead of making the lighter itself lootable you could instead create a 'lighter fuel' item that resets your variable counter when used to allow players to recharge the lighter while sidestepping the issue you're running into.
Thanks a lot for your response. I was afraid of that - LOL all good ideas turn into not-so-good-ideas after a while.

I already have a canteen with the refillable option set to it, so that might be the way to go, since I at least know how to do that.
Assuming all lighters in your game give 3 charges, and assuming the supply of lighters is somewhat limited, you could theoretically just expand this conditional branch you already have.

Let's say your game has a maximum number of 30 "Fire charges". You'd then make your common event with a large conditional branch, starting at 30.

INI:
If lighterCharges = 30
    Light is strong blahblah.
else
If lighterCharges = 29
    Light is not so strong.
else
If lighterCharges = 28
    The last light was struck
    Remove item Lighter 1
else
if lighterCharges = 27
    Light is strong blahblah

And so on.

Alternatively, rethink your approach. Keep only 1 lighter item and have the player find lighter fuel instead. This item would use a common event to check if variable lighterCharges = 0 and if so, reset the variable to 3, then remove the fuel item, else show message "Lighter not empty".

That way you only have 1 lighter and don't have to deal with a bunch of variable conditional branches.
Thanks for your reply. I was trying to avoid going that route...maybe make the workload a little bit easier...but after a lot of obscenity directed at my game, I decided to rather use the refillable angle after all.

Original thread: https://forums.rpgmakerweb.com/threads/using-item-set-number-of-times.180440/