Turning in items for new items at a shop

Hi! I'm looking to implement a feature in my game where an apothecary will take monster parts from the player (along with some gold), and give back a usable item or weapon. So far, the only similar things I've been able to find are Yanfly's Item Synthesis and Other Currencies plugins, but both of those start with you selecting the item you WANT from a list, when I'd rather have a list that shows what you already HAVE, and what you can trade them in for.

Basically, if you're carrying around a Stinger, you can visit the apothecary and bring up a dropdown list of the monster parts you're carrying. When you highlight Stinger, it shows you what you can get for it (such as an Antidote, or a Poison Augment), and how much it will cost to make. Then you can complete the transaction and get your shiny new item.

Anyone know of a good plug in I can use, or script I can make myself to achieve this?
no need for a plugin - in fact it is better to make a shop with event code alone, although that will require a lot of work.

use the event command "select item" to have the player select what he offers the shop, then depending on the item ID give different options and results (show choices)
Hi! I'm looking to implement a feature in my game where an apothecary will take monster parts from the player (along with some gold), and give back a usable item or weapon. So far, the only similar things I've been able to find are Yanfly's Item Synthesis and Other Currencies plugins, but both of those start with you selecting the item you WANT from a list, when I'd rather have a list that shows what you already HAVE, and what you can trade them in for.

Basically, if you're carrying around a Stinger, you can visit the apothecary and bring up a dropdown list of the monster parts you're carrying. When you highlight Stinger, it shows you what you can get for it (such as an Antidote, or a Poison Augment), and how much it will cost to make. Then you can complete the transaction and get your shiny new item.

Anyone know of a good plug in I can use, or script I can make myself to achieve this?

How many types of monster parts are you planning to use as currencies (roughly?)

Here's the quick and dirty way

Start by setting all your monster types to some high numbered item slots (let's say 800-850?). We're gonna reserve a block of corresponding game switches and we don't want to conflict with whatever else you're doing there.

Set up the shopkeeper with a 'Select Item...' under "Message" to store the item type in a variable, and follow it up with event code that sets corresponding switches correctly (so start by setting 800-850 all to false, then just have a long line of 'if the value is 800, set switch 800 to true', and so on).

After all that variable->switch conversion, just open the yanfly-adapted shop like normal.

Now, why are we setting the switches like that? The show/hide shop extension plugin is set up for switches instead of variables, and it's easier to just go with the flow there.

http://www.yanfly.moe/wiki/Hide/Show_Shop_Items_(YEP)

Put the note tags on all the items your shopkeeper offers, so the item is hidden if you showed him none of the items required

<Shop Hide if All Switches Off: x, x, x>

where 'x' is the item/switch number of whatever monster parts can be used to buy them.

It's not elegant at all in implementation, but it's simple to set up and extend, and handles the edge cases of items that might take multiple monster parts to purchase (so if an item costs 6 stingers and 5 teeth, it'll show up in the list if you select either a stinger or a tooth, even if you don't have all the stingers and teeth needed), and once implemented, you can adjust the monster shop's inventory and prices without mucking around in an event tree, and easily set up different shopkeepers with different monster part inventories.
How many types of monster parts are you planning to use as currencies (roughly?)

Here's the quick and dirty way

Start by setting all your monster types to some high numbered item slots (let's say 800-850?). We're gonna reserve a block of corresponding game switches and we don't want to conflict with whatever else you're doing there.

Set up the shopkeeper with a 'Select Item...' under "Message" to store the item type in a variable, and follow it up with event code that sets corresponding switches correctly (so start by setting 800-850 all to false, then just have a long line of 'if the value is 800, set switch 800 to true', and so on).

After all that variable->switch conversion, just open the yanfly-adapted shop like normal.

Now, why are we setting the switches like that? The show/hide shop extension plugin is set up for switches instead of variables, and it's easier to just go with the flow there.

http://www.yanfly.moe/wiki/Hide/Show_Shop_Items_(YEP)

Put the note tags on all the items your shopkeeper offers, so the item is hidden if you showed him none of the items required

<Shop Hide if All Switches Off: x, x, x>

where 'x' is the item/switch number of whatever monster parts can be used to buy them.

It's not elegant at all in implementation, but it's simple to set up and extend, and handles the edge cases of items that might take multiple monster parts to purchase (so if an item costs 6 stingers and 5 teeth, it'll show up in the list if you select either a stinger or a tooth, even if you don't have all the stingers and teeth needed), and once implemented, you can adjust the monster shop's inventory and prices without mucking around in an event tree, and easily set up different shopkeepers with different monster part inventories.

This still seems like it will make the player select the item they want from the dropdown list, rather than selecting the item they have.

What I have in mind is more of a shop that only has a "Sell" option, but instead of trading your item for gold, you trade your item AND some gold to get another item in return.
This still seems like it will make the player select the item they want from the dropdown list, rather than selecting the item they have.
They'd start by selecting a monster part from their inventory (using the select item event), and then the shop list pops up, with only items that can be purchased with that monster part.

So you'd show him a Dragon Gizzard and it'd show a shop interface with Potion of Dragon Strength, and a Gizzard Wizard spellbook, but it wouldn't show a Necklace Of Teeth because that requires a Dragon Tooth.

Original thread: https://forums.rpgmakerweb.com/threads/turning-in-items-for-new-items-at-a-shop.111565/