-
Limited Inventory
Version: 1.1c
Author: modern algebra
Date: September 27, 2009
Version History
- <Version 1.1c> 09.27.2009 - Fixed a bug that freezes user input when using an item with scope set to None.
- <Version 1.1b> 09.20.2009 - Fixed a hash updating bug that did not recognize items gained and discarded through loot as having been gained or discarded.
- <Version 1.1> 08.19.2009 - Fixed some bugs, including some discardability problems and an improper scaling effect with empty slots
- <Version 1.0b> 04.27.2009 - Fixed a bug with equipping something into an empty slot.
- <Version 1.0> 04.27.2009 - Original Release
Description
Essentially, this allows you to limit the number of items a party can carry. Rather than being able to hold 99 of all items, this script divides inventory space into a limited number of slots, each of which can hold a single item type, and for which you can set a maximum stack size. So, for instance, if you have 6 potions, and the maximum stack size for potions is 5, then potions will take up two slots in the inventory, one with 5 in it and the other with only 1. This script allows you to change the number of slots in the inventory in-game with ease, as well. It allows you to discard items easily (and set items as non-discardable), and if there is ever a time in which you get more items than you have space for, it will call a loot screen so you can choose which items to discard.
Features
- Limited Slot-based Inventory system
- Can change the number of slots at any time during the game.
- Can set a maximum stack size for each type of item individually
- Can set an item to be undiscardable
- Lots of customizability, even to what words represent what things in the inventory
- Will automatically call a loot scene any time the party has too many items, so that the player can choose what to discard
Screenshots
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg382.imageshack.us%2Fimg382%2F2628%2Fliminvscreen1.png&hash=254b0b9aa82ea1d4e2a3caee522e8a4858f66bd5)
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg382.imageshack.us%2Fimg382%2F6115%2Fliminvscreen2.png&hash=65ba88ac5bbe864106414f65afc0e5cc344b5f7f)
Instructions
Place this script above Main and below other custom scripts.
To set a number of the default conditions for this script, please see the Editable Regions at 53, 84, and 109. Be sure to read the comments next to each consant to see what it does.
To set an item as non-discardable, put this command into its note box:
\NONDISCARD
To set an item to have a stack size different from the default, use this command in its note box:
\STACKMAX[x]
where x is and integer and the new maximum stack size for that item.
To resize the party inventory in-game, say after an event where the get a new backpack or whatever, then all you need to do is put this code into a call script:
resize_inventory (x)
where x is an integer and the new number of slots in the party inventory.
Script
It is a large script. Please see the text document or retrieve the script from the demo. They are both attached at the bottom of this post.
Credit
Thanks
- grafikal009, for the request
- Fizzly, for major bug reports
- Celianna, for a bug report
Support
With such a large script, there are bound to be bugs. Please post in this topic at rmrk.net for swiftest support, and be as detailed as possible.
Known Compatibility Issues
No known compatibility issues, yet. But anything that heavily modifies Scene_Item or Window_Item would likely be incompatible.
Demo
Limited Inventory 1.1b Demo (http://rmrk.net/index.php?action=dlattach;topic=32918.0;attach=17902)
This script by modern algebra is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.
-
woo!
-
lol, modern... I got so used to seeing the other avatar and sig that when I saw on the other post you had finished, I was like... Who the hell?
Anyway, thanks for making this, I had thought about a limited inventory before, but as I think I somewhat said in the other post I had found the request already.
This'll be a nice addition to my game.
and, for this, I love you in a purely professional way.
Edit: Found a bug :D, if you go into your equip screen and attempt to equip an empty slot anything (I think) it pops up with "line465: NoMethodError occurred. undefined method 'ma_discardable?' for nil:NilClass"
It unequips fine, Its just equipping something into an empty slot, as equipping into an already filled slot works as well. So basically, if you try to equip something into an empty slot it'll result in that error.
-
Thanks for catching that.
To fix it, replace that line with:
if item != nil && !item.ma_discardable?
EDIT::
Actually, that's not entirely true. That will fix the syntax error, but could potentially cause other problems in the script. Just get the script from the new demo or the new text file that I just uploaded, as that has the complete fix in it.
-
Also, would it be possible for you to make this script so that it has an option for something like the non-discardable items, but have them called key items, in a different page, but have up, say, above the help box have something like, Items, or inventory or something, then, beside that something like key items, then selecting key items brings you to a different menu that would basically just be an inventory for key items that wouldn't take up the players inventory space? I know that's long and probably has a lot of errors with grammar, but I'm kinda tired and changed where I was going with it a couple of times... (just ignore that random mess, unless you feel like you absolutely must read it... the lower description is better by far.)
Anyway, picture!
-Sorry about it being an off-site picture, I was having some odd issues with attaching.... (This site doesn't show any recognition of it being attached? Too used to RRR lol) but I hope that explains what I mean (basically just if you label an item as a 'key item' some way [possibly an item note?] it goes under Key items, and does not take up space in the inventory whatsoever. This way your not filling up your players' inventories with a bunch of useless crap that are basically just trophies that serve no purpose other than giving players that reminiscent feeling of that one very special quest.
-
I might add that later. How do you want ot be able to switch over to Key Items?
-
not entirely sure on this, but I guess something where you have it to where you select item in the game menu, and it goes into the inventory, you hit the cancel button (esc?) and it moves the selection up to inventory and key items, and there you can select either one. Or if you have another way that's easier to script that's fine as well :D
I'm going to sleep pretty much right after I post this, but I'll check it tomorrow when I get home and see if you have questions/specifications.
-
I just now noticed something, when you are able to scroll down, it doesn't show the cursor at the bottom that basically says 'Hey! there's more!' it just shows the one up at the top. (see attached)
Also, how's the key items thing going? :P
-
Yeah, it would show the cursor if you actually had items down there and not just empty slots. I've noted the concern though and will add it when I look at this script again. I haven't started working on the Key Items thing, and to be honest, it's pretty low in my queue.
-
Edit: Never mind.... LOL :-\
Nice script Algebra!
Its very usefull. You think you can do the same but making every actor in ones party have their own inventory or something?
-
Thanks, it's really nice! But I found a bug: even if an item is non-discardable, the "discard" option is faded to gray, but it's still active and you can select this -> item goes to the Loot... Can you fix this? ^ ^;
-
Hmm, you're right. Around line 1011, change this:
slot = @item_window.ma_grfkl_lim_nvtry_item_8rn
type, id, n = slot.item_type, slot.item_id, slot.amount
Replace it with:
slot = @item_window.ma_grfkl_lim_nvtry_item_8rn
unless slot.item.ma_discardable?
Sound.play_buzzer
return
end
type, id, n = slot.item_type, slot.item_id, slot.amount
That ought to fix it.
-
Yup, it's working fine right now. ^^ Thank you!
-
Good to hear. Tell me if you encounter any other problems.
-
Hmm, I think there is one more. But not sure if I can call this a bug or glith. Anyway, if you change default amount of items in script for more than (default) one, they just can't group together. I mean, I've got for example 3x apples, and they are in inventory as: apple, apple and apple. When I'll get another two one, I have: apple, apple, apple, apple x2. Shouldn't they be as: apple x5? ;) If you can fix this, would be great. =)
EDIT: And another one! ^^; This should be fixed for sure:
There is non-discardable item in inventory. I want to throw away some stuff (discardable) to make space for new one. When I'll use "Change" option, from Loot window, I can change discardable stuff (from Loot) with non-discardable one (from the inventory). So in fact, I can use a trick to throw something really important... ^^; <LOST MY KEYYY!! T_T>
-
I'll look into those bugs. They definitely shouldn't be happening.
-
Bump? =p
Anyway, modern algebra, can I have a little request about that script? I thin kthat would be pretty useful for others too. I mean:
Weapons can be "clickable" too, but instead of inactive "Use" option, they'll be "Equip" option. Same could be with armors and shields. :) That would be really great.
-
Then I'd have to introduce a targetting window, as well as an equip window to show what is being replaced and a stats window to show the difference in stats. Further, it's make the Equip scene useless, meaning that anyone wanting to use it would probably want to get rid of it, which is even more :( Also, any scenes which are so extensive would mean that anybody who has a nice custom Equip scene probably wouldn't want this script.
It's a nice idea, but it's a lot more trouble than it's worth. I'd rather not.
I will look into those errors though. Sorry for the time, but I've been busy.
-
No problem, and thanks. Still waiting for fixes, by the way. ;)
-
Updated to 1.1. Those bugs should be fixed now.
It does tell me that grafikal hasn't been using the script he requested though :P I should be upset with him >: (
-
Haha, I was using it for a while, but never got around to extensively testing it since I didn't progress enough in the game to use the inventory a whole lot .______.
-
;D
Also, @mortigenous - the new version does show the white arrow when there are more spaces down
-
Now it works just perfect!! Thanks, modern algebra. ;)
-
Bump? =p
Anyway, modern algebra, can I have a little request about that script? I thin kthat would be pretty useful for others too. I mean:
Weapons can be "clickable" too, but instead of inactive "Use" option, they'll be "Equip" option. Same could be with armors and shields. :) That would be really great.
Curious if that was implemented? That sounds really convenient O_O
-
No, I decided against it. It's not a bad idea but it's a lot of work:
Then I'd have to introduce an equip window to show what is being replaced and a stats window to show the difference in stats. Further, it'd make the Equip scene useless, meaning that anyone wanting to use it would probably want to get rid of it, which is even more :( Also, any scenes which are so extensive would mean that anybody who has a nice custom Equip scene probably wouldn't want this script.
Maybe one day. Lots of other scripts to fix before that though.
-
Lol, I was just thinking like, click it once (Message box pops up "Equip this?" [yes, no], then if yes, it'll just unequip what ever you have on at the moment and put that on instead.) I wasn't thinking new windows and crazy stuff lol.
-
What if it's Two Swords Style?
Not to mention that it would automatically make the script incompatible with any scripts that alter equipment, such as Usable Equipment, Extra Equipment, new Equipment scenes, etc...
-
Hey me again MA.
I found another glitch :P
If I have too many items... I can go to discard and they go into the Loot window yeh? BUT, I can leave the menu then aquire more items and repeat this process to have as many items as I want. See what I mean? It's like the Loot window is another Item menu with unlimited slots :P
Just thought I'd let you know, because this script is pretty banging haha (good)
Thanks.
-
I';m not receiving that error when I test. Is the warning window not coming up?
-
Is a warning message meant to come up so that you can't leave the item menu when the loot menu is up?
No error comes up or anything =/ I'm just allowed to leave items in the loot window to free up inventory slots.
-
I attached a picture.
If you have a script which overwrites return_scene of Scene_Item, then it would skip it. Do you have Yanfly's Scene Menu Redux or any Custom Commands script, by chance?
For now, try putting the Limited Inventory script below the menu script. If that causes problems, I will look into it, but hopefully it will resolve your error.
-
Yeh that's it fixed man, just moved the Scene Redux below Limited Items like you said and it works like a charm.
Thank you very much :D
-
Hi there. I love this script but I need to tell about a bug.
Here is the setting:
-Your inventory is full
-Lets say find a leather shield and wanna take it in exchange of anything in your inventory.
-Once the trade is done and you get the leather shield,
you want to equip it for you hero.
-BUG IS even tho you do HAVE the item listed in inventory, it just does not appear in the equip screen, nor is it equipable for anyone normally able to.
-I double checked the classes compatibility, nothing to do with it.
There you go.
I admire all your scripts nonetheless. Genius you are dude!
-
There must be a hash updating problem when gaining item through the loot. Thanks for the report; I will look into it.
-
There must be a hash updating problem when gaining item through the loot. Thanks for the report; I will look into it.
Very nice of you Modern because I'd really like to use your script for my game :)
Also, about limited inventories (just asking by the way)... I was wondering if you planned to create a script to
limit inventories à la Dragon Quest. You know, each character with limited carryable items(equiped items included), useable by them in battle according to they very own inventory (can't explain better, gotta play DQ to know otherwise. Indeed, if you ask me, THAT would be the perfect ''limited items'' script ever my friend. Just telling :-X
-
I have no plans currently to make an individual limited inventories script as of now, but my Grid Inventory script has those capabilities. Obviously, it's quite different graphically and may not be what you are looking for, though.
-
Updated to Version 1.1b
Fixed the bug where the hash was not updating when gaining or destroying items through loot.
-
Would it be possible to add a "hero chest" feature to this script? Let me explain what I mean:
I make a chest through quick event creation. Then I go into the event and remove the "Show Text" and "Change Items" commands. Finally I add a script call that would take the form of "$scene = Hero_Chest.new" or something like that.
Other than that, it's perfect!
-
It's a good idea and definitely possible. I did much the same thing with my Grid Inventory.
In any case, I will put it on my To Do list (which is unfortunately very long, so it might be a while)
-
I don't suppose there's a way to limit the amount of stacks? i.e.: in a inventory with 99 slots, you can only have, say, 3 stacks of potions.
-
No, there isn't. Sorry.
-
Might not be a bad idea to add that then...
-
Just curious as to how far along you are with my requests...
-
Nowhere. I haven't worked on it at all. And I have a lot more to do before I will even look at it. Plus, I'm playing Dragon Age now so I probably won't do any scripting for a while.
-
Actually, I've just come across (and implemented) a different "hero chest" system. So no worries! However, I am having a minor issue with this and KGC_CategorizeItem. For the most part they work together, but when I select a category, it automatically uses the first item in that category rather than simply going into it.
-
Hi.
I'm a brazilian maker and I don't write english very good. I'm using the Babel Fish Tradutor ;D
I would like to know if I could take this script until my Brazilian community Reino RPG (http://www.reinorpg.com/forum)
Thanks :lol:
-
Oh, I've seen that website before. It's a very nice website. I would imagine that ModernAlgebra would allow you to post it on that website as long as you credit him as the creator and placed a link to this webpage incase someone would need help with the script.
-
Yes! All credits for he and me (I translated the script to portuguese) and I will place a link to this site ;)
All rights reserved ;D
-
Yeah, that's fine with me :) Like grafikal said, I would appreciate the link to this site, but by all means you can post it on reinorpg.
-
Lol, edited the post and forgot to say what is this xD
this is a fix for those who are using Kgc's categorize item script
they will work fine now, just put kgc BEFORE this one (dunno if this matter but just do it)
Discard the other one, just found a better way to do it
====
on this line (805 +/-)
class Scene_Item
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Start processing
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def start
super
create_menu_background
@activated_frame = false
do this
class Scene_Item
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Start processing
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def start
super
@@btpresses = 0
create_menu_background
@activated_frame = false
then search for " Input.trigger?(Input::C) "
you'll get this line
elsif Input.trigger?(Input::C)
# If exchanging
if @loot_window.index > -1 && @item_window.active
slot = @active_window.ma_grfkl_lim_nvtry_item_8rn
change to...
elsif Input.trigger?(Input::C)
# If exchanging
if @@btpresses == 0 then @@btpresses += 1 and return end
if @loot_window.index > -1 && @item_window.active
slot = @active_window.ma_grfkl_lim_nvtry_item_8rn
now do the same search again for the second line
elsif Input.trigger?(Input::C)
if @active_window == @item_window
case @command_window.index
change to
elsif Input.trigger?(Input::C)
if @@btpresses == 0 then @@btpresses += 1 and return end
if @active_window == @item_window
case @command_window.index
and that's it
not the best fix but it does work.
-
Ok so I'm not very good with scripts first off. I have quite a bit of them in this game I'm putting together. It's non-commercial just kind of something to do to pass the time. I decided to put your script in there too cause I loved the idea. Problem is every time I try to open my item menu an error pops up saying...
Script 'Limited Inventory 1.1b' line 567:NoMethodError occured.
undefined method 'slots' for nil:NilClass
I'm sorry if it's something simple that I'm missing but your help would be much appreciated.
-
It's an incomptibility with one of your other scripts. First try to move the Limited Inventory below every other custom script you have but still above Main. Beyond that, I'd need to know which script is causing the error before I could help you.
-
Ok. Well would you mind if I PM you with all the scripts I'm using? I already have the limited inventory at the bottom right above main.
-
Ok so never mind. It seems to work now. I think the problem was I was using the script on a saved game that I had made before I had added your script. I started a new game and it works just fine now. Thank you.
-
Alright; yeah, that would definitely cause the problem. I am happy that you have resolved it :)
-
Okay, I found another bug. I send you PM, but you didn't answer yet, so I'll post it anyway, to make sure you'll remember ^^'
The problem is, the game crushes every time, when I want to set item amout to variable. I've got this:
http://ifotos.pl/img/error_wxrqeq.PNG
-
That's not a bug from Limited Inventory; if you notice, it will occur whether Limited Inventory is there or not. This is because it's a bug that enterbrain didn't fix when they released RMVX. Just get the Game_Interpreter fix - http://rmrk.net/index.php/topic,25243.0.html
Go through the entire topic
This post will fix the error you are reporting: http://rmrk.net/index.php/topic,25243.msg316194.html#msg316194
This post will fix another error with multiplying variables - http://rmrk.net/index.php/topic,25243.msg322221.html#msg322221
-
Oh! :o You're right. Didn't notice this error earlier, sorry for bothering you. And thank you, anyway! It works fine now. Thanks for the multi-variable fix too!
-
sorry for epic necroposting,
but is there a way to change the stacksize through a script command or an event?
i would be thrilled if you could help me.
sincerly
rofl1337
-
If I recall correctly, then no there is not. Sorry.
-
ok, i will try to work out a way on my own.
i will post results, if i succeed.
sincerly
update:
I defined a new function in the game_interpreter, called change_stacksize (new), which should change
the MA_STACK_AMOUNT to (new).
def change_stacksize (new)
@ma_stack_amount = (new)
end
although the game doesnt give out any errors, the stacksize keeps the same.
anyone able to help me?
-
That... is nothing like how you would go about doing it. That creates an instance variable in Game_Interpreter that is unrelated to how the script retrieves the maximum stack size. You are on the right track in a distant sort of way though. You want to change MA_DEFAULT_STACK_AMOUNT. Well, it's a constant and it's newly defined every time, so even if you had succeeded in changing the value of the constant (which you didn't and shouldn't do), then that change wouldn't be saved in the save file and would revert back to the default the next time the player starts the game.
So, not really the way to do it. A much simpler way is to insert the following code somewhere below the Limited Inventory:
#==============================================================================
# ** RPG::BaseItem
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# redefined method - ma_stack_amount
#==============================================================================
class RPG::BaseItem
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Stack Amount
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_stack_amount
return $1.to_i if self.note[/\\STACKMAX\[(\d+)\]/i] != nil
if $game_variables && $game_variables[RPG::MA_DEFAULT_STACK_AMOUNT] > 0
return $game_variables[RPG::MA_DEFAULT_STACK_AMOUNT]
else
return 1
end
end
end
I haven't tested it, but what that does is repurposes the MA_DEFAULT_MAX_STACK constant. Instead of holding the default stack maximum, it now holds the ID of a variable, and the value of that variable will determine the max stack size (though it can never be less than 1).
So now, if you set MA_DEFAULT_MAX_STACK to 20, for instance, then default stack size for items is going to be whatever the value of variable 20 is. So, that will allow you to change it by changing the value of variable 20 through a simple Control Variable command. Note that if the stack max is set individually through an item's notebox, then that will still take priority.
Anyway, tell me if you have any problems with that.
-
thank you so much, it worked perfectly.
i dont know anything about scripting in rgss2, so this is really helpful for me.
there is one tiny problem with it though.
if you already have a stack of lets say 20 items in your inventory, they keep their size even after the maximum-stacksize is changed/lowered.
same problem the other way around. if i have stacks of 5 and the stacksize is increased, the stacks keep small and take up inventory space, that they wouldnt need with the new stacksize.
i suppose there isnt some update command for the inventory?
again thank you so much for the script
sincerly
-
I really don't know. I wrote this script a very long time ago and don't really have the time to take a look now. If not, then it would be a rather simple procedure. Essentially all you would need to do is go through every item, lose them and then gain them. It would be something like:
class Game_Party
def refresh_inventory
items.each { |item|
n = item_number (item)
lose_item (item, n)
gain_item (item, n)
}
end
end
You'd put that in a separate slot.
And every time you change the max stack size you could just put the following code in a script call right after:
$game_party.refresh_inventory
There may be an error since it isn't tested and, as I've said, I haven't looked at the script for a long time. I'm not sure whether it would properly work with loot either, but I think it should if I recall loot correctly.
-
one word: AWESOME!
i cant say how much i apprechiate your help.
everything works perfectly and just the way i imagined it. ;D
thanks, that you took time to code this.
respectfully
rofl1337
-
hey, perfect script works really well but is ther any way i can remove a part of it :o
i didnt wont the loot idea, i wanted it to just have my inventory and the 50 slots i have placed, and items that stack to 10, with the option to discard i wanted them to just disapear, rather than go into a loots box.
it would be "REALLY" helpful if you could help me here, thanks :)
- Kureigu
oh , i found another way round it. i got confused but i just changed the name loot to "items to be discarded"
so it makes abit more sense. Thank you for the script, its great ;)
third edit haha!
yea its all working great until i changed the stack limit on items.
instead of it saying cake X5 or potions X3
it says cake 10 5 or potion 10 3
have no clue why :|?
-
Well, the "x" is a label set up by in the configuration region. Maybe you changed it from "x" to "10 "
-
yeah i was thinking that was the problem :-[ . haha im so stupid at times :P
thanks for the script again, i LOVE it!!
-
Sorry for the late post, but would it be possible for the script to work with Yanfly Engine Melody Item Scripts? Thanks.
-
I don't know. What are they and can you link me to them?
-
I am guessing he wants you to see if you can make it compatible to http://wiki.pockethouse.com/index.php?title=Item_Overhaul ...
It's part of Yanfly's Melody scripts.
-
Nice script, just what I needed! :D
-
Could I have the loot screen come up at all times?
-
it works perfectly , but it still asks if i want to discard the items when leaving the item menu how could i take it away?
-
Well, I gave you two solutions since I wasn't sure which you wanted from your request - one was if you wanted them to go to loot but not to open, while the other was if you wanted to immediately destroy the items and not go to loot at all. It sounds like you chose the first one instead of the second. Go back to the PM and test the second one.
-
Well, I gave you two solutions since I wasn't sure which you wanted from your request - one was if you wanted them to go to loot but not to open, while the other was if you wanted to immediately destroy the items and not go to loot at all. It sounds like you chose the first one instead of the second. Go back to the PM and test the second one.
okay i will thanks ^^
-
Anyway, I'm a little confused as to what you're asking. Do you want it to go to Loot but just not immediately open the loot window? Or do you want the item to be immediately destroyed?
If the former, a possible solution is as follows: no guarantees as I haven't looked at the script for a very long time and I forget how it was supposed to work, but try replacing line 1036:
show_loot
with:
@item_window.refresh ($game_party.limit_inventory)
If the latter, try replacing this whole section from lines 1026 - 1039:
$game_temp.slots_to_discard.add_item (type, id, n)
# Deactivate Command Window
@command_window.active = false
@command_window.index = -1
@command_window.visible = false
# Reactivate previous Window
if @loot_window.visible
@item_window.refresh ($game_party.limit_inventory, 1)
@loot_window.refresh ($game_temp.slots_to_discard, 1)
else
show_loot
end
@item_window.active = true
RPG::SE.new (Sound::MA_DISCARD_SE).play
with:
RPG::SE.new (Sound::MA_DESTROY_SE).play
@command_window.active = false
@command_window.visible = false
Again, I don't remember the script well enough to know if those changes would break anything. I don't think they should, but you should try it out in a test project first
.
as you told me in your PM only the first solution works for me, the second freezes once you click on discard (destroy) the item.
the only problem now is that once closing the item window it asks me if i'm okay with discarding the items , i would like it not to show this question. thanks for the help so far it works like a charm :p
-
Well, instead of just:
RPG::SE.new (Sound::MA_DESTROY_SE).play
@command_window.active = false
@command_window.visible = false
try making it:
RPG::SE.new (Sound::MA_DESTROY_SE).play
@command_window.active = false
@command_window.visible = false
@item_window.refresh ($game_party.limit_inventory, 1)
@item_window.active = true
Like I said, I don't really remember this script very well and certainly don't feel like relearning it. Hopefully that will work fine.
-
Well, instead of just replacing:
$game_temp.slots_to_discard.add_item (type, id, n)
# Deactivate Command Window
@command_window.active = false
@command_window.index = -1
@command_window.visible = false
# Reactivate previous Window
if @loot_window.visible
@item_window.refresh ($game_party.limit_inventory, 1)
@loot_window.refresh ($game_temp.slots_to_discard, 1)
else
show_loot
end
@item_window.active = true
RPG::SE.new (Sound::MA_DISCARD_SE).play
with
RPG::SE.new (Sound::MA_DESTROY_SE).play
@command_window.active = false
@command_window.visible = false
try making it:
RPG::SE.new (Sound::MA_DESTROY_SE).play
@command_window.active = false
@command_window.visible = false
@item_window.refresh ($game_party.limit_inventory, 1)
@item_window.active = true
Like I said, I don't really remember this script very well and certainly don't feel like relearning it. Hopefully that will work fine.
yes that worked thanks Modern algebra, just one little thing
make it
RPG::SE.new (Sound::MA_DESTROY_SE).play
@command_window.active = false
@command_window.visible = false
@item_window.refresh ($game_party.limit_inventory)
@item_window.active = true
instead, you'll see why (it gives a little bug if you don"t )
thanks again :p
-
I received this error when I obtained a Non-Discard item from a
chest while my inventory was already full. This happened in the
Limited Inventory 1.1 Demo. I'm not using any other scripts.
Script 'Limited Inventory 1.1c' line 480: NoMethodError occurred.
undefined method 'item_type' for nil:NilClass
-
I received this error when I obtained a Non-Discard item from a
chest while my inventory was already full. This happened in the
Limited Inventory 1.1 Demo. I'm not using any other scripts.
Script 'Limited Inventory 1.1c' line 480: NoMethodError occurred.
undefined method 'item_type' for nil:NilClass
Yup, checked this and you're right. <waiting for fixing this> ::)
Hmmm, I wonder is it possible to had the free slots number in variable? Could you help, modern_algebra? :)
-
Its a good script to make the player build a strategy to fight a tough boss or a quest boss.
Congrats!
-
This is an awesome script but I was wondering if I could use the normal Items window with the limited Items features.
EXAMPLE:
-No dark blue rectangles
-Can not scroll down to empty slots
BTW i forget what I was gonna post here (after the BTW)
EDIT: Another thing I wonder if it is possible:
Can the loot be disabled without disabling the ability to discard items?
-
Well, you could remove the loot scene, but it would be reckless. What if the player's inventory was full and you wanted someone to give them a key item? Without a loot scene it would destroy the item.
As for getting rid of the blocks, I haven't worked with this script for a very long time so no guarantees, but you could try finding this in the refresh method of the Window_Item class (still inside the Limited Inventory script - I do not mean the default Window_Item class):
@item_max = inventory.max_size == -1 ? @data.size : inventory.max_size
create_contents
# Calculate number of empty slots to draw
empty_slots = (inventory.max_size == -1 || !$scene.is_a? (Scene_Item)) ? 0 : inventory.max_size - inventory.slots.size
and changing it to:
@item_max = @data.size
create_contents
# Calculate number of empty slots to draw
empty_slots = 0
-
Is there a way to specify items, that do not use up item slots?
I would love that feature.
-
There isn't, though that would be a good idea for the future.
-
Exactly ;D
-
Double-Post-Bump, because I love this script.
I have another suggestion.
Could you add the option to "hide" items? You should still be able to check if there are present in the inventory, via events, but they don't show up in the
inventory screen.
I think there are a few possible uses for that.
Edit:
In the discard-window, the description box always displays the description of the last item in the inventory and not the one that is selected in the discard pile.
Is this a bug, or caused by this script conflicting with KGC_CategorizeItem?
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fwww7.pic-upload.de%2F17.06.11%2Fkqwu1a3qcmap.png&hash=2db8a14c5add66de98b60afccf5b16669df001e3) (http://www.pic-upload.de/view-10358078/screen.png.html)
-
Question about this script:
Is it possible, or would it be possible to use only one part of the script?
I need only the part which does the item stacking limitations.
DRIACS system gives the ability to discard items, and it seems to be incompatible when the two scripts are running together. So, if there was a way to limit via switch or some sort of boolean flag the parts of this script which do the same thing as DRIACS, just so I could use the stack-size limits that would be very beneficial. Thanks.
-
I tried some stuff to fix this bug that I found but I can't fix it :(
When I open the Item Manu I get this error:
Script 'Limited Inventory 1.1b' line 851: ArgumentError occurred.
Wrong number of arguments(2 for 0)
I am useing YEMs scripts I removed YEMs Item Overhaul.
Anyway of fixing this? :/
-
AWESOME MA ;)
-
Is there any way to add inventory slots rather than change the amount of slots there are. For instance instead of acquiring a specific backpack ingame, you can find multiple pouches throughout the game that just add more slots to your total inventory space.
-
s = $game_party.limit_inventory.slots.size
s += 6 # The amount you're adjusting the size by. This can be any operation (+, -, *, /)
# Then either:
$game_party.limit_inventory.resize(s)
# Or:
resize_inventory(s)
-
There's no way I missed that...
Is that in the script? Or should I be adding that to it in some way?
-
No, it's a command I whipped up just then. Use it in an event script call when you want to adjust the inventory. It should work, though I didn't test it.
-
Sounds good. Thanks a lot.
But... How exactly do I get this to work? Should I make this its own script? Or is that entire thing one script call.
-
It's a script call you use when you want to adjust the inventory relative to what it already is.
Essentially, it's only three lines:
s = $game_party.limit_inventory.slots.size
s += 6 # Or whatever
resize_inventory(s)
-
I used this:
s = $game_party.limit_inventory.slots.size
s += 6 # Or whatever
resize_inventory(5)
All it did was change the inventory size to 5.
Then I used:
s = $game_party.limit_inventory.slots.size
s += 6 # Or whatever
resize_inventory(s + 5)
And what that did was for some reason subtract 5 from the total size. So I tried using a minus sign instead, and that did the same as what my initial test had done.
;9
-
Check the last line of my code. It's an s, not a 5.
-
Sorry, this is an extremely late reply, but I only used 5 because I thought that s was just a placeholder for a number. But at first, I used the s as it is but still nothing beneficial happened.
What I did was create an event in which you get a new pouch, then I called the script, (copying what you typed). When I tested the event, it resized my inventory to 6. So it didn't add more spaces.
-
s stores the number $game_party.limit_inventory.slots.size
You can alter this number once you store it, i.e. s += 6, s *= 2, s -= 3, whatever.
Once you alter the number, you can resize the inventory with this altered number.
resize_inventory(s)
-
Modern Algebra could you add an option to have items that don't take up place at all please?