Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Starkad
Junior Member
 
Join Date: Sep 2014
Posts: 7

Old August 3rd, 2015, 08:10 PM
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?
Starkad is offline   #1 Reply With Quote
psych777
Senior Member
 
Join Date: Aug 2011
Posts: 363

Old August 4th, 2015, 08:37 AM
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
psych777 is offline   #2 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old August 4th, 2015, 08:46 AM
You'd need to use a pre-req for this

Code:
validif (#attrvalue[aSTR] >=19)
validif (#attrvalue[aCON] >= 19)
AndrewD2 is offline   #3 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old August 4th, 2015, 08:47 AM
Quote:
Originally Posted by psych777 View Post
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
AndrewD2 is offline   #4 Reply With Quote
psych777
Senior Member
 
Join Date: Aug 2011
Posts: 363

Old August 4th, 2015, 08:51 AM
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
psych777 is offline   #5 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old August 4th, 2015, 09:11 AM
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.
AndrewD2 is offline   #6 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old August 4th, 2015, 10:36 AM
Quote:
Originally Posted by psych777 View Post
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.

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.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #7 Reply With Quote
psych777
Senior Member
 
Join Date: Aug 2011
Posts: 363

Old August 4th, 2015, 03:21 PM
ahhhhhh....i see.. i just needed someone to turn on the lightswitch for me...haha )
psych777 is offline   #8 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 09:03 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.