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.
Inventory Limits

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 88
Script Name:  Inventory Limitations
Written by: Synthesize
Current Version: V.1.00
Release Date: August 13, 2007

What is it?
Inventory Limitations is a simple script that aliases some Game_Party methods allowing the party to carry only a certain amount of items at a single time. In order to carry more items at one time the 'bag' must be upgraded, this is done by storing the Bag sizes into an Array and then calling the flag. As an example, if you use the default value size of 50 items, then you can carry 25 potions and say 25 high potions. Afterwards your inventory is full since 25+25 = 50. Oh and I indented it better then others, cookie please.

Future Plans:
I plan on expanding the script once I get some more time, things I am planning include:
- Create Windows & a Scene
- Add more Designer customization
- Add more features

Screenshots
I did not make any Window's or Scenes yet so that might be kind of tough at the moment...So instead of looking at screen shots, go eat some pizza.

DEMO
http://www.megaupload.com/?d=YDMGAFTI
Demo Script Version: 1.00

The Script

Spoiler for:
Code: [Select]
#============================================================================
# *Syn's Item Limits*
#----------------------------------------------------------------------------
# Written by Synthesize
# Version 1.00
# August 13, 2007
# Tested with SDK 2.1
#============================================================================
=begin
-=What is it?=-
  The purpose of this script is to allow Item Limitation, or in other words
limit the number of items the party can carry at one time. By default,
the party can carry 99 of every single item in the database. With this script
the party can only carry 50 items (Default value) and every item in the database
affects this number. As an example, say you have 25 potions and 25 High Potions,
now your inventory is full and the party cannot collect more items. That is, unless
you go out and buy a bigger bag.
Bag sizes are stored in an Array and called on by a flag. So virtually,
you can have as many items as you want, but you need a bigger bag to accomplish that.

-=Future Additions=-
- Make Custom Item Scene which displays Total Space and etc
- Most likely add more features

=end
#----------------------------------------------------------------------------
# Compatiability
#----------------------------------------------------------------------------
# Tested with SDK 2.1
# Tested with DerVVulfman's Grouping and Details
# Aliases the following:
#   Game_Party::gain_item
#   Game_Party::gain_weapon
#   Game_Party::gain_armor
#   Game_Party::initialize
#   Scene_Equip::Main
#---------------------------------------------------------------------------
# Begin Customization Section
#---------------------------------------------------------------------------
module ItemLimits
  # Item Limit Options #
  Max_item_storage = {1 => 75, 2 => 100, 3 => 125}   # Format {flag_id => new_size}
  # This defiens the default value of the amount of items to be stored.
  Max_item_storage.default = 50
end
#---------------------------------------------------------------------------
# End Customization Section
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# Begin Game Party Aliased Methods
#---------------------------------------------------------------------------
class Game_Party
  attr_accessor :storage_flag   
  attr_accessor :item_storage 
  attr_accessor :item_count
  #---------------------------------------------------------------------------
  # Aliased Methods
  #   Game_Party::gain_item
  #   Game_Party::gain_weapon
  #   Game_Party::gain_armor
  #   Game_Party::initialize
  #---------------------------------------------------------------------------
  alias syn_gain_item gain_item
  alias syn_gain_weapon gain_weapon
  alias syn_gain_armor gain_armor
  alias syn_init initialize
  #---------------------------------------------------------------------------
  # Initialize
  # Add additional variables
  #---------------------------------------------------------------------------
  def initialize
@item_count = 0
syn_init
  end
  #---------------------------------------------------------------------------
  # Gain_Item
  #   item_id = Target Item ID
  #   n = amount of item_id which is being added
  #---------------------------------------------------------------------------
  def gain_item(item_id,n)
syn_gain_item(item_id,n)
syn_item_limits(item_id, n,0)
  end
  #---------------------------------------------------------------------------
  # Gain_Weapon
  #   item_id = Target Item ID
  #   n = amount of item_id which is being added
  #---------------------------------------------------------------------------
  def gain_weapon(weapon_id,n)
syn_gain_weapon(weapon_id,n)
syn_item_limits(weapon_id, n,1)
  end
  #---------------------------------------------------------------------------
  # Gain_Armor
  #   item_id = Target Item ID
  #   n = amount of item_id which is being added
  #---------------------------------------------------------------------------
  def gain_armor(weapon_id,n)
