Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   Why are my competence bonuses stacking? (http://forums.wolflair.com/showthread.php?t=63762)

Bob G January 29th, 2020 07:57 PM

Why are my competence bonuses stacking?
 
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?

Farling 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.

TheIronGolem 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".

Bob G 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.

Farling 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.

Ualaa 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.

Silveras 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.


All times are GMT -8. The time now is 02:03 PM.

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