In RPG Maker, you can open shops to allow players to buy or sell items. However, the functionality that is available is very limited.
The Shop Manager provides basic shop management functionality. At the core of this plugin is the ability to assign “names” to your shops,
and to be able to have the game open a specific shop when you would like to enter one.
The ability to call up specific shops allows you to keep track of additional information about the shop that would otherwise not be possible.
For example, you may want the shop to maintain a set of items for a period of time, and then randomly refresh them after that time has passed.
Or perhaps you may want the shop to hold only a limited amount of each item, and once you buy them all, it will be out of stock.
The shop manager serves as the basis for additional shop plugins and aims to improve compatibility between them, as well as providing a standard way to manage shops and shop goods.
Plugin: download here (right-click, save-as)
- DreamX – Random Equipment Prefixes & Affixes: ability to purchase equips with random affixes from shops
Download ths plugin and place it in the “plugins” folder in your project’s “js” folder. Then open your Plugin Manager (F10), double-click an empty row, and select the HIME_ShopManager plugin.
Once it is in your list of plugins, turn the plugin on.
Opening a Shop
Before opening a shop, you must tell the game which shop you would like to open. This can be done with a script call:
Where the SHOP_NAME is any name you would like. Make sure you’re using a script call and not a plugin command.
For example, you might call your shop
- “my shop”
And so on. You might come up with a naming scheme that is easy to remember. Once the name is set, it cannot be changed, so choose wisely!
When a shop is open, the game will automatically load all of the information for that shop. This plugin offers some extra functionality built-in, but additional plugins can be developed on top of it.
Finally, you can run the “Open Shop Processing” command to go to the shop.
Setting up Shop Goods
After opening a shop, the first time you run the “shop processing” event command will involve setting up the shop goods. For example, if your shop sells potions and fruits, the shop will have those set up in the store automatically.
During this setup process, any other “setup” methods provided by other plugins will be called. The setup process serves as the initialization process.
After that, however, the shop will not set up again until you choose to reset the shop. This means that whenever you visit the shop, it will be the same as when you left, unless you explicitly change it.
Resetting the Shop
If you would like to reset the shop, use the script call
Shop.resetShop( SHOP_NAME )
The next time you run the “shop processing” event, the shop will automatically set up the goods again.
By default, it will simply set up all of the items that you specify. Any custom changes to the shop that occur during the game will be reverted.
Multiple Shops in one Event
If you would like to open different shops in the same event, simply make the script call before the “Open Shop Processing” command.
For example, you can use conditional branches to ask the player which shop they would like to visit, and then open the appropriate shop.
Same Shop from Different Events
You can visit the same shop from different events by opening the same shop.
For example, if you have a traveling merchant that follows you around and appears at every dungeon, and you wanted to make it look like the same person that the player had done business with before, you would simply use the shop open script call with the same name.
I would recommend using a common event for this, so that whenever the common event is called, you know it is the same shop.