If there's anything about this on the Yanfly.moe page or the actual in-plugin help document I'm not seeing it. I can buy items for zero gold just fine, so long as I have it set so that they require some other sorta item to be purchased, (I.E. purchasing potions with rubies or something,) but when it comes to selling them back to the shop I can't sell anything unless I set its price to be at least 1 gold in the database. I even tried going in directly to the rmmz_scenes.js file and changing Math.floor(this.buyingPrice() / 2) into Math.floor(this.buyingPrice() / 1) and still nothing. Is this some sorta engine limitation?
MZ Impossible to sell items for zero gold even with Visustella Currency?
RPG Maker MZ SupportYes, it's engine limitation, because what is the point to sell for 0?
Make a new plugin with any name and paste this:
JavaScript:
/*:
* @target MZ
*/
// Override
Window_ShopSell.prototype.isEnabled = function(item) {
return !!item;
}
Oh hey, that works! Thanks!
originally the engine used the price 0 as a block to selling to prevent the selling of key items.
so yes, it is an override - setting the price to zero tells the engine to never sell that item because it is needed to complete the game.
so yes, it is an override - setting the price to zero tells the engine to never sell that item because it is needed to complete the game.
You're right. Maybe extend the plugins like this:
JavaScript:
/*:
* @target MZ
*/
// Override
Window_ShopSell.prototype.isEnabled = function(item) {
return (
item &&
!item.meta['Cannot be sold']
);
}
Now, you can write <Cannot be sold> into the item's note box to make it unsellable.
Ah, I see. So it's the Morrowind problem of how the player could potentially screw themselves over by selling the Mcguffin? I'll definitely have to keep that in mind then until I can figure out how to do Merchant containers or something so that at least if the player *does* manage to sell or lose a key item it at least won't just disappear into the aether, lol.
Original thread: https://forums.rpgmakerweb.com/threads/impossible-to-sell-items-for-zero-gold-even-with-visustella-currency.182924/