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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,451
Reaction score
15,231
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. 
 

Latest Threads

Latest Posts

Latest Profile Posts

Who's a fan of firearms? The 5 on the bottom row (not including the green laser ones) I made pretty recently. I plan for most of these to be in my project.

Screenshot 2021-09-28 165924.png
Doing RPG Maker News for 28th September 2021

RMMV - Skip script errors:

For game developer testing purposes.
You know, I really get to farm likes since I post all of @Avery and @hiddenone 's blog tutorials on the forums...
Back from a very long hiatus with a new project woo
This is my battler placeholder image trying out art styles too I want to fake a backview battle system
I think I will want portraits and battle sprites to be 2D and stick to pixel art for overworld not 100%sure but pretty sure its easier to make pixel art for overworld sprites, events and maps and stuff.
Placeholder.png

Forum statistics

Threads
115,441
Messages
1,089,951
Members
150,229
Latest member
Mythphnx
Top