syn_gain_armor(weapon_id,n)
syn_item_limits(weapon_id, n,2)
  end
  #---------------------------------------------------------------------------
  # Syn Item Limits
  #   item_id = Target Item ID
  #   n = The amount of items to add
  #   value = Type of Item being checked
  #---------------------------------------------------------------------------
  def syn_item_limits(item_id, n, value)
@item_storage = ItemLimits::Max_item_storage[@storage_flag]
item_difference = @item_count + n
leftover = item_difference - @item_storage
case value
# Item
when 0
  if item_difference > @item_storage
@item_count = item_difference
gain_item(item_id,-leftover)
  else
@item_count = item_difference
  end
# Weapon
when 1
  if item_difference > @item_storage
@item_count = item_difference
gain_weapon(item_id,-leftover)
  else
@item_count = item_difference
  end
# Armor
when 2
  if item_difference > @item_storage
@item_count = item_difference
gain_armor(item_id,-leftover)
  else
@item_count = item_difference
  end
end
  end
end
  #---------------------------------------------------------------------------
  # End Game_Party modification
  #--------------------------------------------------------------------------
  # Begin Scene_Equip Alias
  #--------------------------------------------------------------------------
class Scene_Equip
  alias syn_equip_main main
  def main
# Adds dummy pockets. Prevents items from erasing when unequipping.
$game_party.item_storage += 4
syn_equip_main
$game_party.item_storage -= 4
  end
end
#-----------------------------------------------------------------------------
#=============================================================================
# Special Thanks: Northern49 for the General Idea
# Tested with SDK 2.1
# May be incompatible with scripts that modify the mentioned aliased classes
#-----------------------------------------------------------------------------
# *Syn's Item Limits*
#=============================================================================

Usage
Usage:
This script may be used in either a commercial project or a free ware project free of charge. However, credit must be present somewhere in the project.

Editing/Distribution:
Feel free to redistribute this post to other boards/websites. Just keep the wording the same. As for editing the script to suite your tastes feel free. Just keep the original header/footer in tact.

If you have any questions or you found a bug, please PM me or make a post with the following:
1.) SDK Version
2.) Other Scripts
3.) Factors of the bug (What did you do to make it happen?)
4.) version
5.) Error Line

Cheers,

Syn

*
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
Another nice script. Just as a question, what windows and scenes are you thinking about? I've racked my brain for almost 1 minute and can't think of what it would be,

**
Rep:
Level 88
They would be rewrites of Window_Item and Scene_Item which will make them show some of the features I have planned, such as a weight system.

*
Rep: +0/-0Level 85
I tried using this script and it works but there doesn't seem to be any way to prevent ignoring new items given to you, they just simply disappear, for example: if you go into a store with your item limit and buy something, you spend the money, but your inventory doesn't change at all, and if you are given an item from an event or monster it simply doesn't enter your inventory. If you know of any way to prompt throwing out old items or how to make a trigger or conditional branch that triggers when you have a full inventory please reply.

****
Rep:
Level 83
They would be rewrites of Window_Item and Scene_Item which will make them show some of the features I have planned, such as a weight system.
intresting i have such a request for a script here
http://rmrk.net/index.php/topic,35671.msg428775.html#msg428775
perhaps you can up date me if and when you do so?
Spoiler for:
METALFRESH is a paint contractor that specializes in refinishing metal and vinyl siding. We paint metal buildings as well as siding on homes.

We also

    Refinish decks
    Do custom interior painting
    Strip wallpaper
    Refinish cedar siding
    Metal front doors and sidelights
    Metal garage and service doors
    Grained fiberglass doors

    If your structure is *RUSTED *FADED *CHALKING *IN NEED OF COLOR CHANGE, we can fix it with a guarentee!

northern Illinois and southern Wisconsin.

http://metalfreshcoatings.com


********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
I think you need to calm down on your posts in here. I don't really mind since most are decent feedback and I suppose some of these scripts could use a lift, however, if you have questions with the authors or something and it's been over a year since the last post, much less the first post, send them a PM or Email instead. It's possible they're not as active or not active anymore and won't get this post unless they have it set on Email Alerts or something. Just try to avoid useless necroposting, which is where I see this heading.