[XP] Item Storage

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

Previous topic - Next topic

zottel89

Okay, thanks :)

Doesn't crash anymore, but ... the key items aren't grayed out :/

Landith

It works for me.

The key items are only suppose to be greyed out when they are in the chest.

Are you sure you set up the elements correctly?

zottel89

June 18, 2012, 10:14:47 pm #82 Last Edit: June 18, 2012, 10:16:16 pm by zottel89
oh... hm .... that wasn't really what I thought of  :shy:

And yes, everything is setup correctly and I can't store the
key items in the chest, but they are not grayed out (in the "store" window).

My original suggestion was to gray out items that you want to store in the chest,
but which are "key items".

So that, for example in my game ( yeah, I'm a selfish bastard, sry :D ), you can't
store the "diary" in the chest, because you need to always have it in your inventory
and so it's grayed out in the "store" window.

Would be cool if it also worked this way...
but thanks for the explanation :)

KK20

June 19, 2012, 01:11:43 am #83 Last Edit: June 19, 2012, 01:16:39 am by KK20
For graying out the key items in your inventory. This bit of code actually exists already within the script itself (with a few edits)...however, it was only in class Window_Chest_Item and not class Window_Party_Item. (Did you mean to do that G_G?)
Spoiler: ShowHide
class Window_Party_Item < Window_Selectable
  def draw_item(index)
    item = @data[index]
if item.element_set.include?(GameGuy::KeyItemId)
  self.contents.font.color = disabled_color
else
  self.contents.font.color = normal_color
end
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    x = 4 + index % @column_max * (288 + 32)
    y = index / @column_max * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 216, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 224, y, 48, 32, number.to_s, 2)
  end
end

Quote from: Landith on June 18, 2012, 08:49:36 am
Spoiler: ShowHide
Simple fix, change that line to
self.contents.font.color = normal_color


and change the line that says (should be 301)

self.font.color = disabled_color


to

self.contents.font.color = disabled_color

Fix'd. Thanks for notifying it. lol my new mod powers!

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!

G_G

No, I meant to edit Party_Item class. I guess I wasn't paying too much attention. Like always, thanks for fixing it you guys.

zottel89

Okay, just to clarify, my suggestion wasn't to gray out the items in the actual player's INVENTORY (...  if you press "x" ingame and go to "Inventory")  :D
More like....     in the "Store" Window of the Storage-Script ("in the Chest").

I'm not sure if you guys mean the same thing I do, I'm just a little... confused right now  :shy:

Landith

That's why Game_guy created a new window called Party_Item because he didn't want to overwrite the original Item_Window. It won't grey it out in the menus, just when you go to store an item.

G_G

Quote from: zottel89 on June 19, 2012, 08:50:38 am
Okay, just to clarify, my suggestion wasn't to gray out the items in the actual player's INVENTORY (...  if you press "x" ingame and go to "Inventory")  :D
More like....     in the "Store" Window of the Storage-Script ("in the Chest").

I'm not sure if you guys mean the same thing I do, I'm just a little... confused right now  :shy:


By default, the game does that. And it's completely fixed now.

zottel89

June 20, 2012, 04:05:40 am #88 Last Edit: June 20, 2012, 04:08:28 am by zottel89
Well, it didn't do it by default for me, that's for sure,
but it does it now, so...  thanks alot  :^_^':

QuentinWhite

Newest version crashes, when i try to open chest with armor in my inventory. This hapens even if there is piece of armor already inside the chest.

Spoiler: ShowHide



G_G

Updated to 1.42. Fixed armor crash.

QuentinWhite

Now i get error at line 301:
Spoiler: ShowHide



G_G

Sorry, simple typo. Fixed. xD

QuentinWhite

You are pretty quick  :nod:

But i have another error. Now i can open chest if there is armor inside, but i get an error if i try to open chest with piece of armor in my inventory. This happens too, if i take any piece of armor from chest.


Spoiler: ShowHide



G_G

UGH! I feel like an idiot. xP It should be fixed now. Hopefully no more errors.

zottel89

Quote from: QuentinWhite on July 17, 2012, 06:00:25 pm
You are pretty quick  :nod:

But i have another error. Now i can open chest if there is armor inside, but i get an error if i try to open chest with piece of armor in my inventory. This happens too, if i take any piece of armor from chest.


Spoiler: ShowHide






I just read this and tried it out...

I'm getting this error, too.   Any idea on how to fix this? :(

KK20

God RMXP does the stupidest stuff sometimes...why use element_set for items, weapons, and skills but not for armors (which use guard_element_set)?

Anyways, to be rebellious to RMXP's standards, throw this in anywhere.
class RPG::Armor
  def element_set
    return @guard_element_set
  end
end

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!

zottel89

Yeah that does sound pretty random  :haha:

Thank you so much (again), it all works fine now !

Xolitude

I know this post is old, but I just found it..

and..


Error.

#==============================================================================
# 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)
    if @chests[n] == nil < LINE 106
      @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


Any help?

G_G

Are you using the RMX-OS addon?