• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

How to set up argument using "or" in prerequisites

Bob G

Well-known member
Hi everyone,

How would you set up a prerequisite that uses the argument "or"? i.e. "If the hero has the weapon finesse feat or the combat expertise feat, the argument is true."
 
In this specific case you can use a tagexpr[].

Example:
Code:
hero.tagexpr[HasFeat.fWepFin | HasFeat.fComExp] <> 0

Check those tag ids I as don't remember them exactly but the example otherwise works.
 
Another thing you can do is combine tagis results and see what they add up to:

Code:
tagis[HasFeat.fWepFin] + tagis[HasFeat.fComExp] > 0

This works because tagis[whatever] returns 1 if the container in question (the hero, in this case) has at least one copy of the referenced tag. So in the above example, the result will be 1 if the hero has one feat, 2 if they have both, and 0 if they have neither. So any result greater than zero is valid.
 
A follow-up question regarding this topic: I'm working on a feat that two different criteria to satisfy prerequisites.
Prerequisites: Tripping bite feat or (combat expertise and improved trip)

I'm trying to translate this in ExprReqs, but keep getting parsing errors. My latest attempt was
hero.tagexpr[HasFeat.fTrippBite] <> 0 | hero.tagexpr[HasFeat.fComExpert + HasFeat.fImpTrip] >= 2

What's the correct syntax to express this?
 
Bob - take another look at the examples, and look for where the "|" and "+" actually are. Right now, you're mixing them together, with + inside tagexpr, where it's not used, and | outside of a tagexpr, so that won't work either.


tagexpr (HasFeat.fTrippBite | (HasFeat.fComExpert & HasFeat.fImpTrip)] <> 0
 
Bob - take another look at the examples, and look for where the "|" and "+" actually are. Right now, you're mixing them together, with + inside tagexpr, where it's not used, and | outside of a tagexpr, so that won't work either.


tagexpr[HasFeat.fTrippBite | (HasFeat.fComExpert & HasFeat.fImpTrip)] <> 0

Got it, thanks Mathias. Working as expected now. I appreciate the assist, as always.
 
Back
Top