Shop Stock

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

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

Download

Script: download here
Required: Shop Manager

Usage

shopStock0.jpg

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

shopStock1.jpg

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…

shopStock2.jpg

And once you buy up all the potions, that’s it.

shopStock3.jpg

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

18 Responses

  1. GuiltyAxer says:

    Hey,

    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 !

  2. Anonymous says:

    Hello,

    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.

  3. Ado says:

    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?

    • Hime says:

      If you want to move the text over you can go to line 138 and before you draw it add a

      rect.x += 10
      

      or something.

      The HUD is yanfly's shop system.

  4. Thanos says:

    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?

  5. Jonathan says:

    i got the next problem when i tried to buy a weapon

    https://lh3.googleusercontent.com/-C6u8Z6iUxo0/U2i4eAOghCI/AAAAAAAAAGc/GDhhDtvpsj8/w398-h184-no/Untitled-1.png

    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

  6. John says:

    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!

    • Hime says:

      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.

  7. Jonathan says:

    Hi,
    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

  8. AJ says:

    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.

  9. May I suggest you to make a option to color or not the numbers of the available items ? (Sorry for my bad english).

    • xtsukihime says:

      I will add that as an option. Thanks for the suggestion.

      • rapture says:

        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

      • rapture says:

        ok, sorry im retard, there is a comment asking the exactly that and i didnt read it.

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax