https://www.rpgmakercentral.com/topic/661-vxa-categorize-item-scene/
I've been working on figuring out how to change this script to help another member on another forum.
TheoAllen has helped me to figure out some of the problem, but I haven't been able to finish it.
I did make some progress, but my knowledge of ruby is certainly low.
Essentially the request was to hide item categories if there were no items for that specific category.
The code given by Theoallen which works for the default categories is
for the make command section
From here there are two problems,
The custom categories that can be added to any item, weapon or armor
and the help description. The help text doesn't line up when categories are removed.
I tried this for custom categories but it doesn't really work, again lack of knowledge.
linking to this section i added in under baseitem
I did try using item_category in BaseItem, but the categories show up when an item is available but not for that category.
Thanks for any advice.
**edit...
I just got the custom categories to work.
Now if someone can advise with the help text indexing.
I've been working on figuring out how to change this script to help another member on another forum.
TheoAllen has helped me to figure out some of the problem, but I haven't been able to finish it.
I did make some progress, but my knowledge of ruby is certainly low.
Essentially the request was to hide item categories if there were no items for that specific category.
The code given by Theoallen which works for the default categories is
Code:
CategoryConditions = {
:item => lambda { !$game_party.items.empty? && $game_party.items.any? {|item| !item.key_item? }},
:weapon => lambda { !$game_party.weapons.empty? },
:armor => lambda { !$game_party.armors.empty? },
:key_item => lambda { !$game_party.items.empty? && $game_party.items.any? {|item| item.key_item? }},
:all_item => lambda { !$game_party.all_items.empty? },
}
Code:
alias icat_make_command_list make_command_list
def make_command_list
ICAT::VISIBLE_CATEGORY_INDEX.each { |symbol, label|
add_command(label, symbol) if ICAT::CategoryConditions[symbol].call
}
end
The custom categories that can be added to any item, weapon or armor
and the help description. The help text doesn't line up when categories are removed.
I tried this for custom categories but it doesn't really work, again lack of knowledge.
Code:
:potion => lambda { !$game_party.all_items.empty? && $game_party.all_items.any? {|item| item.find_category } },
:ammunition => lambda { !$game_party.all_items.empty? && $game_party.all_items.any? {|item| item.find_category } },
Code:
def find_category
self.note.split(/[\r\n]+/).each { |line|
if line =~ ICAT::Regexp::BaseItem::CATEGORY
c = ICAT::CATEGORY_IDENTIFIER.key($1)
return c if c != nil
end
}
end
I did try using item_category in BaseItem, but the categories show up when an item is available but not for that category.
Thanks for any advice.
**edit...
I just got the custom categories to work.
Code:
:potion => lambda { $game_party.all_items.any? {|item| item.find_category == :potion} },
:ammunition => lambda { $game_party.all_items.any? {|item| item.find_category == :ammunition} },