• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

trying to give a penalty to Initiative

jjashley

Well-known member
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
 
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)
 
hero.child[Initiative].field[Penalty].value -= maximum(round(#levelcount[Fighter]/4,0,-1),1)
Honestly for any Class Ability should never hard-code a specific class as it prevents the ability from being used by other classes.

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
 
Last edited:
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)

Once again I thank you very much. I appreciate your patience with me to no end.

J
 
Back
Top