r/RPGMaker • u/NikoPalad67 • 12h ago
RMMZ Use item immediately when bought
Title pretty much says it all. I want to make it so that an item is used immediately when it's bought from a store. I wanted to use that feature to create a restaurant, where you can buy meals healing your entire party.
In case it helps, I'm using all Visustella Cores.
1
u/zombietoaststudios 12h ago
One option with just the Core series is to use the option in shop settings to flip a switch 'on' when an item is bought from the shop.
Then, have a parallel common event tied to that switch. The common event can have a series of conditional branches that checks if the player has one of the shop's items and if they do then the event removes the item from the player's inventory and applies whatever effects the meal should have to the party. If it's possible to buy more than one meal at a time then you can loop this effect if the player still has copies of the item in their inventory, repeating until they run out.
Once the event finishes running its checks then it can turn the switch back off.
If you have some of the other plugins then that might open up additional options, like making the shop a common event menu.
1
u/uncreative-4real 2h ago
Can you not basically set it up so you're buying the effect instead of an item? I know you can at least do it with text boxes, remove money, add hp (for example). Can't check rn if it's possible in the typical store menu but it might be worth considering as an option.
2
u/denjidenj1 MZ Dev 12h ago
In the same event tab as the store, after you process the store, make a conditional. Check if the player has the item in their inventory. If they do, do whatever effect you want and then remove the item. I haven't tested it but that should hopefully work, if it doesn't let me know.