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 |
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. |
Code:
hero.child[sk(Skill)].field[BonComp].value += field[abValue].value Code:
hero.child[sk(Skill)].field[BonComp].value = maximum(hero.child[sk(Skill)].field[BonComp].value ,field[abValue].value) Code:
#applybonus[BonComp,hero.child[sk(Skill),field[abValue].value] |
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. |
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. |
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. |
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.