RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Limited Inventory

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 81
Let the battle begin.
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.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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.

**
Rep: +0/-0Level 81
Let the battle begin.
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.

**
Rep: +0/-0Level 81
Let the battle begin.
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.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Alright; yeah, that would definitely cause the problem. I am happy that you have resolved it :)

***
Rep:
Level 89
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

Regards,
Mike

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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

***
Rep:
Level 89
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!
« Last Edit: August 10, 2010, 01:19:04 PM by Fizzly »
Regards,
Mike

***
Rep:
Level 81
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

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
If I recall correctly, then no there is not. Sorry.

***
Rep:
Level 81
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).
Code: [Select]
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?

« Last Edit: September 20, 2010, 08:13:31 PM by rofl1337 »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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:

Code: [Select]
#==============================================================================
# ** 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.

***
Rep:
Level 81
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

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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:

Code: [Select]
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:

Code: [Select]
$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.

***
Rep:
Level 81
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

**
Rep: +0/-0Level 75
RMRK Junior
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 :|?
« Last Edit: October 17, 2010, 09:12:15 PM by Kureigu »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, the "x" is a label set up by in the configuration region. Maybe you changed it from "x" to "10 "

**
Rep: +0/-0Level 75
RMRK Junior
yeah i was thinking that was the problem  :-[ . haha im so stupid at times :P
thanks for the script again, i LOVE it!!

*
Rep: +0/-0Level 73
RMRK Junior
Sorry for the late post, but would it be possible for the script to work with Yanfly Engine Melody Item Scripts? Thanks.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
I don't know. What are they and can you link me to them?

**
Rep:
Level 84
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.

*
Rep: +0/-0Level 73
RMRK Junior
Nice script, just what I needed! :D

****
Rep:
Level 76
Praise the Sun (Arcana)
GIAW 14: 1st Place (Hard Mode)
Could I have the loot screen come up at all times?

***
Rep:
Level 81
Monster Hunter
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?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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.