Junior Member
Join Date: Feb 2018
Posts: 13
|
So, I am trying to create an automatic calculation for unique subclass i am creating. Basically, I need a calculation that goes like this:
1+attribute bonus/2 (rounded down if possible) Any help would be greatly appreciated. Thank you in advance. |
#1 |
Senior Member
Join Date: May 2016
Posts: 608
|
In the editor's local help files you can find an example in the eval scripts link:
Quote:
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) |
|
#2 |
Junior Member
Join Date: Feb 2018
Posts: 13
|
Quote:
Ok, so I am trying to link this to the Charisma modifier. So would this be correct? field[abValue].value = 1 + round(#attrmod[aCHA]/2,0,-1) |
|
#3 |
Junior Member
Join Date: Feb 2018
Posts: 13
|
So, I have watched every tutorial video i can find and no where is it covered how to add something like this to the automatic calculations list. Am I missing this somewhere?
|
#4 |
Senior Member
Join Date: Sep 2017
Posts: 600
|
You won't be able to add this to the automatic calculations. Those dump their result into the trkMax field. Are you doing this calculation to get a number of uses for a particular feature? That's what the trkMax field is for.
So instead of using the automatic calculations, do it with an eval script. I'd set the phase so time time Post-Attributes or later. Instead of dumping it into abValue (which is just a free-floating variable for use in abilities and their scripts), send it to that trkMax field. Code:
field[trkMax].value = 1 + round(#attrmod[aCHA]/2,0,-1) Found an issue with or have a suggestion for the 5e Community Pack? Please post it here at our GitHub. Feel free to stop by the Lone Wolf Development Subreddit, for discussion of any and all LWD products and community efforts! |
#5 |
|
|