Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,838
Reaction score
7,852
First Language
English
Primarily Uses
RMMZ
Limited Stock Shop v1.07
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!*
* 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.
 
Last edited:

Willibab

The Lord of Whackery
Regular
Joined
Jun 22, 2017
Messages
795
Reaction score
2,667
First Language
Norwegian
Primarily Uses
RMMZ
Perfect, was actually looking for something like this yesterday o_O

Not much point having Unique equipment if you can buy several xD
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,838
Reaction score
7,852
First Language
English
Primarily Uses
RMMZ
Perfect, was actually looking for something like this yesterday o_O

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?
 

Willibab

The Lord of Whackery
Regular
Joined
Jun 22, 2017
Messages
795
Reaction score
2,667
First Language
Norwegian
Primarily Uses
RMMZ
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 :p

Might have use for the random stock later though, that seems interesting.
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,838
Reaction score
7,852
First Language
English
Primarily Uses
RMMZ
Seems fine to me, I was basically just interested in limited stock tbh :p

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.
 

Kes

Regular
Regular
Joined
Aug 3, 2012
Messages
23,878
Reaction score
13,883
First Language
English
Primarily Uses
RMMZ
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.
 
Last edited:

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,838
Reaction score
7,852
First Language
English
Primarily Uses
RMMZ
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?
 

Kes

Regular
Regular
Joined
Aug 3, 2012
Messages
23,878
Reaction score
13,883
First Language
English
Primarily Uses
RMMZ
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.
 

Attachments

  • 1656947722428.png
    1656947722428.png
    21.5 KB · Views: 4
Last edited:

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,838
Reaction score
7,852
First Language
English
Primarily Uses
RMMZ
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.
 

Kes

Regular
Regular
Joined
Aug 3, 2012
Messages
23,878
Reaction score
13,883
First Language
English
Primarily Uses
RMMZ
And done.
Thank you.
Maybe put that in the help file?
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,838
Reaction score
7,852
First Language
English
Primarily Uses
RMMZ
Just putting out feelers here: would anyone who uses MV be interested in this if I were to update it to be backwards-compatible?
 

ShadowDragon

Realist
Regular
Joined
Oct 8, 2018
Messages
8,205
Reaction score
3,453
First Language
Dutch
Primarily Uses
RMMV
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 :)
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,838
Reaction score
7,852
First Language
English
Primarily Uses
RMMZ
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.
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,838
Reaction score
7,852
First Language
English
Primarily Uses
RMMZ
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.
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,838
Reaction score
7,852
First Language
English
Primarily Uses
RMMZ
1.06 has a bug where shops are always sold out; I'm currently looking into a fix.
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,838
Reaction score
7,852
First Language
English
Primarily Uses
RMMZ
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.
 

Latest Threads

Latest Profile Posts

Everybody: "Hey, weren't you supposed to be making a game"?

Me. "MUST MAKE MOAR CUTSCENES!!1"
I've been watching videos about the videogame streamer Open Hand charity scandal, and the rabbit hole keeps getting deeper. At first it was just a lot of donated money being grossly neglected for years, and now there's a lot of money unaccounted for, which could turn this into a legitimate IRS crackdown.
Let's have some fun with my advent calendar. What would you like to see for Day 3: land, sea, or air? :rheh:
I've been thinking about doing a jokey submission for the Christmas jam in which, like a cartoon special where all the characters "play" a counterpart in A Christmas Carol, my MagiCats would each play a role from the C.A. Smith story The Coming of the White Worm, with Cyprian as Evagh, Rousalie as Dooni and so forth. But in the end, I figure all my development efforts should go toward the game proper.
In twitter, square phoenix had successfully prompted chatgpt to make the mini game watermelon pangpang.

Forum statistics

Threads
136,703
Messages
1,268,948
Members
180,419
Latest member
riruru
Top