Senior Member
Join Date: Oct 2016
Posts: 621
|
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 |
#1 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Quote:
Code:
if (field[xTotalLev].value >= 3) then hero.child[aCHA].field[aNormMod].value += 2 endif 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 by Sendric; November 17th, 2016 at 06:34 AM. |
|
#2 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
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? |
#3 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Quote:
|
|
#4 |
|
|