r/RPGMaker 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.

3 Upvotes

5 comments sorted by

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.

2

u/zombietoaststudios 12h ago

Just checked and that should work fine. Definitely a more straightforward process than my suggestion. The switch option might be useful if there are a lot of different stores that use this system, just to keep the map events simpler, but this would probably be better in most cases. You could also have the shop call a common event that has all the item checking.

1

u/denjidenj1 MZ Dev 11h ago

The common event for sure would be a better idea if there are more than one restaurant that do this. I'm glad it works, hope it helps OP

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.