• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

'Maximum' function behaving badly.

Bob G

Well-known member
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.
 
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
 
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!
 
Back
Top