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)
-   -   'Maximum' function behaving badly. (http://forums.wolflair.com/showthread.php?t=63886)

Bob G February 16th, 2020 08:33 PM

'Maximum' function behaving badly.
 
Phase Pre-attributes, priority 10000
Code:

field[abValue].value += maximum(hero.childfound[aINT].field[aBonus].value,2)

field[abSumm].text = field[abValue].value

Entered value of 16 for hero's Intelligence, but abValue still reporting value of 2. Don't know why. Please tell me why.

ShadowChemosh February 16th, 2020 09:30 PM

Quote:

Originally Posted by Bob G (Post 286005)
Phase Pre-attributes, priority 10000
Code:

field[abValue].value += maximum(hero.childfound[aINT].field[aBonus].value,2)

field[abSumm].text = field[abValue].value

Entered value of 16 for hero's Intelligence, but abValue still reporting value of 2. Don't know why. Please tell me why.

You are running the script before attributes have been calculated so hero.childfound[aINT].field[aBonus].value is 0 and 2 is greater than 0.

For stuff like this add debug statements:
Code:

field[abValue].value += maximum(hero.childfound[aINT].field[aBonus].value,2)
debug hero.childfound[aINT].field[aBonus].value
field[abSumm].text = field[abValue].value


Bob G February 17th, 2020 01:32 PM

Sure enough, that was the issue. It's strange because originally I had the timing at Post Attributes 10000, but it wasn't working, which is why I changed it. But it works now, so all good. Thanks SC!


All times are GMT -8. The time now is 04:06 PM.

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