|
|
Thread Tools | Display Modes |
Member
Join Date: Aug 2014
Posts: 44
|
Hello,
I started to create my custom feats yesterday. pre-req bootstraps are really easy to use for basic prerequesites. But I have a case a little bit more complicated. I guess I should use pre-req eval script, but I don`t know how So: Feat : Ironbark Prerequesite : constitution 15, DR/Slashing Special : Hunter with natural weapon proficiency and monk does not need these prerequisites. Is it something possible? Is there an example somewhere? Thx |
#1 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
You're going to have to create a prereq script instead of using an Expr-req. You'll have to create 2.
Code:
validif (#attrvalue[aCON] >= 15) validif (#levelcount[Monk] >= 1) if (#levelcount[Hunter] >= 1) then if (check for natural weapon proficieny) then @valid = 1 endif endif |
#2 |
Member
Join Date: Aug 2014
Posts: 44
|
Thx for the answer. I am playing aroud this since an hour, and I don't totally understand what I am doing. I have following questions;
Thx for your time! |
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
For a "OR" logic of if any of the things make it valid you can combine somethings together. Mostly tests that return 1 or 0. Code:
validif (#hasability[xDamRdS] + #hasrace[rKaiyigiss] <> 0) So in this case its an example of "or" logic: Code:
validif (#attrvalue[aCON] >= 15) validif (#value[xDamRdS] <> 0) validif (#hasrace[rKaiyigiss] <> 0) Code:
~ assume not valid unless we meet all three conditions @valid = 0 ~ Test all three conditions are valid if (#attrvalue[aCON] >= 15) then if (#value[xDamRdS] <> 0) then if (#hasrace[rKaiyigiss] <> 0) then @valid = 1 endif endif endif 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. |
|
#4 |
Senior Member
Join Date: Jul 2012
Posts: 416
|
I believe you could to an AND check mathematically as follows, avoiding the nested if's:
Code:
validif ((#attrvalue[aCON] >= 15) + (#hasability[xDamRdS] <> 0) (#hasrace[rKaiyigiss] <> 0) == 3) |
#5 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
The above would work in many "high level" languages but not in HL script. The above assumes that HL has a way to deal with real boolean value so that (#attrvalue[aCON] >= 15) would return TRUE (1) or FALSE (0). Which it won't do. So the reason that this works: Code:
#hasability[xDamRdS] + #hasrace[rKaiyigiss] <> 0 Because #attrvalue[] can return a value from 0 to 99 it forces us to use the multiple "validif" statements. 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. |
|
#6 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Also, if your looking for a group of tags in the same context, you can use tagexpr. So for example:
#hasability[xDamRdS] is really hero.tagis[HasAbility.xDamRdS] and #hasrace[rKaiyigiss] is hero.tagis[Race.rKaiyigiss] So since they are both looking in the hero context you could do this instead of adding them together: validif (hero.tagexpr[HasAbility.xDamRdS | Race.rKaiyigiss] <> 0) |
#7 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Yes totally that is a great example of using tag expression. Its a bit more advanced so I left it out of the discussion. But once you know exactly all the tags and not macros tag expression is really cool.
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. |
#8 |
Member
Join Date: Aug 2014
Posts: 44
|
tagexpr looks interesting. Where can I get more information?
Finally, I endup with the following script : Code:
~ assume not valid unless we meet all three conditions @valid = 0 validif (#levelcount[Monk] >= 1) ~ Test all three conditions are valid if (#attrvalue[aCON] >= 15) then if (#value[xDamRdS] <> 0) then @valid = 1 endif endif And I did not use tagexpr as Aaron showed me. I did not know how to do with aCON. I found HasAbility.xDamRdS in tag expression (by right clicking on the special ability), but I did not find anything for constitution. Anyway, thank you all for the help! Last edited by peterphonic; September 19th, 2014 at 04:32 AM. |
#9 |
|
|