Shop that sells whatever you have bought in other shops.

I’m trying to set a kingdom-like mechanic in my game. In this, the player can build armor and weapon stores.

I want those to function like this: If you buy a sword, a fire sword and a super sword in different towns across the world, those swords get added to the weapons store in your kingdom. So everything you buy will be added to the stores you have in-town. I was trying to set something like that without scripts but I got all messy. So I figured out it would be easier with a script?
I suggest checking if the player has a set of weapons in their inventory: like you mentioned the Sword, the Fire Sword and the Super Sword. a set of 3 items that can be checked. if that check comes out as true you display the new shop that also offers these 3 weapons. this way you have 2 different shops: The first time where you DON'T have the weapons and the Shop AFTER you've obtained your weapons. Changing the shops with a variable sounds like the easier solution to me as you can do the same for the Armor category as well.
I suggest checking if the player has a set of weapons in their inventory: like you mentioned the Sword, the Fire Sword and the Super Sword. a set of 3 items that can be checked. if that check comes out as true you display the new shop that also offers these 3 weapons. this way you have 2 different shops: The first time where you DON'T have the weapons and the Shop AFTER you've obtained your weapons. Changing the shops with a variable sounds like the easier solution to me as you can do the same for the Armor category as well.
I think this sounds very extensive if you take into account the number of swords you have and the number of combinations of shops you get depending on how many items you have gotten at that point and which items you haven't got yet. Wouldn't that ve a very large combination? Sorry if I come out as ignorant.
So I figured out it would be easier with a script?
Spoiler: Saved Shop Kingdom items
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Shop Saved Items                       ║  Version: 1.00     ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║                                               ╠════════════════════╣
# ║   Load specific shop items                    ║    22 Sep 2024     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires: nil                                                      ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║   Allows loading saved item list for purchase                      ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║   When using this script, you must set the shop variable to true   ║
# ║                                                                    ║
# ║   When buying an item that has the appropriate note tag            ║
# ║   it gets added to the saved shop inventory                        ║
# ║                                                                    ║
# ║   When the shop saved store variable is set to true then           ║
# ║   the saved inventory is loaded.                                   ║
# ║   You still need to use the normal shop processing command         ║
# ║                                                                    ║
# ║   The command is $game_system.shop_saved_store = true              ║
# ║      or shop_saved_store                                           ║
# ║   The variable is turned off when the shop is called               ║
# ║                                                                    ║
# ║   Use note tag on items that will be saved to the combined shop    ║
# ║       <kingdom save>                                               ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 22 Sep 2024 - Script finished                               ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║  Follow the original Authors terms of use where applicable         ║
# ║    - When not made by me (Roninator2)                              ║
# ║  Free for all uses in RPG Maker except nudity                      ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║  No part of this code can be used with AI programs or tools        ║
# ║  Credit must be given                                              ║
# ╚════════════════════════════════════════════════════════════════════╝

# ╔════════════════════════════════════════════════════════════════════╗
# ║                  End of Editable Region                            ║
# ╚════════════════════════════════════════════════════════════════════╝

module R2_Shop_Save_Purchase_Items
  REGEX = /<kingdom save>/i
end

class Game_Interpreter
  #--------------------------------------------------------------------------
  # * Shop saved store loaded
  #--------------------------------------------------------------------------
  def shop_saved_store
    $game_system.shop_saved_store = true
  end
end

class Game_System
  attr_accessor :shop_saved_store
  #--------------------------------------------------------------------------
  # * Initialize
  #--------------------------------------------------------------------------
  alias :r2_system_shop_purchase_combine_init   :initialize
  def initialize
    r2_system_shop_purchase_combine_init
    @shop_goods_saved = []
    @shop_saved_store = false
  end
  #--------------------------------------------------------------------------
  # * Shop Goods return the goods for the current shop
  #--------------------------------------------------------------------------
  def shop_saved_goods
    return @shop_goods_saved
  end
end

class Window_ShopBuy < Window_Selectable
  alias :r2_shop_saved_item_list    :make_item_list
  #--------------------------------------------------------------------------
  # * Make Item List with check for saved shop data
  #--------------------------------------------------------------------------
  def make_item_list
    if $game_system.shop_saved_store == false
      r2_shop_saved_item_list
    else
      load_shop_goods
      load_shop_price
    end
  end
  #--------------------------------------------------------------------------
  # * Shop Saved Goods
  #--------------------------------------------------------------------------
  def shop_buy_goods(item)
    present = false
    $game_system.shop_saved_goods.each { |itm|
      present = true if itm[0] == item
    }
    $game_system.shop_saved_goods.push([item,@price[item]]) if present == false
  end
  #--------------------------------------------------------------------------
  # * Load Shop Goods
  #--------------------------------------------------------------------------
  def load_shop_goods
    @data = []
    list = $game_system.shop_saved_goods
    list.each do |itm|
      @data.push(itm[0])
    end
  end
  #--------------------------------------------------------------------------
  # * Load shop price
  #--------------------------------------------------------------------------
  def load_shop_price
    @price = {}
    shop_price = $game_system.shop_saved_goods
    shop_price.each do |itm|
      @price[itm[0]] = itm[1]
    end
  end
end

