Need help regarding an item as a variable in inventory

Does anyone know how i could make it so when the player gets a lighter in their inventory, they have a variable set to 100 (to indicate its full), and the more you use the lighter, it will subtract a single variable from the lighter fuel and when it hits 0, the lighter gets removed from your inventory. And make this independent of any/all lighters in the inventory.
i figured it out.
i figured it out.
Glad you figured it out.
In case someone in the future is looking for the same or similar thing, could you post your solution?
After that, you can click the report button and enter "solved" to have the thread closed.
Uh well i wouldnt say it is completely solved, it's only a prototype that i have tested that works mostly for what i'm wanting. But i will get around to it and will close the thread. I can't guarantee it'll be tonight but i should have time tomorrow.
i figured it out.
more often than not, you'll find that when you lay out the solution step by step, that itself IS the solution.

the real solution here, would be to declare an object lighter, and have it be it's own variable, so itself would handle it's own data on use (as per the definition of object).
homework: dig into that if you really want to learn.
And make this independent of any/all lighters in the inventory.
This you cannot do without using plugins.

By default, all instances of an item (e.g. all lighters) have the same item ID. There is no way to track which "one" of those is being used. If you have three lighters, each one will call the same common event, have the same ID, etc. It's impossible to make them be tracked separately from each other.

If you can only have one lighter at a time, without plugins I would:
- Make an Autorun at the beginning of the game that sets the variable to -1

- Attach a Common Event to the lighter

- A Conditional Branch in the event says "if the variable is -1, set it to 100"

- Then a Conditional Branch says "if the variable is greater than 0, do the stuff you want to do, then subtract 1"

If you can have multiple lighters, you'll need Dungeonmind's Independent Items:

Instead of using a global variable, you'd place a property on the item - e.g. item.uses = 100 and track that.

But the trick is having some way during the item's activation to reference that item, and I'm not sure how you can do that. I could look into adding it as a variable in my Eval Tags plugin.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-regarding-an-item-as-a-variable-in-inventory.170121/