Trilobytes MZ #1: Limited Stock Shop

Limited Stock Shop v1.09
Trilobytes by Trihan
​

Introduction
This plugin allows you to set up shops which sell finite quantities of various game items, useful for if you want a unique item that will only be sold once, limits on purchases of powerful items, or an NPC that shows up in different places with new stock each time.

Features
  • Set up a shop with limited inventory of any combination of items, weapons and armours, with the option of using the database price or specifying your own
  • Add or remove stock to an existing limited shop
  • Change prices without affecting inventory
  • Set up automatic restocking, either on a per-item basis or with a default frame delay*
  • Choose a random selection of items from the available pool, either once or every time you visit*
  • Give shops stock quantities using variables!*
  • Automatically remove "sell" command from purchase-only shops!*
* premium version only

Screenshots
shop1.png

shop2.png

shop3.png


How to Use
Download the .js file for the plugin, add it to an empty slot in the plugin manager, set up parameters to your liking, and read the help file for usage instructions and an example setup.

Plugin Commands / Script Calls
  • Set Shop Stock - allows initial setup of a limited shop. There are arguments for map ID and event ID, allowing for remote setups. If you use this command in the event that acts as a shop prior to the Shop Processing command, only the first visit will perform shop setup; subsequent interactions will ignore it.
  • Add to Stock - Adds items to an existing shop.
  • Add to Stock (with price setting) - Adds items to an existing shop, with the option to modify prices.
  • Remove from Stock - Subtracts stock from the shop. An argument is provided to either remove the item from the shop entirely when sold out, or to display "SOLD OUT" text while keeping the item visible (this text can be modified via plugin parameters)
  • Change Prices - Allows price changes without affecting the inventory or stock levels.

Demo


Download
You can obtain the free or premium version of the plugin from itch.io

Terms and Credits
The free version of the plugin can be used in non-profit games; the premium version can be used in both non-profit and commercial projects. In either case, please credit Trilobytes or Trihan. Full terms of use are listed in the help section of the plugin file.
Perfect, was actually looking for something like this yesterday 😳

Not much point having Unique equipment if you can buy several xD
Perfect, was actually looking for something like this yesterday 😳

Not much point having Unique equipment if you can buy several xD
Is the feature set sufficient for your needs or is there anything it doesn't do that you'd like to have?
Is the feature set sufficient for your needs or is there anything it doesn't do that you'd like to have?

Seems fine to me, I was basically just interested in limited stock tbh 😛

Might have use for the random stock later though, that seems interesting.
Seems fine to me, I was basically just interested in limited stock tbh 😛

Might have use for the random stock later though, that seems interesting.
Yeah, it wasn't originally planned but one of the testers suggested it.
My hero!
Best £5 I've spent in a long time.

EDIT
I've had a thought.
Restocking is after a certain time. Is there a way to get it to restock after an event/story point using a switch? I have no way of knowing how long it will take the player to get to that point, so a switch would be easier.
Thanks.
My hero!
Best £5 I've spent in a long time.

EDIT
I've had a thought.
Restocking is after a certain time. Is there a way to get it to restock after an event/story point using a switch? I have no way of knowing how long it will take the player to get to that point, so a switch would be easier.
Thanks.
Thanks Kes! Your custom is appreciated.

I can certainly add that as a feature in the next version. How would you want that to work?
All I would want is to be able to specify a switch to restock, rather than just a timer. I would like to be able to have some which restock and some which don't.

But I'm having problems with the restock thing even in the current version. In plugin parameters it says (default restock time) that if I don't want it to restock, then I should specify -1. The problem comes from the fact that the click thing on the side of the box will increase the number above zero but will not decrease it below zero. Nor can -1 be typed in as the box does not seem to recognise the minus sign.

But more basic still, when I put in a create shop event I get this error message

EDIT No I don't, I just had to start a new game, not pick up from a save file.
All I would want is to be able to specify a switch to restock, rather than just a timer. I would like to be able to have some which restock and some which don't.

