[RMVX ACE] HOW DO I MAKE A CONDITIONAL BRANCH THAT CHECKS WHETHER THE PLAYER HAS SEVERAL ITEMS?

Posts

Pages: 1
I have 8 items to check. I vaguely remember there being a script call that had something to do with 'any' but I could be wrong.

How do I check if the player has at least 1 of these 8 items before I let the conversation continue?
I think this'll do the job:
class Game_Interpreter
  def has_required_items?(required)
    for item in required
      return true if $game_party.has_item?($data_items[item])
    end
    return false
  end
end

You can then use it as a condition via the Conditional Branch command. Add something like this in Script:
has_required_items?([1,2,3,5,8,13,21])

Where the numbers are the ID's of the items you want to be required.
karins_soulkeeper

I love you.

It works like a charm.
Pages: 1