01-17-2018, 05:56 PM
(This post was last modified: 01-17-2018, 05:58 PM by DerVVulfman.)
Kinda got a script of sorts, but not TOO friendly. It lets you add items to the shop. All items added this way are added to the 'END' of your shop list, so whatever you want to be at the top... better have it set first in the 'SHOP PROCESSING' command.
You use this by adding a script call before you run the shop. This script call is 'add_to_shop' and you pass an array of items into it. The items are added to the END of your shopping list, but will be in the order you add. An example of the call may appear like this:
This adds the 'Full Potion' [0,3], 'Mythril Sword' [1,4], 'High Potion [0,2], and 'Bronze Shield' [2,1] to the end of the list.
Each item is an array of two parameters [type, ID] Type 0 is an item, 1 is a weapon and 2 is armor. ID si just the item id in the database.
Testing it, my event list looks like this:
Unfortunately, I do have to have an item in the shop first, and that one is always at the top of the list. In this case, the High Potion appears before the others I mentioned. But... here ya go? You can add them in your order just by manually making a list like above.
Code:
#==============================================================================
# ** 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 :new_goods # list of shop goods
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 guten_morgen_shop command_302
#--------------------------------------------------------------------------
# * Shop Processing
#--------------------------------------------------------------------------
def command_302
effective = guten_morgen_shop
unless $game_temp.new_goods.nil?
for items in $game_temp.new_goods
$game_temp.shop_goods.push(items)
end
$game_temp.new_goods = nil
end
return effective
end
#--------------------------------------------------------------------------
# * Add to Shop
# list : list of items in an array
#--------------------------------------------------------------------------
def add_to_shop(list=nil)
$game_temp.new_goods = list
end
end
You use this by adding a script call before you run the shop. This script call is 'add_to_shop' and you pass an array of items into it. The items are added to the END of your shopping list, but will be in the order you add. An example of the call may appear like this:
Code:
list = [ [0,3], [1,4], [0,2], [2,1] ]
add_to_shop(list)
Each item is an array of two parameters [type, ID] Type 0 is an item, 1 is a weapon and 2 is armor. ID si just the item id in the database.
Testing it, my event list looks like this:
Code:
@>Script: list = [ [0,3], [1,4], [0,2], [2,1] ]
: : add_to_shop(list)
@>Shop Processing [High Potion]
@>
Unfortunately, I do have to have an item in the shop first, and that one is always at the top of the list. In this case, the High Potion appears before the others I mentioned. But... here ya go? You can add them in your order just by manually making a list like above.