Another question for you good folks.
I'm trying to write something that will extend the basic item types that show in the item menu. So normally you just get normal items, weapons, armour, key items. I'd like to have other stuff in there like crafting ingredients and other things.
I'm doing this by way of putting note tags in the items that can be read by the script and then sort them into more categories. So I've extended class RPG::BaseItem with a method that will return true if a certain regex is found.
Code:
class RPG::BaseItem
def item_type?(arg)
# Evaluate if true
end
end
class Window_ItemList < Window_Selectable
def include?(item)
case @category
when :foo
item.item_type?(bar)
else
false
end
end
end
But no matter what I try, it throws an NoMethodError/undefined method error. It just can't see item_type? and I've no idea why. I've tried moving them around (I would have thought that RPG:BaseItem would need to be above Window_ItemList but it doesn't make a difference either way). I've tried calling the methods different things, as if that would make difference(!)
I've looked at other scripts and they seem to do it this way so I'm pretty stumped. Any help appreciated.
Thanks