Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Plugin Shop Stock - managing shop inventory

Tsukihime

Praised Adventurer
Xy$
0.00
By default, all shops have unlimited stock. This means as long as you can afford it, you can buy it.

This may not be desirable. For example, maybe there's only a limited supply for a given item, and it replenishes once every 24 hours.

In order to control shop stock, we'll need a plugin that will allow us to do this.

 

Zebestian

The Artist formerly known as Kaimen
Resource Team
It actually would be nice if you had some way to tell what item it is when it's sold out. Right now, there's just an empty space where the item used to be in the shop menu. Maybe leave it in there and just grey it out with the stock count on 0 or something. Is that possible? :)
 

Tsukihime

Praised Adventurer
Xy$
0.00
It actually would be nice if you had some way to tell what item it is when it's sold out. Right now, there's just an empty space where the item used to be in the shop menu. Maybe leave it in there and just grey it out with the stock count on 0 or something. Is that possible? :)
This scene was just for demonstration purposes so I intentionally left things like the description there and stuff.
I am thinking of providing different scenes with different options, so for example, you could.

1. Leave an empty space there
2. Replace it with some text that says "SOLD OUT"
3. Eliminate the spaces so it looks cleaner...

I'm not sure how I would actually let devs choose which option they want though, cause I don't want to make it a global setting that affects all shops. Ideally, you could potentially have different shops with their own way of displaying "sold out" status.
 

Rise Evil

Praised Adventurer
Xy$
0.00
So basically set up your shop before you open it. Makes sense. Then you are free to choose how you want it to look.
Exactly, so like that you avoid a global customization and allow the designer to make different shops. Even though there can be a placeholder with a default between the 3 options in the plugin for those not wanting to deal with every shops they create. But that's up to you wether or not to implement a default placeholder.
 

Tsukihime

Praised Adventurer
Xy$
0.00
Before I finalize the shop stock plugin, I need to start by basically overhauling the entire shop system.

1. Shops need a way to be identified
2. Shop goods need a way to be "initialized" and "tracked" throughout the game

Basically, instead of assuming things in the shop are just "items", I've abstracted them into "Shop Good" objects that hold references to what they represent and how much it costs.

For example, by default, if you tried to add 3 potions to the shop list. each with different prices, the game will treat them all as the first potion: you won't see different prices.

[doublepost=1447908754,1447904071][/doublepost]Here's one way to represent it being out of stock.


[doublepost=1447916329][/doublepost]Testing the shop manager and shop stock with another plugin that relies on both...
 

Gamescolar

Villager
Xy$
0.00
Good day Tsukihime,

This is quite an interesting plugin! We found your youtube video explaining this and are wondering if this was finished.

We're currently trying to make a shop where the main character purchases only 1 unique item in the shop to unlock a new stock. However, we currently have no way of stopping the players from buying a thousand copies of the first item.

This script fits the bill exactly. :D

Thanks and hoping to hear from you soon!

Best regards,
Gamescolar Dev. Team
 
Top