But I'm having problems with the restock thing even in the current version. In plugin parameters it says (default restock time) that if I don't want it to restock, then I should specify -1. The problem comes from the fact that the click thing on the side of the box will increase the number above zero but will not decrease it below zero. Nor can -1 be typed in as the box does not seem to recognise the minus sign.

But more basic still, when I put in a create shop event I get this error message

EDIT No I don't, I just had to start a new game, not pick up from a save file.
Ah yeah, sorry. I had to change it because it used to be 0 but then you can't turn automatic restocking off at all, it was somewhat of a compromise. In order to put -1 in the box, you have to switch the input type in the parameter from "number" to "text" and it will let you. There are little tabs above the input box.
And done.
Thank you.
Maybe put that in the help file?
And done.
Thank you.
Maybe put that in the help file?
Excellent suggestion, will do. <3
Just putting out feelers here: would anyone who uses MV be interested in this if I were to update it to be backwards-compatible?
it looks helpfull in 1 way, but I use BO_CustomShopsXL, as it has
the stock ability (not sure of the item left).

but instead of a switch for restock Kes suggested, I think it would
be easier to control by scriptcall: "restockShop(x)" (mapId, eventId).
x being the name of the shop.

so a switch can be left out, if you have 20 shops, you only use the scriptcall
instead of 2 switches to control them, or restock specific items.

itemRestock(shop, item, amount) or similair?

but I also think some people might love this if they dont need the bigger
shop plugin or multiple plugins to achieve the same effect 🙂
it looks helpfull in 1 way, but I use BO_CustomShopsXL, as it has
the stock ability (not sure of the item left).

but instead of a switch for restock Kes suggested, I think it would
be easier to control by scriptcall: "restockShop(x)" (mapId, eventId).
x being the name of the shop.

so a switch can be left out, if you have 20 shops, you only use the scriptcall
instead of 2 switches to control them, or restock specific items.

itemRestock(shop, item, amount) or similair?

but I also think some people might love this if they dont need the bigger
shop plugin or multiple plugins to achieve the same effect 🙂
There are already script calls you can use in MV, but if there's enough interest I'll also find a way to make the plugin commands for setting up shops work.
Limited Shop Stock v1.06 has been released! This fixes a bug with stock comparison, adds the ability to set quantities via variable, and prevents stock levels exceeding the value set in the max restock parameter.
1.06 has a bug where shops are always sold out; I'm currently looking into a fix.
Version 1.07 is now available and finally fixes the bug with stock! It turns out that there was a logic error that made it only use variables for stock quantities, so constant values no longer worked. This is now resolved.
Hi,
I'm not sure that 1.07 has fixed the bug. I am not using variables. I had to start a new play test, so this is the first time that I'm visiting the shop, and this is what I get.

Untitled.png


As I haven't bought anything yet, these items should not be sold out.
Any ideas about what I can do?
Thanks.
Hi,
I'm not sure that 1.07 has fixed the bug. I am not using variables. I had to start a new play test, so this is the first time that I'm visiting the shop, and this is what I get.

View attachment 286801

As I haven't bought anything yet, these items should not be sold out.
Any ideas about what I can do?
Thanks.
Can you show me your parameter setup? I'll have a look and see if I can figure out what the issue is.
Here you go.
Screenshot 2023-12-06 214853.png


Screenshot 2023-12-06 214933.png
Screenshot 2023-12-06 215028.png
Screenshot 2023-12-06 215053.png
Screenshot 2023-12-06 215117.png


And just the general screen for the armours

Screenshot 2023-12-06 215155.png


I went and checked the item shop. Same thing - one item sold out, one item available.

EDIT
Just for the sake of clarity - it's those items where there are more than one available which are Sold Out. The singles are all available.

Original thread: https://forums.rpgmakerweb.com/threads/trilobytes-mz-1-limited-stock-shop.147304/