Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   Coding at a loss (http://forums.wolflair.com/showthread.php?t=63534)

ErinRigh December 5th, 2019 03:09 PM

Coding at a loss
 
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!

TobyFox2002 December 5th, 2019 03:15 PM

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.

ErinRigh December 5th, 2019 03:43 PM

thanks mate

ErinRigh December 5th, 2019 04:02 PM

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


Aaron December 5th, 2019 04:07 PM

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.

ErinRigh December 5th, 2019 04:10 PM

thanks Aaron

ShadowChemosh December 5th, 2019 04:10 PM

#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

ErinRigh December 5th, 2019 05:17 PM

cool, that'll work too, thanks SC


All times are GMT -8. The time now is 11:58 AM.

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