• 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

Bonus Ability scores

ErinRigh

Well-known member
I am trying to code an ability (or many abilities) that allows a class to add a bonus to an attribute at certain levels. Similar to the 10th level Animal Lord Ability "Third Totem". I can get the class to add the bonus with

hero.child[aCHA].field[aNormMod].value = hero.child[aCHA].field[aNormMod].value + 2

what I can't figure out is how to add the bonus at different levels of the class; say Charisma at level 1, Constitution at level 3, Strength at level 5, etcetera.

I can either get all or nothing. Either it adds all the bonuses at 1st level or I can't get it to add them at all.

Any help would be TONS appreciated

Erin:confused:
 
I am trying to code an ability (or many abilities) that allows a class to add a bonus to an attribute at certain levels. Similar to the 10th level Animal Lord Ability "Third Totem". I can get the class to add the bonus with

hero.child[aCHA].field[aNormMod].value = hero.child[aCHA].field[aNormMod].value + 2

what I can't figure out is how to add the bonus at different levels of the class; say Charisma at level 1, Constitution at level 3, Strength at level 5, etcetera.

I can either get all or nothing. Either it adds all the bonuses at 1st level or I can't get it to add them at all.

Any help would be TONS appreciated

Erin:confused:

There are a couple of different ways. The one I would recommend is to have this (these) script(s) be on a class special. Then you can use the class special's field xTotalLev thusly:

Code:
if (field[xTotalLev].value >= 3) then
   hero.child[aCHA].field[aNormMod].value +=  2
endif

Note that I also truncated that addition of 2. I recommend using this method as it will save time and space.

Other methods include using multiple class specials with bootstrap conditions based on class tags (ie Classes.Ranger >= 3) or using the #levelcount macro (ie #levelcount[Ranger] >= 3). However, the use of the xTotalLev field allows this ability to improve based on other classes or feats modifying the class level without having to take actual class levels (like how some PrC's advance the Cleric's turn undead ability for example). If that's not a consideration or you want to purposefully avoid it, you can use the #levelcount macro instead.
 
Last edited:
Thanks mate, but this script gives me the following error;

Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in 'eval' script for Thing 'cDaKryl02' (Eval Script '#1') on line 1
-> Error parsing right-side expression in relational comparison

what am I doing wrong?
 
Thanks mate, but this script gives me the following error;

Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in 'eval' script for Thing 'cDaKryl02' (Eval Script '#1') on line 1
-> Error parsing right-side expression in relational comparison

what am I doing wrong?

I forgot to close parentheses on the first line. Corrected above.
 
Back
Top