Senior Member
Join Date: Oct 2016
Posts: 621
|
Ok maybe I am out of my depth here but I need some help with the code for a racial special ability.
Basically, I need the ability to check for wild empathy, and if so add a bonus to a variable racial ability. I have figured out the code for the variables but I can't find any explanation anywhere explaining how I get it to search for wild empathy? please help! |
#1 |
Senior Member
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632
|
Code:
if (#hasability[cWildEmp] <> 0) then do stuff... end |
#2 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
thanks mate
|
#3 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
Ok what am I doing wrong?
Post Attr/10000 Code:
if (#hasability[cWildEmp] <> 0) then field[abValue].value += hero.child[Totals].field[tHitDice].value + hero.child[aCHA].field[aModBonus].value + 4 else field[abValue].value += hero.child[Totals].field[tHitDice].value + hero.child[aCHA].field[aModBonus].value endif |
#4 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
HasAbility tags are not forwarded to the hero until way late. They are basically only for checking if pre-reqs are satisfied. Try using "hero.childlives[cWildEmp]" in the first branch of your code instead.
|
#5 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
thanks Aaron
|
#6 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
#hasability uses hero tags that are processed very late in timing as its meant for Pre-Req's not for standard checking. Meaning I assume your problem is that you always getting the bottom calculation.
The easy way is to fix the IF statement to check for the hero ability tag. Code:
if (hero.tagis[Ability.cWildEmp] <> 0) then 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. |
#7 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
cool, that'll work too, thanks SC
|
#8 |
|
|