[XP] Item Storage

Started by G_G, May 01, 2009, 08:50:28 pm

Previous topic - Next topic

Xolitude


G_G

I'll have to take a look at it sometime. I know at one point of time it worked, but since the update to RMX-OS 2.0, I haven't tested it out. I'll get back to you when I can.

Xolitude

Quote from: gameus on September 04, 2013, 10:30:35 am
I'll have to take a look at it sometime. I know at one point of time it worked, but since the update to RMX-OS 2.0, I haven't tested it out. I'll get back to you when I can.


Yea it might've been the new update.

When ya get a chance, thanks :)

firevenge007

Why is that when I'm using a new character, there is nothing wrong, but as soon as I use an already-loaded character, it crashes with this message "undefined method for '[]' for nilClass"

KK20

For the exact same reason that I have clearly explained here.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

LiTTleDRAgo

Spoiler: ShowHide
Quote
#==============================================================================
# Game_System
#------------------------------------------------------------------------------
# Modded it so it makes it store every chest.
#==============================================================================
class Game_System
 alias gg_add_item_storage initialize
 def initialize
   @chests = []
   return gg_add_item_storage
 end
 def chests(n)
   @chests ||= []   # <<< Add this line
   if @chests[n] == nil
     @chests[n] = Game_Chest.new(GameGuy::ChestMaxItems)
     items = GameGuy.chest_items(n)
     for i in 0...items.size
       item = items[i][2]
       case item
       when 0
         @chests[n].add_item(items[i][0], items[i][1])
       when 1
         @chests[n].add_weapon(items[i][0], items[i][1])
       when 2
         @chests[n].add_armor(items[i][0], items[i][1])
       else
         @chests[n].add_item(items[i][0], items[i][1])
       end
     end
   end
   return @chests[n]
 end
end

firevenge007

September 24, 2013, 02:01:19 pm #106 Last Edit: September 24, 2013, 02:11:57 pm by firevenge007
Thanks so much for this fix.

Also, I was wondering if there was a way to speed up the rate of storing items into the chest when holding down a button.

Edit: Also, I found an error when I was trying to deposit armour.

It said, "Script ' ' line 517: NoMethodError occurred. Undefined method 'element_set' for # <RPG::Armor:0x28c3f60>"

LiTTleDRAgo

if that line is


      if @item.element_set.include?(GameGuy::KeyItemId)
        $game_system.se_play($data_system.buzzer_se)
        return
      end


change it into


      if @item.is_a?(RPG::Item) || @item.is_a?(RPG::Weapon)
        if @item.element_set.include?(GameGuy::KeyItemId)
          $game_system.se_play($data_system.buzzer_se)
          return
        end
      else
        if @item.guard_element_set.include?(GameGuy::KeyItemId)
          $game_system.se_play($data_system.buzzer_se)
          return
        end
      end

firevenge007

It works perfectly now, thank you so much.

On top of that though, I was wondering if there was an area in the script that managed the rate of which you withdraw and deposit items?

Seltzer Cole

The only issue I have with this script is that if you have 99 of an item and use the "store all"
chest = $game_system.chests(4)
chest.empty_all
then any of that same item you have in the chest gets deleted.

Example: You have 99 potions on you and 50 in the storage box. You choose to "Store All" and it works...except 50 of your potions got deleted.

When you manually store things it stops you from going over, but not storing everything in one go. It also deletes things when you "Take All" as well.

Other than that, awesome script.
You know you play video games to much when you put sunglasses on and whisper "Plus 10 Appearance"

If at first you don't succeed, call it version 1.0

G_G

March 03, 2014, 11:20:45 am #110 Last Edit: March 03, 2014, 01:23:39 pm by gameus
When I get back to my computer I'll try to fix it.

EDIT: I know I should still fix it, but editing this option in the config would at least solve the first half of your problem.

ChestMaxItems     = 9999

Orochimaru

Not sure if you still update this script or not, but I am having a problem with trying to adjust how many items a certain box can hold. I have tried the script command and it's not working, it worked fine in the outdated demo.
I would prefer to be able to use the newer one if possible as you added a lot of nice features to it.