In the editor's local help files you can find an example in the eval scripts link:
Quote:
field[abValue].value = round(field[abValue].value, number of decimals, round behavior)
rounds the value of the field to some number of digits (defined by the second aspect in the parenthesis, 0 meaning to whole numbers). Round behavior of 0 means "round up if .5 or greater", 1 means "always round up", and -1 means "always round down". The first aspect can include some manipulation of its own.
|
In your specific case it would be something like this for Intelligence:
field[abValue].value = 1 + round(#attrmod[aINT]/2,0,-1)
you might want to make it cleaner looking by declaring a variable that grabs the attribute modifier first before putting it into the math.
var attrbonus as number
var answer as number
attrbonus = #attrmod[aINT]
answer = 1 + round(attrbonus/2,0,-1)