• 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

trouble adding a penalty

psych777

Well-known member
trying to make a penalty based off of this:

"This power also causes you to constantly suffer the same penalty to your Diplomacy checks as other characters are unsettled by your very nature. At every four levels beyond 1st (5th, 9th, 13th, and 17th) this penalty increases by 1."

i've got this so far but it is not quite right. doesn't do the level increment right and its adding a positive number to the Penalty field which then is adding to the total instead of subtracting (it also doesn't display the penalty in the popup text box showing how the total is calculated when you mouse over the skill):

hero.child[skDiplo].field[Penalty].value = maximum(round(hero.child[Totals].field[tTotLevel].value/4,0,-1),1)
 
What sort of ability is this? If it is a class special or custom class special, then I wouldn't use the tTotLevel field on the totals helper. Instead I would use the level field on the respective pick (xAllLev or xTotalLev).

Penalty fields are supposed to be negative numbers, and untyped penalties stack, so there is no need to mess with maximum/minimum stuff.
 
its on a trait.
oh, i thought the max/min part made sure it was a minimum of 1, must have remembered wrong...
 
Ah, if it is on a trait then you're correct using that field.

Yes, what you have there will give you a minimum of 1, but since penalties are supposed to be negative numbers, you actually want a maximum of -1. You need to reverse things to calculate that (if you decide that it should be a non-stacking penalty) or you need to subtract the positive number you calculate (if as an untyped penalty it should stack with other untyped penalties).

Untyped Penalty that stacks:
PostLevel 10000
Code:
hero.child[skDiplo].field[Penalty].value -= maximum(round(hero.child[Totals].field[tTotLevel].value/4,0,-1),1)

Untyped Penalty that doesn't stack:
PostLevel 10000
Code:
hero.child[skDiplo].field[Penalty].value = minimum(round(hero.child[Totals].field[tTotLevel].value/-4,0,-1),-1)
 
thanks Aaron, that does get the penalty to the negatives :)

so that makes the penalty -1 at first level, and doesn't change to -2 til 8th level. how would i get it to change at the rate of the trait description (so -2 at 5th level)?
"At every four levels beyond 1st (5th, 9th, 13th, and 17th) this penalty increases by 1"
 
Back
Top