Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Sorting Items in Shop Window
#11
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.

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)
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:

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.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png] [Image: liM4ikn.png] [Image: fdzKgZA.png] [Image: sj0H81z.png]
[Image: QL7oRau.png] [Image: uSqjY09.png] [Image: GAA3qE9.png] [Image: 2Hmnx1G.png] [Image: BwtNdKw.png%5B]
Above are clickable links

Reply }


Messages In This Thread
Sorting Items in Shop Window - by Melana - 01-16-2018, 01:50 PM
RE: Sorting Items in Shop Window - by kyonides - 01-16-2018, 08:09 PM
RE: Sorting Items in Shop Window - by Melana - 01-16-2018, 11:40 PM
RE: Sorting Items in Shop Window - by BeJeremiah - 01-17-2018, 12:21 AM
RE: Sorting Items in Shop Window - by Melana - 01-17-2018, 12:55 AM
RE: Sorting Items in Shop Window - by BeJeremiah - 01-17-2018, 01:15 AM
RE: Sorting Items in Shop Window - by Melana - 01-17-2018, 01:35 AM
RE: Sorting Items in Shop Window - by BeJeremiah - 01-17-2018, 01:58 AM
RE: Sorting Items in Shop Window - by kyonides - 01-17-2018, 03:35 AM
RE: Sorting Items in Shop Window - by Melana - 01-17-2018, 04:02 PM
RE: Sorting Items in Shop Window - by DerVVulfman - 01-17-2018, 05:56 PM
RE: Sorting Items in Shop Window - by Melana - 01-18-2018, 01:02 AM
RE: Sorting Items in Shop Window - by DerVVulfman - 01-18-2018, 05:49 AM
RE: Sorting Items in Shop Window - by kyonides - 01-18-2018, 03:01 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Special Items Separate Menu Diorm 41 36,295 02-10-2018, 06:06 PM
Last Post: Diorm
   Shop Issues :P LunarBerry 4 7,296 11-23-2016, 02:53 AM
Last Post: LunarBerry
   Showing only specific skills in a window Melana 2 5,323 01-12-2016, 01:34 PM
Last Post: Melana
   Dargor's Large Party script and shop menu Simon Greedwell 2 6,025 08-28-2013, 10:12 PM
Last Post: Simon Greedwell
   Help with Shop Menu [RPG Maker XP] JackMonty 6 11,767 05-23-2013, 10:14 AM
Last Post: JackMonty
  Changing Window Styles in Game JackMonty 8 9,600 03-22-2013, 11:54 PM
Last Post: JackMonty
   Something I noticed about the Advanced Shop Status Window yamina-chan 5 9,080 08-21-2011, 09:16 PM
Last Post: yamina-chan
   [Atoa SBS] Changing the command window font MegaPowerNinja 3 7,575 04-12-2011, 10:23 PM
Last Post: Victor Sant
   Repositioning the actor command window. MegaPowerNinja 4 8,538 04-12-2011, 05:21 AM
Last Post: MegaPowerNinja
   Need Help on Making Battle Status Window riou 4 9,701 03-22-2011, 06:04 AM
Last Post: Victor Sant



Users browsing this thread: