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)
-   -   Attribute Modifier (http://forums.wolflair.com/showthread.php?t=67849)

Angela2013 June 14th, 2023 09:21 AM

Attribute Modifier
 
Is there a script for adding or subtracting to attribute modifier instead of the attribute score?

Angela2013 June 20th, 2023 03:31 AM

Hello?

Lord Magus June 20th, 2023 05:53 AM

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

Angela2013 June 20th, 2023 09:31 AM

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.

Lord Magus June 20th, 2023 10:09 AM

Quote:

Originally Posted by Angela2013 (Post 301583)
Yes by attribute modifier I meant the following for example.
(...)
Looking for a script to add to the modifier not the attribute.

Considering how the system is (probably) structured, it's easier and more flexible to modify the base score, but then it's your call.

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)

The bonus is applied as early as possible in the Post-Attribute phase, to make sure it is taken into account for each and every process requiring the final attribute modifier value, and considering the devs do not recommend fiddling around in the Attributes phase.

All in all, considering what you have stated that you want to do, this should do.

Angela2013 June 22nd, 2023 10:52 AM

Thanks that works perfect.


All times are GMT -8. The time now is 03:18 AM.

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