Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game

Notices

Reply
 
Thread Tools Display Modes
Bob G
Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 88

Old November 10th, 2018, 09:09 AM
Hi Folks,

Working on an ability that adds a bonus to Fort and Will saves at specific levels. I tried using ShadowChemosh's code that uses xCount, but the bonuses aren't adding correctly after the first instance.
Code:
field[abValue].value += field[xCount].value
     hero.child[svFort].field[Bonus].value += field[abValue].value
     hero.child[svWill].field[Bonus].value += field[abValue].value
So what am I missing here?
Bob G is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,329

Old November 10th, 2018, 09:16 AM
You've left out a lot of information, I'm afraid - first, where is this ability - the code you've posted will only work on a class special, but you just said "ability", so I'm not sure what sort of ability this is. Also, please be specific about "aren't adding correctly after the first instance" means - what numbers are you seeing?
Mathias is online now   #2 Reply With Quote
Bob G
Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 88

Old November 10th, 2018, 11:57 AM
Quote:
Originally Posted by Mathias View Post
You've left out a lot of information, I'm afraid - first, where is this ability - the code you've posted will only work on a class special, but you just said "ability", so I'm not sure what sort of ability this is. Also, please be specific about "aren't adding correctly after the first instance" means - what numbers are you seeing?
Hi Mathias, thanks for responding! First, this is a class special. Next, the ability is bootstrapped at level 1, 7 and 14. At level 1, the bonus adds correctly as an untyped +1 bonus, but at level 7 the bonus calculates to +3, when it should be +2. At level 14, the bonus calculates to +5, when it should be +3.
Bob G is offline   #3 Reply With Quote
Aaron
Senior Member
Lone Wolf Staff
 
Join Date: Oct 2011
Posts: 6,628

Old November 10th, 2018, 12:53 PM
What is happening is the 2nd and 3rd copies are adding 1 each, since they have an xCount of 1.

You need to add a stop so that only the first copy of the class special adds the bonus. Like so:

Code:
field[abValue].value += field[xCount].value

~only do this if we are the first copy
doneif (tagis[Helper.FirstCopy] = 0)

hero.child[svFort].field[Bonus].value += field[abValue].value
hero.child[svWill].field[Bonus].value += field[abValue].value
Aaron is offline   #4 Reply With Quote
Bob G
Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 88

Old November 10th, 2018, 08:31 PM
That did the trick! Thanks Mathias!
Bob G is offline   #5 Reply With Quote
Aaron
Senior Member
Lone Wolf Staff
 
Join Date: Oct 2011
Posts: 6,628

Old November 10th, 2018, 08:34 PM
Blinks owlishly
Aaron is offline   #6 Reply With Quote
Reply

Thread Tools
Display Modes

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 10:25 AM.


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