Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
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 Projects: Legendary Rogue (Legendary Games) 97.9%, Assassin (Interjection Games) 88%, Fortunate (rebuild of Luckbringer, Rite Publishing) 87.2%, Adept Godling (Super Genius Games) 73.9%, Eldritch Godling (Super Genius Games) 72.9%, Mighty Godling (Super Genius Games) 44.3%, Clever Godling (Super Genius Games) 41.2%, Legendary Cavalier (Legendary Games) 30.9% Message me for a list of completed projects. Visit my blog! https://gauntletsofblogrepower.blogspot.com/ |
#1 |
Senior Member
Join Date: Mar 2013
Location: Greater London, UK
Posts: 2,623
|
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 tool, Realm Works Output tool and Realm Works to Foundry module Donations gratefully received via Patreon, Ko-Fi or Paypal |
#2 |
Senior Member
Join Date: Feb 2015
Posts: 676
|
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] |
#3 |
Senior Member
Join Date: Nov 2017
Location: Trafford, PA, USA
Posts: 226
|
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) 97.9%, Assassin (Interjection Games) 88%, Fortunate (rebuild of Luckbringer, Rite Publishing) 87.2%, Adept Godling (Super Genius Games) 73.9%, Eldritch Godling (Super Genius Games) 72.9%, Mighty Godling (Super Genius Games) 44.3%, Clever Godling (Super Genius Games) 41.2%, Legendary Cavalier (Legendary Games) 30.9% Message me for a list of completed projects. Visit my blog! https://gauntletsofblogrepower.blogspot.com/ |
#4 |
Senior Member
Join Date: Mar 2013
Location: Greater London, UK
Posts: 2,623
|
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 tool, Realm Works Output tool and Realm Works to Foundry module Donations gratefully received via Patreon, Ko-Fi or Paypal |
#5 |
Senior Member
Join Date: Sep 2013
Location: Vancouver, Canada.
Posts: 813
|
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. |
#6 |
Senior Member
Join Date: Aug 2010
Posts: 1,528
|
Untyped bonuses do stack, yes. However, as far as I know all official penalties are untyped so they ALWAYS stack.
|
#7 |
|
|