Notice: fwrite(): Write of 461 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 59 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 1714 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 44 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 836 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 8192 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 44 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 8192 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 2000 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
Maximum Item Limits
Main Menu
  • Welcome to The RPG Maker Resource Kit.

Maximum Item Limits

Started by Synthesize, August 15, 2007, 10:00:57 PM

0 Members and 1 Guest are viewing this topic.

Synthesize

Script Name: Maximum item Limits
Written by: Synthesize
Current Version: V.1.00
Release Date: August 15, 2007

What is it?
This script rewrites the gain_ methods in Game_Party allowing the designer to define maximum item, weapon and armor limits. Also, item IDs, weapon IDs, and Armor IDs can be defined allowing one to define custom item limits for specific items.

Screenshots
Look at the item screen, instead of '99' the value is x.

The Script
Place above Main
[spoiler]

#============================================================================
# *Syn's Maximum Item Limits*
#----------------------------------------------------------------------------
# Written by Synthesize
# Version 1.00
# August 15, 2007
#============================================================================
#----------------------------------------------------------------------------
# Compatability
# Rewrites:
#   Game_Party::gain_item
#   Game_Party::gain_weapon
#   Game_Party::gain_armor
#----------------------------------------------------------------------------
# Begin Customization Section
#----------------------------------------------------------------------------
module SynItemMax
  # Format = {item_id => maximum amount}
  Max_item = {32 => 100}
  # Default Max Item Storage
  Max_item.default = 100
  # Format = {weapon_id => maximum amount}
  Max_weapon = {}
  # Maximum Weapon storage
  Max_weapon.default = 99
  # Format = {armor_id => maximum amount}
  Max_armor = {}
  # Maximum storage space
  Max_armor.default = 99
end
#----------------------------------------------------------------------------
# Begin Game_Party rewrite
#----------------------------------------------------------------------------
class  Game_Party
  #--------------------------------------------------------------------------
  # Rewrite gain_item
  #--------------------------------------------------------------------------
  def gain_item(item_id,n)
if item_id > 0
  @items[item_id] = [[item_number(item_id) + n, 0].max, SynItemMax::Max_item[item_id]].min
end
  end
  #--------------------------------------------------------------------------
  # Rewrite gain_weapon
  #--------------------------------------------------------------------------
  def gain_weapon(weapon_id,n)
if weapon_id > 0
  @weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, SynItemMax::Max_weapon[weapon_id]].min
end
  end
  #--------------------------------------------------------------------------
  # Rewrite gain_armor
  #--------------------------------------------------------------------------
  def gain_armor(armor_id,n)
if armor_id > 0
  @armor[armor_id] = [[armor_number(armor_id) + n, 0].max, SynItemMax::Max_armor[armor_id]].min
end
  end
end
#============================================================================
# Written by Synthesize
# Version 1.00
# August 15, 2007
#----------------------------------------------------------------------------
#    *Syns Maximum Item Limits*
#============================================================================

[/spoiler]


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

Irock

Sounds awesome. People could really get some use out of this.

:)

looks very cook :D
can't wait to see more scripts.
Watch out for: HaloOfTheSun

modern algebra

Another nice script. I hope to see you around the forums a little more. It's nice to see more scripters.

Demonic Blade

So by changing the numbers in the script you change how many of that item you can have in your inventory at one time?  :-\ Ah, well cool anyways, and I like that it's so short- really makes it easier when you just have one simple script like that!  ;D
I wonder how many of my-reps are there for a reason, and not just because some jackass wanted to show off in front of some other jackasses...?
Probably a lot of them - and those people sure as hell don't deserve my pity, let alone my disgust.
That's right, let's see some more -Rep'ing! BOOYEAH!!

Djeff

Can it also make your player only have a maximum of 20 items in the game.
I guess the elements are all mine ! -> Working on Element Island < -

Miss Nile

Was it really worth necroposting when you can just look at the script here,

#============================================================================
#                     *Syn's Maximum Item Limits*
#----------------------------------------------------------------------------
# Written by Synthesize
# Version 1.00
# August 15, 2007
#============================================================================
#----------------------------------------------------------------------------
# Compatability
# Rewrites:
#   Game_Party::gain_item
#   Game_Party::gain_weapon
#   Game_Party::gain_armor
#----------------------------------------------------------------------------
# Begin Customization Section
#----------------------------------------------------------------------------
module SynItemMax
  # Format = {item_id => maximum amount}
  Max_item = {32 => 100}
  # Default Max Item Storage
  Max_item.default = 100
  # Format = {weapon_id => maximum amount}
  Max_weapon = {}
  # Maximum Weapon storage
  Max_weapon.default = 99
  # Format = {armor_id => maximum amount}
  Max_armor = {}
  # Maximum storage space
  Max_armor.default = 99
end
#----------------------------------------------------------------------------
# Begin Game_Party rewrite
#----------------------------------------------------------------------------
class  Game_Party
  #--------------------------------------------------------------------------
  # Rewrite gain_item
  #--------------------------------------------------------------------------
  def gain_item(item_id,n)
   if item_id > 0
     @items[item_id] = [[item_number(item_id) + n, 0].max, SynItemMax::Max_item[item_id]].min
   end
  end
  #--------------------------------------------------------------------------
  # Rewrite gain_weapon
  #--------------------------------------------------------------------------
  def gain_weapon(weapon_id,n)
   if weapon_id > 0
     @weapons[weapon_id] = [[weapon_number(weapon_id) + n, 0].max, SynItemMax::Max_weapon[weapon_id]].min
   end
  end
  #--------------------------------------------------------------------------
  # Rewrite gain_armor
  #--------------------------------------------------------------------------
  def gain_armor(armor_id,n)
   if armor_id > 0
     @armor[armor_id] = [[armor_number(armor_id) + n, 0].max, SynItemMax::Max_armor[armor_id]].min
   end
  end
end
#============================================================================
# Written by Synthesize
# Version 1.00
# August 15, 2007
#----------------------------------------------------------------------------
#               *Syns Maximum Item Limits*
#============================================================================

Djeff

I already tried doing that but no work
I guess the elements are all mine ! -> Working on Element Island < -

Mr_Wiggles

i find interst in your script because of the game im makeing you carry ammo and 99 bulets in a machine gun dont go very far... however it doesn't seem to work
i edit it but still the limits are 99
[spoiler]
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

[/spoiler]