Senior Member
Join Date: Sep 2011
Location: Wisconsin
Posts: 321
|
Is there a script for adding or subtracting to attribute modifier instead of the attribute score?
Some days I don't know why I bother to chew through the restraints. |
#1 |
Senior Member
Join Date: Sep 2011
Location: Wisconsin
Posts: 321
|
Hello?
Some days I don't know why I bother to chew through the restraints. |
#2 |
Senior Member
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 468
|
I assume you mean "attribute bonus" when you talk about the attribute modifier. The attribute bonus corresponding to the base attribute (base score+bonuses at creation (eg racial) +permanent bonuses gained during play) is stored in the aBonus field for each of the 6 ability scores.
The final attribute bonus, including temporary modifiers to the attribute score, is stored in aModBonus.The final values are available in the Post-Attribute phase, so they should be modified earlier than that if you want to make sure your modifiers are taken into account. I am not sure at which timing those 2 particular fields are finalized (somewhere in the Attributes phase), and if the way to determine their result is a fixed calculation (which would cancel bonuses specifically granted to those fields earlier). Last edited by Lord Magus; June 20th, 2023 at 09:57 AM. |
#3 |
Senior Member
Join Date: Sep 2011
Location: Wisconsin
Posts: 321
|
Yes by attribute modifier I meant the following for example.
Attribute 12 Modifier +1 Attribute 9 Modifier -1 Looking for a script to add to the modifier not the attribute. Some days I don't know why I bother to chew through the restraints. |
#4 |
Senior Member
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 468
|
Quote:
I'm not sure about this, but I'm going to assume that aBonus and aModBonus cannot be modified before they are calculated, as that calculation is likely to wipe the prior modifiers made. I may be wrong about that; if I am, you would be able to apply modifiers in earlier phases. Of the top of my head, this could look like (for STR) Code:
Phase Post-Attributes Priority 1 hero.child[aSTR].field[aModBonus].value += (insert bonus) All in all, considering what you have stated that you want to do, this should do. |
|
#5 |
Senior Member
Join Date: Sep 2011
Location: Wisconsin
Posts: 321
|
Thanks that works perfect.
Some days I don't know why I bother to chew through the restraints. |
#6 |
|
|