This script adds a “stock” count to each shop good.
Once a shop good’s stock reaches 0, it will no longer be available in the shop.
The stock is set up for individual shops. One shop’s stock does not affect another shop’s stock. The stock is only setup once: if you leave and come back, the stock remains the same
Script: download here
Required: Shop Manager
In your event, before the Shop Processing command, use the following script call. If you don’t set a stock count, then it is assumed to be unlimited.
@shop_stock[id] = amount
Using the Shop Manager, the shop stocks are setup for each individual shop
So let’s say the player bought 6 potions. The picture doesn’t show it, but the player actually left the shop, went to explore a dungeon, and then came back to buy more potions. Unfortunately, we have limited potions in stock…
And once you buy up all the potions, that’s it.
I was just wondering if it was possible to add an “x” just before the stock count in shop. So you have “x3” and not just “3” when for example, the stock limit of that item is 3.
I think it would help the player figure out what that number is (as, if it wasn’t my own game, I wouldn’t have a clue of what that “3” means, until i buy an item, and I think it’s kinda sad).
Thank you for the script anyway, it saves me !
I looked for a plugin like that since a long time ago but it looks to be used for RPG Maker VX (Ace) and I’m looking for the same but for MV as a .js files. Does it exist ?
Sorry about my poor English.
I'm using your code in my project but I found something I wanted to fix but i have no idea how: The name of some items are too big, and then they cross with the stock numbers and get overlapped. Is there any way to fix this, like, moving the text to the right a little?
Thanks! Great script.
PS> In the first screenshot of this page there's a nice HUD for the shop, you can share it?
If you want to move the text over you can go to line 138 and before you draw it add a
The HUD is yanfly's shop system.
Would it be possible to say… combine this with the common event shop?
Like, have it to where you can only buy 1 "Increase Level" item?
Or would that not work?
Probably not, since it was not really designed with the others in mind.
i got the next problem when i tried to buy a weapon
I set a totally normal shop without any script calls or anything extraordinary at all.
It only happens when i'm trying to buy weapons or armors.
When i put normal items in the shop it works just fine
I’m having an issue where my item names are longer than just a few characters, and so the quantity is displayed in the middle of the item name. Is there a way to push the quantity farther to the right, or remove the display altogether? Thanks in advance!
If you want to remove the stock count altogether you can go find Window_ShopBuy in the script and delete the draw_item method. If you want to change where it’s drawn, that would be more complicated.
I have a question, why the stock is reinitialized after leaving the map ? Its a nonsence, because, the player will leave the map, so, he returns later, and the shop is the same.
I don’t get it.
Maybe I forget to do something, it’s possible, of course, but now, the script has no usage.
Thanks in advance
I’ve updated the shop manager to solve this problem. It should not reset anymore on map change.
Was wondering, if it would be possible to maybe replenish the stock with a script call or such?
Like setup a parallel process event that manages time and after 2 days replenish the stock. Just
wondering if that’s possible.
I am not sure if it is possible. I did not add functionality that would make it easy to do that.
Okay, just sorta throwing it out there.
May I suggest you to make a option to color or not the numbers of the available items ? (Sorry for my bad english).
I will add that as an option. Thanks for the suggestion.
im so noob so i dont really know if what i need is possible right now. Is it possible to “re-stock” the shop under some conditions, like real time? i mean, +1 potion x 10 mins after the trade is available, for example. really thx for all ur scripts, xtsukihime
ok, sorry im retard, there is a comment asking the exactly that and i didnt read it.