Shop Options: Hidden and Disabled
The Shop Manager now comes with the ability to set two “shop options”. You can now choose whether a shop good should be included on the list, or whether a shop good should be selectable or not.
These options apply to all shops as long as they inherit from the base classes provided by the Shop Manager. I have updated my existing shops to support these options.
Required: Shop Manager
Usage
Hidden shop goods
To hide a shop good, you can specify a “hidden condition”, which is any valid ruby statement that evaluates to true or false. When the hidden condition is met, the shop good will not be listed in the buy window.
To specify a hidden condition, before the Shop Processing command in your event editor, make a script call
hide_good(good_id, condition)
For example, if we wanted to hide the 2nd good if actor 1’s level is below 10, we can say
hide_good(2, "$game_actors[1].level < 10")
Disable Shop Goods
To disable a shop good, you can specify a “disable condition”, which is any valid ruby statement that evaluates to true or false. When the disable condition is met, the shop good will not be selectable even if you have enough money to buy it.
To specify a disable condition, before the Shop Processing command in your event editor, make a script call
disable_good(good_id, condition)
For example, if we wanted to disable the 3rd good if the party leader’s level is less than 5, we can say
disable_good(3, "$game_party.leader.level < 5")
Hime, can you help me with hiding an item while switch X is on/off? Can’t figure it out 🙁
Making the following script call before opening the shop
hide_good(2, "$game_switches[3] == false")
Will hide the second good on the list if switch 3 is OFF.
Uh? Where is the script download?
Ok. Don’t worry. I thought it was a separated script! xD
I guess the way I presented it wasn’t too clear since most of my posts about scripts come with a script itself.