Hidden Shop Goods
In RPG Maker MV, when you create shops, you start by specifying a list of items that will be sold, along with their prices.
The engine then handles the rest for you so that when the player talks to the shopkeeper, the items you’ve set up will be displayed.
However, what happens if you want to make it so that certain items are not shown depending on certain conditions? For example, if a weaponsmith offers different types of weapons, you might want to hide certain weapon types if no one in the party can use it. If your actor can only use swords, you might want to hide all the bows and spears.
This plugin allows you to hide shop goods quickly and easily using a simple command. Just create your event the way you normally do and hide shop goods!
Download
Plugin: download here (right-click, save as)
Installation
Download the 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 HiddenShopGoods plugin.
Once it is in your list of plugins, turn the plugin on.
Usage
For this plugin, you will be referencing shop goods. For example, if you want to hide the second shop good, you will need to know how to number them. Take a look at this illustration:
This is the numbering system that will be used to number the goods. You will use these numbers when hiding shop goods.
There are two ways to hide shop goods.
1. Using a plugin command
Create a plugin command and write
hide_good shopGoodNumber
Where the `shopGoodNumber` is the number of the shop good that you would like to hide.
For example, if you want to hide the third shop good on the list, you can write
hide_good 3
It is up to you to create conditional branches to determine when a shop good will be hidden.
2. Using a script call
Create a script call and write
hide_good(shopGoodNumber, condition)
Where the `shopGoodNumber` is the number of the shop good that you would like to hide.
The condition is any valid javascript expression that evaluates to true or false. If the condition is true, then the shop good will be hidden.
For example, if you want to hide the fourth shop good if the party leader’s level is less than 10, you can make the script call
hide_good(4, "$gameParty.leader().level < 10") Don't forget the quotation marks around the condition.
Working with Multiple Shop Processing Commands
When you hide goods, these settings only apply to the first shop processing command. If you have another shop processing command afterwards, you will need to hide them separately.
My recommended way to hide goods is to try to group the hide commands right before the shop processing like this:
Would this plug-in work for RPG Maker MZ?
Would the following script call disable good 2 if Variable 1 is less than -1?
hide_good(2, “$gameVariables.value(1) < -1”)
Also, are script calls JavaScript?
Yes, all script calls in MV are javascript.
Yes. It would hide it, preventing it from being seen.
This plugin is going to save me the headaches with an increasing item variety for my Item Shops.
In my game, there are 39 Restoration Items, with most of them curing each of my many negative status effects.
Two Restoration Item slots are reserved for a Negative State that has yet to be added to the game.
https://drive.google.com/open?id=0B3YpblxtxnazSkU3RmdONGZKNEE
Now all I need is a script that lets one sell items for other items.
IE: Apothecary shop where a potion costs 2 healing herbs and only shows up if you have more than 2 herbs.
Guess for now one could use variables and do a trade in of the items and enable selling those items in the shop.
I really like your scripts.
When working with custom costs, there are two parts to it
1: setting up the custom cost. This isn’t too difficult.
2: figuring out how to present it
With the default shop scene, this isn’t suitable. You may need to come up with a design for it.
Oh, and please share my plugins if you like them! You can also write tutorials showing how to use the scripts to implement certain mechanics.