TheoAllen 830 Posted May 20, 2014 Limited InventoryVersion : 1.4Type : System add-on Introduction :This script allow you to limit your inventory by overall possesed items instead of individual itemFeatures : Limit inventory by overall possesed item Each item may have their own size / weight You may increase or decrease inventory limit using states or equipment Ability to discard item in item menu Define your own formula to determine inventory limit Penalty for having overburdened like slower movement / disable dash *New The rest of features is written in script Screenshots : Script:The script is too long. Grab it here How to use:Put this script below material but above mainIf you're using YEA - Shop Option, put it below that scriptEdit configurations and the notetags as described inside the scriptCredit:Credit me as TheoAllen 4 Share this post Link to post Share on other sites
Faye V. 52 Posted May 20, 2014 A nice feature i have to say, i'll take a look at it and maybe implement it on my game Share this post Link to post Share on other sites
TheoAllen 830 Posted May 20, 2014 Thanks. I haven't tried to use it in actual game. It could be trouble some or something. But, at least, this was one of my dream systems I wished to make. Share this post Link to post Share on other sites
Wren 179 Posted May 20, 2014 Pretty cool, bet it would be great for strategic/tactics based games to add another strategy and logistics element. Share this post Link to post Share on other sites
MoonEnder 1 Posted May 26, 2014 is there any way to make a non key item impossable to discard? Share this post Link to post Share on other sites
TheoAllen 830 Posted May 26, 2014 No, not this version. However, you could put this patch right below limited inventory class Window_ItemUseCommand def discardable?(item) return false if item.nil? || !item.note[/<undiscardable>/].nil? !(item.is_a?(RPG::Item) && item.itype_id == 2) end end Just put <undiscardable> in item notebox it will not be able to discarded Share this post Link to post Share on other sites
AndresNobody 0 Posted June 4, 2014 Hi, Theo. This script is fantastic, and I am goint to use it on my zombie game project, but I have a problem. When I have my inventory almost full (75/100 for example) and I want to collect and object with a size of more than 25 (in this case) Ilose the object. I put a chest with and object but if I dont have enough space in my inventory I lose the object. I want to do a Conditional Branch, that says "You cant collect that" when i have my inventory full. How can I do that? Sorry if you dont understand something, but I am spanish and is hard to me explain this in english XD Share this post Link to post Share on other sites
TheoAllen 830 Posted June 4, 2014 Hi, Theo. This script is fantastic, and I am goint to use it on my zombie game project, but I have a problem. When I have my inventory almost full (75/100 for example) and I want to collect and object with a size of more than 25 (in this case) Ilose the object. I put a chest with and object but if I dont have enough space in my inventory I lose the object. I want to do a Conditional Branch, that says "You cant collect that" when i have my inventory full. How can I do that? Sorry if you dont understand something, but I am spanish and is hard to me explain this in english XD Don't worry, I clearly understand what do you want You can do a script call in conditional branch $game_party.free_slot < 25 It means that if you free slot is less than 25, then it will return true. Hope it helps 1 Share this post Link to post Share on other sites
AndresNobody 0 Posted June 5, 2014 Hi, Theo. This script is fantastic, and I am goint to use it on my zombie game project, but I have a problem. When I have my inventory almost full (75/100 for example) and I want to collect and object with a size of more than 25 (in this case) Ilose the object. I put a chest with and object but if I dont have enough space in my inventory I lose the object. I want to do a Conditional Branch, that says "You cant collect that" when i have my inventory full. How can I do that? Sorry if you dont understand something, but I am spanish and is hard to me explain this in english XD Don't worry, I clearly understand what do you want You can do a script call in conditional branch $game_party.free_slot < 25 It means that if you free slot is less than 25, then it will return true. Hope it helps Yes, it works! Thank you Share this post Link to post Share on other sites
luiscesjr 0 Posted September 9, 2014 First of all, awesome work! Now...: How could I change the position of that "Inv : 000/100" window on the main menu? I have a script that changes the main menu appearence, and this is kinda on the middle of the screen =S. Take a look.: Share this post Link to post Share on other sites
TheoAllen 830 Posted September 9, 2014 Look at the line 672 ~ 676 def create_liminv_window @lim_inv = Window_MenuLimInv.new(@gold_window.width) @lim_inv.x = @command_window.x @lim_inv.y = @command_window.height endTo change the width, replace the @gold_window.widthand for position, change the @lim_inv.x = other number as well as @lim_inv.y 1 Share this post Link to post Share on other sites
luiscesjr 0 Posted September 11, 2014 Thanks a lot! Now it's the gold window =D But I guess that's not really from your script right? I tried changing values from Window_Gold and Window_Message, but no luck =/ (My icons are all messed up, I know, it's because I'm still working on the database, so I won't bother touching them for now) Share this post Link to post Share on other sites
TheoAllen 830 Posted September 11, 2014 Yup, that is from another script, perhaps the menu script you're using right now 1 Share this post Link to post Share on other sites
luiscesjr 0 Posted September 11, 2014 Yes! Exactly that. Feel dumb right now... Share this post Link to post Share on other sites
MasterChafa 0 Posted December 13, 2014 Nice script.- Is there a way to get current "weight" carried into a variable? - Does this bring problems with multiple inventores scripts? (Like actor inventory) Share this post Link to post Share on other sites
TheoAllen 830 Posted December 13, 2014 Nice script. - Is there a way to get current "weight" carried into a variable? - Does this bring problems with multiple inventores scripts? (Like actor inventory) 1. Set a script call in Control Variables $game_party.total_inv_size 2. Maybe yes, maybe not. Depends on the script Share this post Link to post Share on other sites
Akari_Tsukino 0 Posted January 19, 2015 (edited) what is your stance on this being used in a commercial project? With credit given of course. Edited January 19, 2015 by Sales_Kital Share this post Link to post Share on other sites
TheoAllen 830 Posted January 19, 2015 Simply give me the free copy Share this post Link to post Share on other sites
Akari_Tsukino 0 Posted January 19, 2015 Simply give me the free copy That should be no problem ^.^ Share this post Link to post Share on other sites
TheoAllen 830 Posted February 8, 2015 Script updated to version 1.4 Added penalty when the player inventory reach the limit 1 Share this post Link to post Share on other sites
Kacper Tez 1 Posted March 28, 2015 (edited) Hey Theo, wondering if you could help me.. The script is fantastic and does everything I want, though one thing is in my way and I'm not sure how to get rid of it. This little window that pops up in the pause menu, the one that displays your inventory limit. I'd like to turn it off as you can check this elsewhere, and it's getting in the way of one of my survival bars. I'm fairly certain this is the window I'm talking about... # ============================================================================= # â–¼ New Class : Window_MenuLimInv # ============================================================================= class Window_MenuLimInv < Window_Base def initialize(width) super(0,0,width,fitting_height(1)) refresh end def refresh contents.clear change_color(system_color) txt = Theo::LimInv::SlotVocabShort draw_text(0,0,contents.width,line_height,txt) draw_inv_slot(0,0) end end # ============================================================================= When I try and remove anything, I just end up with an error. Please help! EDIT: Nevermind, someone helped me out with this, thanks anyway Edited March 28, 2015 by Kacper Tez 1 Share this post Link to post Share on other sites
grem333 0 Posted September 14, 2015 Hi! Great script! It's almost perfect for the rucksack in my Harvest Moon-style game. I was wondering if there was a way to disable discarding certain items. There are certain items, like tools, I don't want my character to get rid of by discarding from the item menu. Thanks for your help! Share this post Link to post Share on other sites
Venusaur 12 Posted September 27, 2015 If you would've read the earlier responses, you would've seen that he already answered that question.Put this snippet at the end of the script. class Window_ItemUseCommanddef discardable?(item)return false if item.nil? || !item.note[/<undiscardable>/].nil?!(item.is_a?(RPG::Item) && item.itype_id == 2)endend Just put <undiscardable> in an item notebox it will not be able to discarded. Share this post Link to post Share on other sites
PhoenixSoul 1,412 Posted April 3 One note: If using a script the removes the gold window (Calestian's Currencies is one example), change the following line: @lim_inv = Window_MenuLimInv.new(@gold_window.width) to @lim_inv = Window_MenuLimInv.new(@command_window.width) and it will no longer have the gold window related crash. Of course, it will no longer be at the bottom, but that can be adjustable. Speaking of adjustments... I've managed to figure out how to make the script display float values for the current and max inventory (~nnn.f), but... <inv_size: n.f> is not working, no matter what I do to the script. Like, sometimes, a smaller than 1.0 value is more accurately reflective, but not 0.0. A small vial of liquid should be represented properly, and this script is not allowing me to do so. Make sense? No? Play TES III: Morrowind for an hour and count how many items weigh less than 1, but more than 0. (that was one example of a game that has such a mechanic-there are many others and it makes sense to me anyway) Share this post Link to post Share on other sites
Rikifive 3,425 Posted April 3 1 hour ago, PhoenixSoul said: One note: If using a script the removes the gold window (Calestian's Currencies is one example), change the following line: @lim_inv = Window_MenuLimInv.new(@gold_window.width) to @lim_inv = Window_MenuLimInv.new(@command_window.width) and it will no longer have the gold window related crash. Of course, it will no longer be at the bottom, but that can be adjustable. Speaking of adjustments... I've managed to figure out how to make the script display float values for the current and max inventory (~nnn.f), but... <inv_size: n.f> is not working, no matter what I do to the script. Like, sometimes, a smaller than 1.0 value is more accurately reflective, but not 0.0. A small vial of liquid should be represented properly, and this script is not allowing me to do so. Make sense? No? Play TES III: Morrowind for an hour and count how many items weigh less than 1, but more than 0. (that was one example of a game that has such a mechanic-there are many others and it makes sense to me anyway) I assume trying to put a number between 0 - 1 results in the tag not being read at all? You'll need to adjust the REGEX that looks for the tag~ By default, line #257 contains the REGEX responsible for capturing the tag you've mentioned: InvSizeREGX = /<inv[\s_]+size\s*:\s*(\d+)>/i This REGEX requires ONE or more digit after ":" and nothing else. Putting "." results in an unexpected character appearing, so to speak, so it no longer matches. To fix that, you'll have to adjust it to account the possibility of the "." appearing. For example, if I'm not mistaking, this REGEX: InvSizeREGX = /<inv[\s_]+size\s*:\s*(\d+\.?\d*)>/i should, after ":", expect: ONE or MORE digits then, ZERO or ONE " . " making it optional then, ZERO or MORE digits making it optional So, both <inv_size: 4> and <inv_size: 4.5126> would be matching REGEX, thus be valid. Try changing that line of code to what I suggested and see what happens. 1 Share this post Link to post Share on other sites