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
Senior Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 201

Old January 29th, 2020, 07:57 PM
They shouldn't, right?

Custom special has user select a skill, and gets a (level/2) competence bonus. Class gets a total of 5 of these over a 20 level progression, and each special is unique. However, some confer a bonus to the same skill. They are not supposed to stack with each other, so I chose a competence bonus. Script is identical for all specials:
Code:
if (field[xTotalLev].value <=1) then
     field[abValue].value += 1
     else
     field[abValue].value += round(field[xTotalLev].value/2,0,-1)
     endif
     hero.child[sk(Skill)].field[BonComp].value += field[abValue].value
So what is it that's allowing the competence bonus granted from two different custom specials to stack?

Projects: Legendary Rogue (Legendary Games) 94.9%, Assassin (Interjection Games) 81%, Eldritch Godling (Super Genius Games) 50.8%, Mighty Godling (Super Genius Games) 35.6%, Clever Godling (Super Genius Games) 30.3%, Adept Godling (Super Genius Games) 27.2%, Legendary Cavalier (Legendary Games) 18.7%, Fortunate (rebuild of Luckbringer, Rite Publishing) 13.5%

Message me for a list of completed projects.
Visit my blog! https://gauntletsofblogrepower.blogspot.com/
Bob G is offline   #1 Reply With Quote
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 2,373

Old January 29th, 2020, 11:48 PM
Where is your code snippet from?
I'm fairly sure there's a macro which will correctly apply a non-stacking bonus to a particular stat.

Farling

Author of the Realm Works Import (http://forums.wolflair.com/showthread.php?t=58156) and Output tools (http://forums.wolflair.com/showthread.php?t=59981)
Farling is offline   #2 Reply With Quote
TheIronGolem
Senior Member
 
Join Date: Feb 2015
Posts: 641

Old January 30th, 2020, 06:08 AM
Code:
hero.child[sk(Skill)].field[BonComp].value += field[abValue].value
This is why it's stacking. You have multiple scripts pointing to the same skill and saying "increase the competence bonus by X". Instead, try this:

Code:
hero.child[sk(Skill)].field[BonComp].value = maximum(hero.child[sk(Skill)].field[BonComp].value ,field[abValue].value)
Or this macro which amounts to the same thing:

Code:
#applybonus[BonComp,hero.child[sk(Skill),field[abValue].value]
This means "set the competence bonus to X or the existing bonus, whichever is larger".
TheIronGolem is offline   #3 Reply With Quote
Bob G
Senior Member
 
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 201

Old February 2nd, 2020, 05:17 AM
Great, thanks IG. For some reason, I thought that competence bonuses would just automatically not stack by default. I thought maybe there was something in the XML file that treated it differently than stacking bonuses. So I guess that regardless of the bonus type, I need to define in the script if the bonus stacks or doesn't.

I learned something today! Today is a good day.

Projects: Legendary Rogue (Legendary Games) 94.9%, Assassin (Interjection Games) 81%, Eldritch Godling (Super Genius Games) 50.8%, Mighty Godling (Super Genius Games) 35.6%, Clever Godling (Super Genius Games) 30.3%, Adept Godling (Super Genius Games) 27.2%, Legendary Cavalier (Legendary Games) 18.7%, Fortunate (rebuild of Luckbringer, Rite Publishing) 13.5%

Message me for a list of completed projects.
Visit my blog! https://gauntletsofblogrepower.blogspot.com/
Bob G is offline   #4 Reply With Quote
Farling
Senior Member
 
Join Date: Mar 2013
Location: Greater London, UK
Posts: 2,373

Old February 2nd, 2020, 06:47 AM
Just use the #applybonus macro, since bonuses of the same type should never stack (except dodge).

You're original code was using the "+=" operator, which just adds your new value to the existing value.

Farling

Author of the Realm Works Import (http://forums.wolflair.com/showthread.php?t=58156) and Output tools (http://forums.wolflair.com/showthread.php?t=59981)
Farling is offline   #5 Reply With Quote
Ualaa
Senior Member
 
Join Date: Sep 2013
Location: Vancouver, Canada.
Posts: 699

Old February 2nd, 2020, 02:09 PM
I believe untyped bonuses stack, dodge bonuses stack, and circumstance bonuses stack if they're from different circumstances.

As well as penalties of those same types, such as two different penalties from unique circumstances or two different dodge penalties.

Aside from those exceptions, all bonuses (or penalties) only take the best (or worst) single condition.
Ualaa is offline   #6 Reply With Quote
Silveras
Senior Member
 
Join Date: Aug 2010
Posts: 1,521

Old February 2nd, 2020, 07:49 PM
Untyped bonuses do stack, yes. However, as far as I know all official penalties are untyped so they ALWAYS stack.
Silveras is offline   #7 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 12:13 PM.


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