Shop Manager
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.
Download
Plugin: download here (right-click, save-as)
Related Plugins
- DreamX – Random Equipment Prefixes & Affixes: ability to purchase equips with random affixes from shops
Installation
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.
Usage
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:
Shop.open( SHOP_NAME)
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”
- “city1_weapon_shop1”
- “fruit_shop2”
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.
Yeah so it turns out this thing permanently alters something in one of the core engine files that cannot be undone and causes Yanfly More Currencies to crash when it can’t read various properties “of null” if you decide you don’t want to use this plugin after testing it. Resetting the shop doesn’t remove it either.
I have 0 hope for this being fixed but am posting this as a heads up to anyone who might yknow wanna be warned that it’ll do this. It messed up a lot of things for me and I’m apparently stuck using it now even though I don’t want it because it doesn’t even seem to do anything worthwhile. The help file is incredibly vague which is why I thought I’d understand it better by testing it — big mistake. If I can’t figure out how to regain functionality for the paid plugins this one screwed up by writing things into various unknown locations that others are drawing from, I will be furious.
i cant see how to use the plugin to actually set stock numbers and sell prices, does this plugin use the older plugins to work for those functions?
Im just a beginner so this maybe a dumb question but how do i define the shop?
I would recommend using a common event for this, so that whenever the common event is called, you know it is the same shop.