#==============================================================================
# ** Scene_Shop
#==============================================================================
class Scene_Shop < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Quantity Input [OK]
  #--------------------------------------------------------------------------
  alias :r2_number_ok_saved_item  :on_number_ok
  def on_number_ok
    @item = @buy_window.item
    @buy_window.shop_buy_goods(@item) if @item.note =~ R2_Shop_Save_Purchase_Items::REGEX
    r2_number_ok_saved_item
  end
  alias :r2_return_shop_saved  :return_scene
  def return_scene
    $game_system.shop_saved_store = false
    r2_return_shop_saved
  end
end
Spoiler: Saved Shop Kingdom items
Ruby:
# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Shop Saved Items                       ║  Version: 1.00     ║
# ║ Author: Roninator2                            ║                    ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function:                                     ║   Date Created     ║
# ║                                               ╠════════════════════╣
# ║   Load specific shop items                    ║    22 Sep 2024     ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires: nil                                                      ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description:                                                 ║
# ║   Allows loading saved item list for purchase                      ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions:                                                      ║
# ║   When using this script, you must set the shop variable to true   ║
# ║                                                                    ║
# ║   When buying an item that has the appropriate note tag            ║
# ║   it gets added to the saved shop inventory                        ║
# ║                                                                    ║
# ║   When the shop saved store variable is set to true then           ║
# ║   the saved inventory is loaded.                                   ║
# ║   You still need to use the normal shop processing command         ║
# ║                                                                    ║
# ║   The command is $game_system.shop_saved_store = true              ║
# ║      or shop_saved_store                                           ║
# ║   The variable is turned off when the shop is called               ║
# ║                                                                    ║
# ║   Use note tag on items that will be saved to the combined shop    ║
# ║       <kingdom save>                                               ║
# ║                                                                    ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates:                                                           ║
# ║ 1.00 - 22 Sep 2024 - Script finished                               ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks:                                                ║
# ║   Roninator2                                                       ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use:                                                      ║
# ║  Follow the original Authors terms of use where applicable         ║
# ║    - When not made by me (Roninator2)                              ║
# ║  Free for all uses in RPG Maker except nudity                      ║
# ║  Anyone using this script in their project before these terms      ║
# ║  were changed are allowed to use this script even if it conflicts  ║
# ║  with these new terms. New terms effective 03 Apr 2024             ║
# ║  No part of this code can be used with AI programs or tools        ║
# ║  Credit must be given                                              ║
# ╚════════════════════════════════════════════════════════════════════╝

# ╔════════════════════════════════════════════════════════════════════╗
# ║                  End of Editable Region                            ║
# ╚════════════════════════════════════════════════════════════════════╝

module R2_Shop_Save_Purchase_Items
  REGEX = /<kingdom save>/i
end

class Game_Interpreter
  #--------------------------------------------------------------------------
  # * Shop saved store loaded
  #--------------------------------------------------------------------------
  def shop_saved_store
    $game_system.shop_saved_store = true
  end
end

class Game_System
  attr_accessor :shop_saved_store
  #--------------------------------------------------------------------------
  # * Initialize
  #--------------------------------------------------------------------------
  alias :r2_system_shop_purchase_combine_init   :initialize
  def initialize
    r2_system_shop_purchase_combine_init
    @shop_goods_saved = []
    @shop_saved_store = false
  end
  #--------------------------------------------------------------------------
  # * Shop Goods return the goods for the current shop
  #--------------------------------------------------------------------------
  def shop_saved_goods
    return @shop_goods_saved
  end
end

class Window_ShopBuy < Window_Selectable
  alias :r2_shop_saved_item_list    :make_item_list
  #--------------------------------------------------------------------------
  # * Make Item List with check for saved shop data
  #--------------------------------------------------------------------------
  def make_item_list
    if $game_system.shop_saved_store == false
      r2_shop_saved_item_list
    else
      load_shop_goods
      load_shop_price
    end
  end
  #--------------------------------------------------------------------------
  # * Shop Saved Goods
  #--------------------------------------------------------------------------
  def shop_buy_goods(item)
    present = false
    $game_system.shop_saved_goods.each { |itm|
      present = true if itm[0] == item
    }
    $game_system.shop_saved_goods.push([item,@price[item]]) if present == false
  end
  #--------------------------------------------------------------------------
  # * Load Shop Goods
  #--------------------------------------------------------------------------
  def load_shop_goods
    @data = []
    list = $game_system.shop_saved_goods
    list.each do |itm|
      @data.push(itm[0])
    end
  end
  #--------------------------------------------------------------------------
  # * Load shop price
  #--------------------------------------------------------------------------
  def load_shop_price
    @price = {}
    shop_price = $game_system.shop_saved_goods
    shop_price.each do |itm|
      @price[itm[0]] = itm[1]
    end
  end
end

#==============================================================================
# ** Scene_Shop
#==============================================================================
class Scene_Shop < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Quantity Input [OK]
  #--------------------------------------------------------------------------
  alias :r2_number_ok_saved_item  :on_number_ok
  def on_number_ok
    @item = @buy_window.item
    @buy_window.shop_buy_goods(@item) if @item.note =~ R2_Shop_Save_Purchase_Items::REGEX
    r2_number_ok_saved_item
  end
  alias :r2_return_shop_saved  :return_scene
  def return_scene
    $game_system.shop_saved_store = false
    r2_return_shop_saved
  end
end
Sorry for never answering. This looks pretty neat, I’ll give it a go. Thank you!!

Original thread: https://forums.rpgmakerweb.com/threads/shop-that-sells-whatever-you-have-bought-in-other-shops.172079/