Limited Item Amounts?

iskillzi

Veteran
Veteran
Joined
Jul 17, 2014
Messages
33
Reaction score
2
First Language
English
Primarily Uses
Hello, I was wondering if it's possible to be able to have X item in a shop processing event then if someone buys the item it'll make it so they can't buy any more of that same item so long as they have their one.
 

Zoltor

Veteran
Veteran
Joined
Jan 18, 2014
Messages
1,550
Reaction score
211
First Language
English
Primarily Uses
Hello, I was wondering if it's possible to be able to have X item in a shop processing event then if someone buys the item it'll make it so they can't buy any more of that same item so long as they have their one.
This is definitely possible, but you either need one of the shop scripts(I'm pretty sure they have this option) or you need to create the shop yourself through eventing.
 
Last edited by a moderator:

Tommy Gun

♩ ♪ ♫ ♬
Veteran
Joined
Jan 20, 2014
Messages
385
Reaction score
123
First Language
English
You can easily do this WITHOUT a shop, unless that won't work for your story. Just have a character selling the item:

if ___ item exists in inventory

"You can't buy it!"

else

+1 item

-50 gold

end

(or whatever)
 

iskillzi

Veteran
Veteran
Joined
Jul 17, 2014
Messages
33
Reaction score
2
First Language
English
Primarily Uses
You can easily do this WITHOUT a shop, unless that won't work for your story. Just have a character selling the item:

if ___ item exists in inventory

"You can't buy it!"

else

+1 item

-50 gold

end

(or whatever)
Yea this is how I was doing it, I just figured since in this test game it has a LOT of items that change what happens in the game simply by having them so having to set this up for each and every one of them will take a very long time which is fine but it also means I'm more likely to make mistakes in the event script
 

Tommy Gun

♩ ♪ ♫ ♬
Veteran
Joined
Jan 20, 2014
Messages
385
Reaction score
123
First Language
English
Okay, then definitely check out some shop scripts. I know some can limit the shop inventory, but that's not what you're looking for. You may have to modify a script, or request one. It shouldn't be too hard, though.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.


Please take a look at some of the existing scripts.
 

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
There are indeed existing scripts for it I believe. But here is a simple free one:

#sb:item_limit [message]=begin#===============================================================================Napoleons Item LimitVersion 1.01By NapoleonAbout:- Allows you to set a custom limit for all items as well as for specific items  (in shops).- Can optionally also set a limit for manually increasing the item limit through  events or through script calls.- Supports item notetags.Instructions:- Place below "▼ Materials" but above "▼ Main Process". Requires:- RPG Maker VX AceTerms of Use:- This work is licensed under the Creative Commons Attribution 4.0 International  License. To view a copy of this license, visit  http://creativecommons.org/licenses/by/4.0/deed.en_US.- Attribution is not required. This overrules what's stated in the above  license. Version History:1.01 (28 July 2014)  - Added an optional item limiter for adding items through other means.  - Now supports notetags1.00 (28 July 2014)  - First Release=endmodule Nap; module Item_Limit#===============================================================================# Settings#===============================================================================  # This is the default allowed maximum quantity.  # This value is used when an item is not listed in SPECIFIC_ITEM_LIMITS.  # Does not exceed 99 unless LIMIT_GLOBALLY is set to true.  MAX_ITEMS = 99   # Set specific maximum item quantities here (note-tags overrule these).  SPECIFIC_ITEM_LIMITS = { # <item_id> => <max quantity>,    9 => 5, # max 5x "Life Up"  }   # Limits items gained through chests and events as well when set to true.  LIMIT_GLOBALLY = true   # REGEX notetag. Only change if you know what you are doing.  NOTE_TAG_REGEX = /<item_limit:(\d*)>/i#===============================================================================# Do not edit below this line#===============================================================================  SPECIFIC_ITEM_LIMITS.default = MAX_ITEMS   def self.max_items(item_id)    return SPECIFIC_ITEM_LIMITS[item_id]  endend; end # module Nap; module Item_Limit$imported ||= {}$imported[:nap_item_limit] = 1.01#===============================================================================# Window  ShopBuy#===============================================================================class Window_ShopBuy < Window_Selectable  #-----------------------------------------------------------------------------  # enable?                                                              [ALIAS]  #-----------------------------------------------------------------------------  alias nap_shop_item_limit_enable? enable?  def enable?(item)    nap_shop_item_limit_enable?(item) && $game_party.item_number(item) < Nap::Item_Limit.max_items(item.id)  endend#===============================================================================# Scene Shop#===============================================================================class Scene_Shop < Scene_MenuBase  #-----------------------------------------------------------------------------  # Max Buy                                                              [ALIAS]  #-----------------------------------------------------------------------------  alias nap_shop_item_limit_max_buy max_buy  def max_buy    max_with_limit = Nap::Item_Limit.max_items(@item.id) - $game_party.item_number(@item)    return [nap_shop_item_limit_max_buy, max_with_limit].min  endend#===============================================================================# Game Party#===============================================================================if Nap::Item_Limit::LIMIT_GLOBALLY  class Game_Party < Game_Unit    #---------------------------------------------------------------------------    # Max Item Number                                                [OVERWRITE]    #---------------------------------------------------------------------------    def max_item_number(item)      return Nap::Item_Limit.max_items(item.id)    end  endend#===============================================================================# Data Manager#===============================================================================module DataManager  class << self    alias nap_shop_item_limit_load_database load_database  end  #-----------------------------------------------------------------------------  # Load Database                                                        [ALIAS]  #-----------------------------------------------------------------------------  def self.load_database    nap_shop_item_limit_load_database    $data_items.each { |item|      next if item.nil?      Nap::Item_Limit::SPECIFIC_ITEM_LIMITS[item.id] = $1.to_i if item.note.delete(' ') =~ Nap::Item_Limit::NOTE_TAG_REGEX    }  endend#===============================================================================
For eventual future updates or the demo see my signature.

Just set the specific item max_value to 1.
 
Last edited by a moderator:

Ssozi

Ohyao !
Member
Joined
Jul 27, 2014
Messages
21
Reaction score
12
First Language
French
Primarily Uses
I've posted this yesterday : script. No configuration module, but I don't really know if it's what you need. 
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,083
Members
137,583
Latest member
write2dgray
Top