Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

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

Old November 10th, 2018, 08: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: 13,213

Old November 10th, 2018, 08: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 offline   #2 Reply With Quote
Bob G
Senior Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226

Old November 10th, 2018, 10: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
 
Join Date: Oct 2011
Posts: 6,793

Old November 10th, 2018, 11:53 AM
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
Senior Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226

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

Old November 10th, 2018, 07:34 PM
Blinks owlishly
Aaron is offline   #6 Reply With Quote
Bob G
Senior Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226

Old November 19th, 2018, 03:38 PM
Quote:
Originally Posted by Aaron View Post
Blinks owlishly
And you too, Aaron! Sorry I left you out. Don't feel excluded...
Bob G is offline   #7 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old November 19th, 2018, 06:34 PM
Thumbs up
Aaron is offline   #8 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 11:33 PM.


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