Senior Member
Join Date: Jan 2017
Posts: 139
|
I'm sure you fine folks are as tired of hearing from me as I am asking. I found the below script on how to calculate half character level.
~ Calculate half character level minimum 1 field[abValue].value += maximum(round(field[xTotalLev].value/2,0,-1),1) I'd like to actually figure this for class level, I tried the following but I find that the penalty gets set to the last digit in the string. The above was written for pathfinder and the fields found there. For those wondering this is for figuring the mutation score of a Blood Hunter. I'd like to add the mutagens as adjustments to the character and a number of them require figuring the mutation score which is class level divided by 4 rounded down with a minimum of 1. I have tried a couple of different variations but always come up with it giving a penalty of 0. Any ideas on what I'm doing wrong or a better way to figure the mutation score and use it to determine the penalty or bonus depending on the mutagen? hero.child[Initiative].field[Penalty].value -= maximum(round(hero.child[Totals].field[tTotLevel].value/4,0,-1),3) J |
#1 |
Senior Member
Join Date: May 2016
Posts: 608
|
Make sure you're running the script post-levels and here's one that is working, you just need to swap out the class (minimum of -1 penalty, maximum is determined by dividing the level count by 4).
hero.child[Initiative].field[Penalty].value -= maximum(round(#levelcount[Fighter]/4,0,-1),1) |
#2 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
Class Abilities have a field called xTotalLev that should be used to get total class level. In addition its easy to apply "effective class increases" by using the above field. If it was me building a class ability I would always store the value that increases/decreases into abValue to allow outside scripts to affect the ability. Meaning I end up with the following logic: Code:
field[abValue].value += -1 * maximum(round(field[xTotalLev].value/4,0,-1),1) hero.child[Initiative].field[Penalty].value += field[abValue].value Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. Last edited by ShadowChemosh; February 14th, 2018 at 12:53 PM. |
|
#3 |
Senior Member
Join Date: Jan 2017
Posts: 139
|
Quote:
J |
|
#4 |
Thread Tools | |
Display Modes | |
|
|