Help eventing an item trading system?

Hello, sorry if this is the wrong place to ask this!!!!

I am trying to come up with an item trading system in my game in which items are worth 1,2 or 3. For example to get a an item worth 2 you can trade it for another item worth 2 or two items worth 1.
What I was trying to do until now was: the player selects the item they want from the npc from dialogue choices, a Select Item option pops up and the player chooses an item from their inventory, they choose the quantity they want to trade from an Input number message and then conditional checks if trade is possible and how much player will recieve in return based on variables.

It....kinda works?? but is also very bare-bones and I ran into some problems that I didn´t know how to solve, so I figured I should ask for help. Here is what bugs me:
1- How could I combine the Select Item and Input number together? Something like the Sell option from the shop, where you choose both the item and the quantity on the same window instead of both windows appearing and closing one after the other.
2-How can I limit the Number Input so it only allows players to choose the item quantity they have in their inventory? (Again, like the Sell option from the shop.)
3-How could I make it so the player is able to choose more than one item? (Ex: for an item worth 3 they choose one worth 1 and other worth 2) I know it´s impossible to choose it on the same Select Item so it should involve the Loop function but couldn´t figure out how to do it because I am dumb.
If anyone could help me I would be very grateful. (Also, if there are any plugins or script calls that come to mind that could help me with this please tell me)
Welcome!

It would always be more helpful if you post screenshots of what you've made in the event so far, so we have a point of reference beyond your description.

You could check out Yanfly's More Currencies, see if it does what you want:

I think that between setting costs and using the proxies settings, you should be able to do what you're trying to achieve...and then the UI part of it is already completed for you.
Welcome!

It would always be more helpful if you post screenshots of what you've made in the event so far, so we have a point of reference beyond your description.

You could check out Yanfly's More Currencies, see if it does what you want:

I think that between setting costs and using the proxies settings, you should be able to do what you're trying to achieve...and then the UI part of it is already completed for you.
Thank you! I gave a look into the plugin and it sounds interesting, but I don´t have cash to buy it right now....if I don´t figure out any other way maybe I will buy it in the future.

I just took some screenshots, don´t know if they are of any use. (Also I know the conditionals setting stuff for every single item looks horrendous right now but I plan on having a common event or something for that and the game doesn´t have that many items anyway)
Okay...well, if the plugin is not currently an option for you, just by pure eventing the answers to 1 & 2 are you can't.

Nothing you do in an event can change or limit event commands - they work the way they work.

You can throw extra conditionals and logic in there afterward, so a player selects an item, enters a quantity and you throw the error "You don't have that many!" but I think that's not great UI.

You can always have them choose an item, you get the quantity into a variable, then show the value of that variable in a text box while asking them to choose, so at least they're not guessing. But in terms of combining the windows or doing any of that automatically, no go.

As far as 3...I dunno. You could mix in some script calls so you give the items notetags that indicate their trading value, then count up the total trading value of everything selected. But then I'm not sure how you store the choices to remove when all of the selection has been done.

Maybe with more script calls, and you shove them into an array then remove all the items in the array.
but I don´t have cash to buy it right now....
while the plugin is easier and more convnient, it is possible to do the same with pure eventing.

first step is to save the current gold into a variable
then remove all gold
get the player into the shop where he can sell items to get new gold, and then use that gold to purchase other items
after leaving, either discard the remaining gold or save it to a trade balance variable before reloading the original gold value from the variable.

biggest problem here is that you don't have direct control over the trade values as they are the same as with regular gold purchases.
but you can experiment with that...

Original thread: https://forums.rpgmakerweb.com/threads/help-eventing-an-item-trading-system.165605/