The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: DoctorTodd on June 16, 2012, 10:35:28 PM

Title: [VXA][Resolved]Item Categories
Post by: DoctorTodd on June 16, 2012, 10:35:28 PM
I'm using Kread-Ex's rune enchantment script and I face a problem where the runes appear in the armor category rather than the item category (since they have to be made in the armor category). I looked at Window_ItemList and tried to make them only appear in the item category and it didn't work. Is there a way to do this?
Title: Re: [VXA]Item Categories
Post by: DoctorTodd on June 21, 2012, 12:58:03 AM
BUMP
Title: Re: [VXA]Item Categories
Post by: DoctorTodd on June 28, 2012, 12:01:15 AM
BUMP
Title: Re: [VXA]Item Categories
Post by: DoctorTodd on June 30, 2012, 06:42:49 AM
BUMP
Can some one please help me? I've tried a few different things and nothing has worked.
Title: Re: [VXA]Item Categories
Post by: Wiimeiser on June 30, 2012, 07:11:34 AM
You'll probably have to download an item categorization script or something, or make one yourself.
Title: Re: [VXA]Item Categories
Post by: DoctorTodd on June 30, 2012, 07:13:25 AM
It should only take a line of code but I can't figure out what it is. I tried RPG::Armor.atyped_id(7) but that didn't work.
Title: Re: [VXA]Item Categories
Post by: DoctorTodd on July 04, 2012, 05:18:39 AM
BUMP
Title: Re: [VXA]Item Categories
Post by: DoctorTodd on July 07, 2012, 08:08:06 AM
BUMP

Some one tried to help me on the RPG Maker web forums with this, but it didn't work.

   when :item
   item.is_a?(RPG::Item) || item.is_a?(RPG::Armor) && item.atype_id == 7
   when :weapon
   item.is_a?(RPG::Weapon)
   when :armor
   item.is_a?(RPG::Armor) || !item.is_a?(RPG::Armor) && item.atype_id == 7
Title: Re: [VXA]Item Categories
Post by: Chaos17 on July 07, 2012, 09:49:12 AM
Hi,

You find a script that have items categories for shops, mayne it could help you figure out something:
http://www4.plala.or.jp/findias/codecrush/material/vxace_rgss3/index.html
Title: Re: [VXA]Item Categories
Post by: cozziekuns on July 07, 2012, 05:51:08 PM
The little snippet the RPG Maker Web person wrote for you has the right concept but the wrong logic.


#==============================================================================
# ** Window_ItemList
#==============================================================================

class Window_ItemList

  def include?(item)
    case @category
    when :item
      item.is_a?(RPG::Item) && !item.key_item? || (item.is_a?(RPG::Armor) && item.atype_id == 7)
    when :weapon
      item.is_a?(RPG::Weapon)
    when :armor
      item.is_a?(RPG::Armor) && item.atype_id != 7
    when :key_item
      item.is_a?(RPG::Item) && item.key_item?
    else
      false
    end
  end
 
end


The above code should work. Not sure if that's what you wanted, though. And it's not the best workaround, either.
Title: Re: [VXA]Item Categories
Post by: DoctorTodd on July 07, 2012, 08:10:29 PM
I got an error when trying to use it because of another script that is a patch for Individual equipment and the Runic enchantment script. The Rune is in there because it is both an armor and labeled as Rune. The line looks like this.
     when :armor
    (item.is_a?(Game_CustomEquip) && item.object.is_a?(RPG::Armor)) ||
     (item.is_a?(RPG::Armor) && item.is_rune?)

Even if you remove the bottom line it'll still display under armor. I did manage to get it under items though.
    when :item
    item.is_a?(Game_CustomEquip) || (item.is_a?(RPG::Item) && item.is_rune?)

Is there anything I can do so the Runes are just under items?
Title: Re: [VXA]Item Categories
Post by: cozziekuns on July 07, 2012, 10:57:48 PM

when :armor
    (item.is_a?(Game_CustomEquip) && item.object.is_a?(RPG::Armor)) && !(item.is_a?(RPG::Armor) && item.is_rune?)
Title: Re: [VXA]Item Categories
Post by: DoctorTodd on July 07, 2012, 11:21:57 PM
Nope it still appeared under armor.
Title: Re: [VXA]Item Categories
Post by: cozziekuns on July 08, 2012, 03:10:31 AM
Oh sorry didn't notice the custom equip script that you're using.

This should work then:


when :armor
    (item.is_a?(Game_CustomEquip) && item.object.is_a?(RPG::Armor)) && !(item.object.is_a?(RPG::Armor) && item.is_rune?)


Otherwise, you should list all the scripts you're using and such.
Title: Re: [VXA]Item Categories
Post by: DoctorTodd on July 08, 2012, 03:17:44 AM
Thanks cozziekuns, it works fine now.