A downloadable tool for Windows, macOS, and Linux

Download NowName your own price

RPG IN A BOX - MERCHANT/SHOP SYSTEM PLUGIN




Hi folks! Welcome! This is my newly released Merchant/Shop System for the engine/tool "RPG in a Box"(http://www.rpginabox.com). Currently it has very limited functionality, but it does perform the basics of what it needs to do.  If you like what I created, please please please consider making a small (Or large, I am not biased :-P ) donation for this project as it will help me continue to develop this, other plugins, software and games even further. 

The Merchant/Shop system utilizes RPG in a Box's Message Box and Display Choices functionality to create a merchant store for your characters to purchase from. Set up is very easy to do. The scripting and shop set up is incredibly minimal, straight forward, quick and easy.  The systems minimal functionality is highly recommended for beginners looking to spice up their games. This system is in continuous development and will continue to add more functionality and features. 

Current Version: 0.0.1

Already Implemented features:

*Users can create different merchant shops and assign them to specific NPC's, easily.

*Users can customize their shop with an intro message.

*You can create inventory for a merchant and specify stock availability and cost for the item. Purchases will deduct from the current currency of your player and from the stock of the merchant. 

*Currently the system will not show an item if either the item is out of stock or the player can not afford it. This will change in the future and be completely optional. 


Roadmap of features still to come:

*The ability to edit inventory and costs after a shop has been set up and inventory was added.

*The ability to change a shop intro message and name.

*Use of multiple types of currencies per shop.

*Inn and healing type features.

*Ability to assign a custom script to choices made.

*Editing whether or not an out of stock item or item you can not afford appears on the list or not.

*Use of JSON files as an alternative means to create shops and manage inventory.

*Conditionals to display items only when a certain condition is met.

*and MUCH MUCH MUCH MUCH MUCH MUCH MORE!


Eventually this system will be adapted for a customized turn based combat system as well.


How to Install(ALWAYS MAKE A BACKUP OF YOUR GAME PROJECT BEFORE USING):

1) Download and extract the files into your games "Script" folder.

2) Run your game and make sure the script file "NPCShopsGlobal" appears in the script list. (Make sure you do not have another script file with this name already). 



3) Go to your game configuration next.




4) On this screen, go to the "Global Properties" Tab. There, ad a property with the name: setupdone

It should be all in lower caps. The value should be 0(zero). The type should be "Number".



At this point your shop system is ready to use. 

HOW TO CREATE MERCHANT SHOPS

You can create as many merchant shops as you would like in your game. To do this, you need to run a script function in NPCShopsGlobal script.  So locate that file. Once you find it and open it up in RPG in a Box, you will need to scroll down to about line 101 in the script. It should look like this:



To create a merchant, you will need to run a script command, followed by wait(1); The command syntax is create_merchant(Shop ID name, Shop greeting message, character the shop belongs to).

So a sample function command might look like this:

create_merchant("JustinShop", "Welcome to Justin's Shop. What would you like to purchase?", player);
wait(1);

This creates a shop with the id: JustinShop - Note: Always remember this ID. The ID must be all one word and it will be case sensitive. Try not to use special symbols if you can and never place numbers at the beginning of the ID Name.

Every time your player uses the shop it will display the message: "Welcome to Justin's Shop. What would you like to purchase?" and it will show the players picture next to the dialog.

Here is an example of a script with multiple shops:

create_merchant("JustinShop", "Welcome to Justin's Shop. What would you like to purchase?", player);
wait(1);
create_merchant("SarahShop", "Welcome to Sarah's Shop. I offer alternatives to what Justin offers. What would you like?", entity["sarah"]);
wait(1);


ADDING INVENTORY TO A SHOP

To add inventory you will need to use the following script function and syntax:

add_merchant_item(SHOPID name that you created earlier, The item as it relates to the item editor, the cost, the quantity in stock);

Add this function at the following location in your NPCShopsGlobal script like so:




For each inventory item you wish to add, you will need to use multiple functions. Remember that the Shop Id has to be exact to what you typed before. Again, after each line you must add wait(1); .

Here is a sample script of adding multiple inventory items to multiple shops:

add_merchant_item("JustinShop", "ITEM_0001", 20, 2);
wait(1);
add_merchant_item("JustinShop", "ITEM_0002", 600, 100);
wait(1);
add_merchant_item("SarahShop", "ITEM_0004", 300, 100);
wait(1);
add_merchant_item("SarahShop", "ITEM_0005", 50, 1);
wait(1);


ASSIGNING A SHOP TO AN NPC OR OBJECT

The last step is assigning a particular shop to a particular npc or game object. The first thing we need to do is create a small script for that particular NPC or object so we know which shop to display.

You may name the script whatever you would like. But for the sake of the tutorial, lets call it "SarahShop". This is the code that will be in that particular script:

set_global_property("MerchantShop", NAME OF YOUR SHOP ID NAME);
execute_script("NPCShopsGlobal");

The only line you need to modify here is where it says: "NAME OF YOUR SHOP ID NAME". There you will add the shop ID as you created it. EG: JustinShop or SarahShop. Make sure you choose the correct shop. LOL. So your code in this script should like something like this then:

set_global_property("MerchantShop", "SarahShop");
execute_script("NPCShopsGlobal");

This script, when executed, will open up the shop with the id SarahShop and display it's inventory. 

Next, we want something to execute that script. So select the NPC or game object in the map editor that you wish to assign the shop to. From there edit the following "entity properties":

"When Player Interacts" should be set to "Run Script".

"Script" should be linked to the script that will open up the shop you want. Since we want to open up Sarah's shop, you will select the script that we just created: "SarahShop".



Now every time someone interacts with that entity or NPC, the shop dialog will appear.

Just create a new script like "SarahShop" in order to execute and run the shop and just change the id out in that script and you can have another shop opened up by clicking on another object or NPC. 

AND THAT IS IT! 


THE FILES INCLUDED:

You will have two zip files. One is a game folder with a demo of the merchant system in use so you can observe how it works and runs. Try interacting with Sarah and the cat to see the two different shops.

The other file is the script files you will need to extract into your games script folder.

Please join the official RPG in a Box Discordif you have any questions. 

Download

Download NowName your own price

Click download now to get access to the following files:

NPCShopsGlobal.zip 10 kB
Merchant SystemDEMO.zip 43 MB
MerchantDemoExecutableLinux64.zip 39 MB
MerchantDemoExecutableMacOS64.zip 37 MB
MerchantDemoExecutableWindows64.zip 34 MB

Development log

Comments

Log in with itch.io to leave a comment.

I'm just using the generic font that comes with rpgiab

Isn't this an RPG Maker 2000/2003 font?