Items with Buy & Sell Prices from Variables

Hi all,

For buying and selling items between towns at a profit, similar to how Sid Meier's Pirates! economy works, I used to use a script that could launch a shop window and pull items with variable buy/sell prices (sells for the same amount that you buy it for, for example, buys for 25, sells for 25). This number would be pulled from a variable for each item, randomized at the game start. Then if you went to another town, the price for that same item would be different (buy/sell in Town A for 25, buy/sell in Town B for 35. Profit of 10g for each item you transport).

I had a script ages ago for VX Ace that would allow me to do this, and I was going to take a look at it and see how difficult it would be to convert (I know almost nothing of JavaScript). But the download has since 404'd, as this script was written in 2016. I tried to reach out to the original author but he has also been offline for 4 years.

I was wondering if anyone would be able to recreate this in JavaScript?
there is a evented part how its done on inn price per actor/member
which can be found here. the same purpose can be done with shop
if you use variables first, than opening a shop.

but the handling might be a tiny bit different though.
there is a evented part how its done on inn price per actor/member
which can be found here. the same purpose can be done with shop
if you use variables first, than opening a shop.

but the handling might be a tiny bit different though.

Thanks for the reply,
While recreating the shop menu by events and dialogue works for single-transaction shops like Inns, it won't work for the RPG Maker MV shop buy/sell menu as far as I can tell.
yo can look into Burning Orca Shop shop, it can have taxes, switches, variables, which can
increase prices, variable probably as well, but it might some js knowledge.

there might be other shops that can increase prices thrue variables. but I didn't use it yet.
@ShadowDragon: I don't have taxes, just discounts. I don't remember having switches or variables which increases price either. The only plugin I know of having variables as prices is YEP_ConditionalShopPrices!
I guess with my plugin you could just set up two identical shops with fixes custom buy and selling prices, not based on a variable.
@BurningOrca the switch On and switch OFF is for the text to show, and stock of amount
or by variable ID. but I also thought you could created custom sell prices with a bit of
javascript that can include switches or variables?

unless you remove that part because it broke some functions.
otherwise, I have no idea if there is one existing one.
@ShadowDragon: I don't have taxes, just discounts. I don't remember having switches or variables which increases price either. The only plugin I know of having variables as prices is YEP_ConditionalShopPrices!
I guess with my plugin you could just set up two identical shops with fixes custom buy and selling prices, not based on a variable.

This is exactly what I was looking for, thanks very much. I was already thinking of picking up access to Yanfly scripts since it's only $30, but this will probably settle it for me.
I don't know if you solved your problem. I've been neck deep into Yanfly's Condition Shop prices, but it doesn't seem to work for selling items, only buying them, unless I'm just completely using it wrong.
I actually didn't test the Sale Price back when I was messing with this, but you're right, the sale price is always equal to 50% of the base price in the editor while the buy price is equal to the variable you set it to. For example, I had a Ring that costs 300 "in the Editor", but its actual price is set in the note tags to be equal to V[44] which is 35. The buy price is 35 as intended, but the sell price is 150 (half of 300).

Would anybody here be willing to write a quick hot fix for YEP_X_CondShopPrices?
I sort of solved my problem. I added Exhydra's shop options which allows setting the sell price a variable. I still have to manually calculate all the other variables which Yanfly's plug in does for the buy side automatically. Clunky, but better than nothing.

Original thread: https://forums.rpgmakerweb.com/threads/items-with-buy-sell-prices-from-variables.123154/