• 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

Question for custom flaw

Starkad

Member
I know that to add a flaw where a 19 strength is required, you'd put in 'Field' = 'reqStr'. But how would you add a flaw that required either a 19 str OR a 19 con?
 
i know it sounds odd but i believe you use the + sign, at least thats what i see in other examples and have used myself
 
You'd need to use a pre-req for this

Code:
validif (#attrvalue[aSTR] >=19)
validif (#attrvalue[aCON] >= 19)
 
i know it sounds odd but i believe you use the + sign, at least thats what i see in other examples and have used myself

In this situation if you used a "+" it would look for the a combination of STR + CON to be >= 19 and not either/or
 
so some times it is a combo and sometimes it does if 1 or the other is valid? i'll never get ahold of this coding. lol
 
in general the #hasability and similar macros are all tagis[XXX.?] checks they have a value of 0 or 1. So adding them together and checking for a result that is not zero is like doing an or statement in an expr-req. This only works with the tagis statement.

In some rare occasions you might have to do a validif (#hasability[] + #hasability[] = 2) as part of a pre-req, something like Either A and B, or C, but it's rare.

Using the pre-req the way I did means it checks to see if either line is valid.
 
so some times it is a combo and sometimes it does if 1 or the other is valid? i'll never get ahold of this coding. lol
Your way works when asking "Boolean" questions. A Boolean is special data type in programming that is either a 1 or 0 or True or False. Unless of course we are talking about Quantum Boolean variables but not in the mood to talk about cats. :p :D

So a "Boolean" question or "if" statement would be like do I have Feat A or Feat B as the answer is either "TRUE(1)" or "FALSE(0)". You have no other way of answering the question.

So what you where saying is if a pre-req said Feat 1 or Feat 2 is required you would:
Code:
#hasfeat[fFeat1] + #hasfeat[fFeat2] <> 0
The above in many other languages would like like this:
Code:
If #hasfeat[fFeat1] = BOOLEAN_TRUE
   or #hasfeat[fFeat2] = BOOLEAN_TRUE;
    //Here do something when we have either feats
else;
    //Here do something when we do NOT have either feat
endif;
The two sets of code above are doing the same bit of logic just HL has shortened the syntex really down. So each #hasfeat[] macro returns TRUE (ie one) or FALSE (ie zero) allowing HL to do simple math:
1) #hasfeat[fFeat1] returns 0 + #hasfeat[fFeat2] returns 1 (totals 1) will NOT equal zero so its "true".
2) #hasfeat[fFeat1] returns 1 + #hasfeat[fFeat2] returns 0 (totals 1) will NOT equal zero so its "true".
3) #hasfeat[fFeat1] returns 0 + #hasfeat[fFeat2] returns 0 (totals 0) will equal zero so its "False".
4) #hasfeat[fFeat1] returns 1 + #hasfeat[fFeat2] returns 1 (totals 2) will NOT equal zeros so its "True".

Hope that helps some. :)
 
Back
Top