This script is just something I cobbled together to erase the contents of a store's inventory before it is called. This is a useful script if the end-user is adding inventory itsms of their own and wishes to have only their goods rendered.
Script
"script"
Code:
#==============================================================================
# ** Store Goods Wipe
#------------------------------------------------------------------------------
# by DerVVulfman
# version 1.0
# 01/17/2018 (MM/DD/YYYY)
# RPGMaker XP / RGSS
#------------------------------------------------------------------------------
#
# INTRODUCTION:
#
# This script is just something I cobbled together to erase the contents
# of a store's inventory before it is called. This is a useful script if
# the end-user is adding inventory itsms of their own and wishes to have
# only their goods rendered.
#
# Please note placement. This 'SHOULD' be above other scripts that may
# affect a store's inventory. But that will depend upon the script.#
#
# To install, paste the script between Scene_Debug and Main.
#
# To use, make a Script Call as follows : $game_temp.store_wipe = true
#
# That's really it.
#
#==============================================================================
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# Refer to "$game_temp" for the instance of this class.
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :store_wipe # Force store inventory erasal
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias game_temp_store_erase_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Perform the original call
game_temp_store_erase_initialize
# Set store erasal to false by default
@store_wipe = false
end
end
#==============================================================================
# ** Interpreter
#------------------------------------------------------------------------------
# This interpreter runs event commands. This class is used within the
# Game_System class and the Game_Event class.
#==============================================================================
class Interpreter
#--------------------------------------------------------------------------
# * Alias Listings
#--------------------------------------------------------------------------
alias interpreter_store_erase_command_302 command_302
#--------------------------------------------------------------------------
# * Shop Processing
#--------------------------------------------------------------------------
def command_302
# Obtain the effective return flag
effective = interpreter_store_erase_command_302
# Erase store contents if flagged & reset flag
if $game_temp.store_wipe == true
$game_temp.shop_goods = []
$game_temp.store_wipe = false
end
# Return effective flag
return effective
end
end
Instructions
In the script, like always.
FAQ
Just came to me when Melana talked with BeJeremiah and kyonides about shop scripts and item order. Took around 5 minutes to code, 2 more minutes for simple instructions
Compatibility
Should be GENERALLY compliant with other RPGMaker XP scripts.
Terms and Conditions
Free for use, even in commercial projects. Due credit is the only thing required.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)