This article is part of a collection of editor and scripting articles: http://forums.wolflair.com/showthread.php?t=21688
In Hero Lab's scripting languages, the standard math operations are of course available:
+
-
*
/
So, you can write instructions like:
hero.child[skClimb].field[Bonus].value = hero.child[skClimb].field[Bonus].value + 2
There's also a way to abbreviate that, so you don't have to type as much:
+=
-=
*=
/=
Here's the same instruction, with the abbreviation:
hero.child[skClimb].field[Bonus].value += 2
These abbreviations remove the need to repeat the base thing.
Other common math operations:
In Hero Lab's scripting languages, the standard math operations are of course available:
+
-
*
/
So, you can write instructions like:
hero.child[skClimb].field[Bonus].value = hero.child[skClimb].field[Bonus].value + 2
There's also a way to abbreviate that, so you don't have to type as much:
+=
-=
*=
/=
Here's the same instruction, with the abbreviation:
hero.child[skClimb].field[Bonus].value += 2
These abbreviations remove the need to repeat the base thing.
Other common math operations:
- maximum(A,B)
- Returns the value of whichever of A or B is higher
- minimum(A,B)
- Returns the value of whichever of A or B is lower
- round(A,# of decimal places,direction]
- # of digits is the number of decimal places you want. Pathfinder almost never uses decimals, so this will almost always be 0.
- direction is the direction to round the number. Entering a number that's less than 0 (like -1) will make it round down. Entering 0 will use normal rounding (0.5 and above rounds up, 0.499999 and below rounds down). Entering a number greater than 0 (like 1) will make it round up. The Pathfinder rules say that rounding down is the default, so you'll almost always be using -1 as the direction to round.
Last edited: