Shop Manager

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

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

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

shopManager2

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.

shopManager3

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.

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

3 Responses

  1. Anonymous says:

    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?

  2. Dio Brando says:

    Im just a beginner so this maybe a dumb question but how do i define the shop?

    • Anonymous says:

      I would recommend using a common event for this, so that whenever the common event is called, you know it is the same shop.

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax