• 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

Coding at a loss

ErinRigh

Well-known member
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!
 
Code:
  if (#hasability[cWildEmp] <> 0) then
     do stuff...
  end
When searching for how to check for various specials, the best place to look is for feats. Open a portfolio and type in "requires Wild Empathy" or whatever you require, and then open that feat in the editor.
 
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
 
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.
 
#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
 
Back
Top