How can I make a potion give an empty bottle after use?

Hey so just wondering if there's a script or something out there that can help.

In my game I want there to be a thing where if someone uses a potion they get an empty potion bottle at the end (which acts as a crafting ingredient for a potion later on).

Any help would be appreciated!
You could make the empty bottle a separate item and add it to the player's inventory upon consuming the potion
Yeah I figure it would be something like that but... how can I make the game know to do that? 😅

Is it via common events?
Try with a common event: Add the effects of the potion, at the end add the empty flask to the inventory
I confused myself for a second thinking I needed to make the common event give the HP restore as well but turns out I didn't need to lol

Was literally just this:
1724805150802.png


Got it working now, thanks!
I made a function in my base plugin that can do just that upon using it.
I believe I have that in the MZ version too.

Edit: if you want it automated way, this is the function from my base plugin.
which has some other things, but you can use it as stand alone:

Edit:
I took the code from my base into a stand alone plugin for you.
this does what you want 🙂

but if needed, use my BaseMZ so it work correctly if this one fails.
just one slight warning:
if a skill or item with an attached common event kills the last enemy of a troop in battle, the battlescene ends before the common event is processed.

there are ways to prevent that, but that is much more work and I don't know if it is worth the hassle for an empty bottle.
I made a function in my base plugin that can do just that upon using it.
I believe I have that in the MZ version too.

Edit: if you want it automated way, this is the function from my base plugin.
which has some other things, but you can use it as stand alone:

Edit:
I took the code from my base into a stand alone plugin for you.
this does what you want 🙂

but if needed, use my BaseMZ so it work correctly if this one fails.
Gave it a quick try and it works!
I made the code original to <prev item>, but on use was an idea of someone
else, so it kinda have a zelda effect on item use.

zelda link to the past can use a potion twice, but also fill a bottom with a fairy.
this bit losing a bottle still require eventing, but when using it, it goes back.

so I got my idea from there as tiny background idea ^^ and didn't exist yet.

good luck on your project.
This thread is closed due to being reported as solved. If you need it reopened, report it to let us know. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-make-a-potion-give-an-empty-bottle-after-use.171476/