Gamble Item Shop
This script allows you to create a shop that sells “gamble items”. Gamble items are shop goods where the player has a random chance of obtaining an item from a pre-determined set of items.
Download
Script: download here
Required: Shop Manager
You will also need the Scene Interpreter to display messages in the shop scene
Installation
Place this script below Shop Manager and above Main
Usage
Setup gamble items
To setup an item as a gamble item, go to the Items tab in the database editor and note-tag an item with a tag of the form
<gamble item> i23: 0.5 w4: 0.2 a17: 0.4 </gamble item>
The ID on the left indicates the type of item (item, weapon, armor), and the corresponding database ID. The number on the right is the probability of
obtaining that item, as a weight. So the example note-tag shows that there is a relatively higher chance of obtaining item 23 compared to weapon 4.
The chances are treated as ratios. So the chances of obtaining weapon 4 is 0.2/1.1, where 1.1 is the total of all of the chances.
Setup shop
In the event, before the “Shop Processing” command, make a script call.
@shop_type = "GambleItemShop"
The list of items should be a list of gamble items that have been set up appropriately above.
Hi I need help. I have the gamble shop working but for whatever reason it disables my event merchants from selling (it won't show up on the listing of items for sale) anything else but gamble items. Is there an easy way to have my standard merchants sell potions and things like that?
Thanks.
Are they in the same event?
really loves the script!!!!!!!!!
But when it’s opening the box (the massage going on)
and you press the space(usurlly to speed it up in a normal massage)
It can select items from the shop… Then it would cause a bug ……..
Is their anyway to fix that?
I have tried some things but couldn’t figure out how to focus on the message window. I’ll look into it at some point. However, what is the bug?
After looking for a while the Script code I menaged how to do that! Thanks, and congratulations for the nice script! 😀
Hi there! You probably don’t remember me… anyway, is it possible to gamble an item in the inventory? I mean, you get the Gamble Iten (Luck Chest for example) anywhere, from a NPC. Is it possible to when te actor use the item in tem inventory, the system gamble the item? If you don’t undestand i’ll try tho explain it better… By the way, nice script!
You could reproduce the same logic for an item, but you’ll have to get someone to do it.
What you mean by “someone”? A Scripter? Or an eventer maybe…? Anyway, thanks for replying!
Scripter. Most of the logic in the script can be re-used.
it’s not working…
after purchased item w/ gambling, it only show the item in the first line
ex :
i23: 0.5 <<< this item always wins, even with 0,1
w4: 0.2
a17: 0.4
can you help me?
-srry 4 bad english-
Works fine for me either you’re unlucky or there is an incompatibility issue.
so what am i supposed to do?
I don’t know, I guess you can try it on a new project and see if it works there. If it still doesn’t work you’ll have to make a help topic on one of the forums to see if anyone can figure out what’s going on.
does the system randomizes the items by using the chances as weights?
like if item1 has chance of 1, item2 of 3 and item3 of 5
the actual chances would be: 5/9 chance to obtain item3, 3/9 chance to obtain item2 and 1/9 chance to obtain item1?
Yes, that would be how the ratios work.
okay, thanks! I think you should clarify that on the description, coz the word chance might confuse others… 🙂
anyway, its a really useful script…