NPC exchange X of this item for 1 of another item, how?

I have a farmer that wants to exchange 3 pieces of manure for 1 orb...   can't use a shop as far as I know, don't want to....


So I simply need to know how to have an exchange system so players can sell their pieces of crap for really useful item instead


and I can make it more expensive as time goes on.


I greatly appreciate the help! 🙂   Thanks.
  1. Make an Event
  2. Show Text: (whatever you want and) I'll trade you 3 pieces of manure for 1 orb.
  3. Show Choices: Trade, No thanks
  4. Option: Trade // Conditional Branch : If player has 1 orb

    Change Items - 1 orb / Change Items +3 manure.
  5. else Show Text: "You don't have any orbs."

[*]Option: No thanks // Show Text (whatever you want)
Your text does not have to be that exact, you can change it up, using dialog and dialect, "Eh, you little kiddo, I need my old self an orb."


or, "Get of of me lawn or gimme that orb son!"  🤣
It is actually doable by using a shop, but you need a couple plugins for that. Yanfly's Shop Menu Core and Yanfly's More Currencies will do the trick nicely.


If you dont want to use a shop though, it will require some work with variables. First you'll have to have the game set a variable to equal the number of the item you have (Manure in this case). Then you'll create a choices branch where the player can decide if they want to trade or not. If they say yes, you'll create a conditional branch to see if the variable you set is equal to or higher than the number they're asking for, with "Create Else Branch" ticked. If they do have enough of the item, remove the number of manure and add the orb. If they dont, give a message that says so.


It'll look a little something like this.

Spoiler
Manure trade.png
actually its 3 pieces of manure FOR getting 1 orb back but I think I got it...  I'll try it..  
@Sekunri It's a little more complex than that, because you can't use the Item Conditional Branch to check how many of the item you actually have (which is something that's pretty odd that it's missing).


(I guess that's the problem with making image examples, people tend to ninja my responses before I get to hitting the post button XD)
You can use a Control Variables to get how many pieces of manure you have in inventory.  Then in the conditional branch, check that it's > 3.  And remove 3 instead of removing 1.
@TheTsunaru Oh I didn't realize you couldn't check amount of an item. Clearly I haven't tried making one of these events this way... oops
you can.
@Shaz He means by using the Conditional Branch: Item option. That only lets you check if you have the item or not, but not the quantity of said item. Like you and I said, that needs to be done by setting the quantity of the item to a variable and checking it that was instead.
That's not quite what he said - "I didn't realize you couldn't check the amount of an item" (there's no "in a conditional branch" mentioned).  Technically, you can do it within a conditional branch by using a script call.  But if you don't like scripts, using the variable is the eventing way, and it's only one extra command.  I didn't see that you'd already mentioned that before I replied.
right now I have change gold  / change item set up but you gotta see the npc every time for a single exchange.


I will check out the variable way next and see if thats better for me


thank you all

Original thread: https://forums.rpgmakerweb.com/threads/npc-exchange-x-of-this-item-for-1-of-another-item-how.73967/