Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: Yin on May 28, 2009, 11:14:39 pm

Title: [Resolved]Making Items Not Show
Post by: Yin on May 28, 2009, 11:14:39 pm
How would I make certain items NOT show in the item menu even though I have them?
Title: Re: Making Items Not Show
Post by: Ryex on May 28, 2009, 11:24:04 pm
class Window_Item < Window_Selectable
 def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end
   @data = []
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++
#LOOK HERE
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++
#insert item ID's you don't want to show into this array
#ie [1, 4, 8] would not show Potion, Perfume, and Full Elixir by default
@dont_show_items = []
#insert armor ID's you don't want to show into this array
@dont_show_armors = []
#insert Weapon ID's you don't want to show into this array
@dont_show_weapons = []
#++++++++++++++++++++++++++++++++++++++++++++

   # Add item
   for i in 1...$data_items.size
     if $game_party.item_number(i) > 0
       @data.push($data_items[i]) unless @dont_show_items.include?(i)
     end
   end
   # Also add weapons and items if outside of battle
   unless $game_temp.in_battle
     for i in 1...$data_weapons.size
       if $game_party.weapon_number(i) > 0
         @data.push($data_weapons[i]) unless @dont_show_weapons.include?(i)
       end
     end
     for i in 1...$data_armors.size
       if $game_party.armor_number(i) > 0
         @data.push($data_armors[i]) unless @dont_show_armors.include?(i)
       end
     end
   end
   # If item count is not 0, make a bit map and draw all items
   @item_max = @data.size
   if @item_max > 0
     self.contents = Bitmap.new(width - 32, row_max * 32)
     for i in 0...@item_max
       draw_item(i)
     end
   end
 end
end

Title: Re: Making Items Not Show
Post by: G_G on May 28, 2009, 11:29:05 pm
It doesnt work Ryex. I tried that exact way and it didnt work. I added the item id 1 in the not display items yet it still displays the item id 1.
Title: Re: Making Items Not Show
Post by: Yin on May 28, 2009, 11:48:00 pm
I will test this out as well, thank you!
Title: Re: Making Items Not Show
Post by: Yin on May 29, 2009, 12:08:58 am
Yeah, I have the same results as game_guy. It still shows up in the menu.
Title: Re: Making Items Not Show
Post by: Ryex on May 29, 2009, 12:24:36 am
*slaps head*

silly me. I edited the post try it now
Title: Re: Making Items Not Show
Post by: Yin on May 29, 2009, 12:34:58 am
Perfect! Works like a charm! Thank you so much for the quick responses guys!