Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD
Register FAQ Community Today's Posts Search

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 608

Old December 2nd, 2020, 04:35 AM
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)
dungeonguru is offline   #2 Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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