Jump to content


Photo

[Ace]Item list modification


  • This topic is locked This topic is locked
12 replies to this topic

#1 Todd

Todd

    Game Developer

  • Early Adopter
  • 245 posts
  • Primarily UsesOther
  • First LanguageEnglish

Posted 29 June 2012 - 12:15 AM

I'm trying to include an armor type under the item category and prevent the armor type from appearing under the armor category. I've tried a few different things, does any one know a way to do this?

#2 Todd

Todd

    Game Developer

  • Early Adopter
  • 245 posts
  • Primarily UsesOther
  • First LanguageEnglish

Posted 03 July 2012 - 07:26 PM

BUMP

#3 Tsukihime

Tsukihime

    Advanced Member

  • Members
  • 2,572 posts
  • Primarily UsesRMVX Ace
  • First LanguageEnglish

Posted 03 July 2012 - 08:53 PM

Just disable item filtering in the include? method.
himeworks011.png
My scripts.

Avatar by ShinGamix

#4 Todd

Todd

    Game Developer

  • Early Adopter
  • 245 posts
  • Primarily UsesOther
  • First LanguageEnglish

Posted 03 July 2012 - 08:54 PM

I'll try that thanks.

Can I see how you would do it? I can't get it to work.

Edited by Todd, 03 July 2012 - 10:08 PM.


#5 Tsukihime

Tsukihime

    Advanced Member

  • Members
  • 2,572 posts
  • Primarily UsesRMVX Ace
  • First LanguageEnglish

Posted 03 July 2012 - 10:13 PM

class Window_ItemList < Window_Selectable

  def include?(item)
    case @category
#~     when :item
#~       item.is_a?(RPG::Item) && !item.key_item?
#~     when :weapon
#~       item.is_a?(RPG::Weapon)
#~     when :armor
#~       item.is_a?(RPG::Armor)
    when :key_item
      item.is_a?(RPG::Item) && item.key_item?
    else
#~       false
      true
    end
  end
end

You might as well just remove the armor/weapon commands since you're not going to be using them.

Edited by Tsukihime, 03 July 2012 - 10:14 PM.

himeworks011.png
My scripts.

Avatar by ShinGamix

#6 Todd

Todd

    Game Developer

  • Early Adopter
  • 245 posts
  • Primarily UsesOther
  • First LanguageEnglish

Posted 03 July 2012 - 10:30 PM

I think you may be confused about what I'm trying to do. I'm just trying to make a certain type of armor appear under items and not under armor. I still need armor and weapons.This is what I tried.
#--------------------------------------------------------------------------
# * Include in Item List?
#--------------------------------------------------------------------------
def include?(item)
case @category
when :item
item.is_a?(RPG::Item) && item.is_a?(RPG::Armor.type_id(7))
when :weapon
item.is_a?(RPG::Weapon)
when :armor
item.is_a?(RPG::Armor)&& !item.is_a?(RPG::Armor.type_id(7))
end
end


#7 Tsukihime

Tsukihime

    Advanced Member

  • Members
  • 2,572 posts
  • Primarily UsesRMVX Ace
  • First LanguageEnglish

Posted 03 July 2012 - 10:43 PM


item.is_a?(RPG::Item) || (item.is_a?(RPG::Armor) && item.atype_id == 7)


Edited by Tsukihime, 03 July 2012 - 10:44 PM.

himeworks011.png
My scripts.

Avatar by ShinGamix

#8 Todd

Todd

    Game Developer

  • Early Adopter
  • 245 posts
  • Primarily UsesOther
  • First LanguageEnglish

Posted 03 July 2012 - 10:50 PM

Unfortunately that didn't work.

#9 Tsukihime

Tsukihime

    Advanced Member

  • Members
  • 2,572 posts
  • Primarily UsesRMVX Ace
  • First LanguageEnglish

Posted 03 July 2012 - 11:30 PM

You're probably not doing something right then. I included armor type 1 and get cloth armors as expected.

Are you sure the armor type is 7?
himeworks011.png
My scripts.

Avatar by ShinGamix

#10 Todd

Todd

    Game Developer

  • Early Adopter
  • 245 posts
  • Primarily UsesOther
  • First LanguageEnglish

Posted 03 July 2012 - 11:41 PM

I'm sure, this is what I did.
#--------------------------------------------------------------------------
# * Include in Item List?
#--------------------------------------------------------------------------
def include?(item)
case @category
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
end
end


#11 Tsukihime

Tsukihime

    Advanced Member

  • Members
  • 2,572 posts
  • Primarily UsesRMVX Ace
  • First LanguageEnglish

Posted 03 July 2012 - 11:55 PM

I don't see why armor type 7 wouldn't show up under the item list then.
himeworks011.png
My scripts.

Avatar by ShinGamix

#12 Todd

Todd

    Game Developer

  • Early Adopter
  • 245 posts
  • Primarily UsesOther
  • First LanguageEnglish

Posted 04 July 2012 - 12:18 AM

Well thanks for trying.

#13 Todd

Todd

    Game Developer

  • Early Adopter
  • 245 posts
  • Primarily UsesOther
  • First LanguageEnglish

Posted 07 July 2012 - 10:19 PM

I have a solution, may a Mod please close this?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users