Dynamic Shop

Marston

Veteran
Veteran
Joined
Dec 9, 2013
Messages
195
Reaction score
40
First Language
German
Primarily Uses
Hello there.


Nearly a year ago I made a thread, asking for a plugin. I have started with the game by now, but it's still not much. Looking back, the whole thing with chests containing random items can easily be done with common events. However, I still need a plugin for a dynamic shop.


What it should do


The game I want to make is a dungeon crawler/rogue like. Similar to The Binding of Isaac the shops in the game should be able to sell you a few items, chosen at random from all available items you have unlocked. Let's say at the start of the game you have 10 out of 20 items unlocked, so the shop can only sell you these 10 items. However, after some time, opening a specific amount of chests or defeating the boss a few times, new items get unlocked. The shop can now sell you 15 out of the 20 available items. So for once, the shop should be able to look if a specific item is unlocked (with a switch or a variable) and if it is, it can be sold to the player.


The second thing it should be able to do, it should only sell a small number of items, but this can increase over time. So if you start a new game, the shop can only sell you 3 items. But after having beaten the boss with 3 classes, the shop can now sell you 4 items. And after beating the boss with 4 more classes, it can now sell you 5 items. All chosen at random like I described above. And this could increase to god knows what number (or in my case, something like 10 would be more than enough).


Lastly, some items should be "fixed" or have a fixed category. For example, the first item the shop sells is always a potion or an item from the potion category. The second item is always a weapon. The third item could be any unlocked item. And later the fourth item could also be any unlocked item, but the fifth one may be from a "stat booster" category. So I need to be able to give items either categories or choose a specific item range that is sellable.


Items can be bought more than once, so the plugin would also have to look if an item is already available, so the shop doesn't have duplicates (but this is not that important, if duplicates are available it could also be used to troll the player xD).


How it could be done


I do have an idea as for how it could be implemented, but no idea how to actually do it. The idea would be to use notetags for each item and use them to put an item into one or more categories as well as tieing them to a specific switch or variable. If the switch in the notetags is "On" or the variable is something other than "0", the item could appear in the shop in the specified category. 


As an example, a "Minor Healing Potion" could have three categories: "Starting Gear", "Potions" and "All".


The first category I would use to make sure this item would always be the very first the shop sells, so the player always gets access to at least a Healing Potion. The second one could appear in any "Potion" category, so if the fourth sold item would be a potion choosen at random. The "All" category would simply be on any item, so it would be a category that sells all available items (like the third item sold, as I mentioned above).


Well, maybe this time I get a response. It's also less work than the whole chest thingy, which in retrospect was a stupid idea anyways. xD
 

Marston

Veteran
Veteran
Joined
Dec 9, 2013
Messages
195
Reaction score
40
First Language
German
Primarily Uses
That doesn't really help me. While I can hide items, I would still have to fork every condition since I want to choose one out of, let's say, 10 items that should appear. So I would still need 10 forks to look if this one item is available or not. 


As for the closed thread, it's really not possible to set an items price as a variable via script calls? Or to give the player an item depending on the variable?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,789
Reaction score
7,876
First Language
German
Primarily Uses
RMMV
you didn't read the plugin description. You can place any javascript code as the condition to make the shop good visible, which means there is absolutely no need for any conditional fork. The linked website gives an example of how to write the script command in a way to make a good visible depending on character level, but you can easily make that a condition of a game switch, and then you'll have a shop where you can activate or deactivate a good based on a switch.


That is the shortest way possible without a dedicated plugin, and those would be more work.


as for your workaround: the database is read-only for the engine, you cannot save any changes without a plugin. So no, your workaround would actually be more work than using tsukihime's plugin.
 

Latest Threads

Latest Posts

Latest Profile Posts

spending almost entire day to mod skyrim but it still couldn't run properly :(
My friend has become one with the glitter. @ImaginaryVillain, got any room in the Cult of the Sporkle?
I still cannot wrap my head around how to edit and use arrays in RPG Maker MV o_O
Gamemaking has been slower, but I do my best to make small progress every day. :)

Forum statistics

Threads
107,712
Messages
1,031,594
Members
139,848
Latest member
Ash9055
Top