Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
ErinRigh
Senior Member
 
Join Date: Oct 2016
Posts: 621

Old November 16th, 2016, 11:14 PM
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
ErinRigh is offline   #1 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old November 17th, 2016, 05:50 AM
Quote:
Originally Posted by ErinRigh View Post
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
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 by Sendric; November 17th, 2016 at 06:34 AM.
Sendric is offline   #2 Reply With Quote
ErinRigh
Senior Member
 
Join Date: Oct 2016
Posts: 621

Old November 17th, 2016, 06:14 AM
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?
ErinRigh is offline   #3 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old November 17th, 2016, 06:34 AM
Quote:
Originally Posted by ErinRigh View Post
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.
Sendric is offline   #4 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:22 PM.


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