A script to assign switches to items in the database, to grey them out when diactivated

● ARCHIVED · READ-ONLY
Started by Zoltor 4 posts View original ↗
  1. This oversight, has always driven me nuts. Yea you can technically disable the function of the item through eventing, however the item listed in the item menu, will still be clickable.

    What I want, is for a script to allow you to assign a switch via the item's note tag, to grey the item out(make it unclickable), if said switch is on, so if anyone would be so kind to create such a script, I would be very much obliged.

    I'm a big supporter of polished game design, and have a item that can't be used, yet is still clickable, just screams sloppy game design.
  2. I guess I can write a normal script once.

    class Game_BattlerBase  DISABLE_ITEMS_PER_SWITCH_REGEX = /<unusable:\s*(\d+)\s*>/  alias_method :disable_items_per_switch_usable_item_conditions_met?,               :usable_item_conditions_met?  def usable_item_conditions_met?(item)    disable_items_per_switch_usable_item_conditions_met?(item) &&      disable_items_per_switch_usable?(item)  end  def disable_items_per_switch_usable?(item)    item.note.scan(DISABLE_ITEMS_PER_SWITCH_REGEX).none? do |id, |      $game_switches[id.to_i]    end  endendPut one (or more!) tags like this one in the notes of an item.

    <unusable: 1>If switch 1 is on, then the item is not usable anymore.
  3. That works great, thanks a lot.
  4. This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.