View Single Post
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old March 25th, 2019, 05:17 AM
Quote:
Originally Posted by Illyahr View Post
Working on a template that reduces some stats, but not below 3. I think I have the right code, but it isn't working.

Code:
var intval as number
intval = minimum(hero.child[aINT].field[aNormal].value-3,6)
hero.child[aINT].field[aNormal].value -= intval
It should check what attribute-3 is and apply either that (making the score 3) or 6 as a penalty to the attribute. What am I doing wrong?
Hard to say without knowing your results or doing some testing. I might suggest a different approach, though. Something like this, perhaps:

Code:
var intval as number
intval = hero.child[aINT].field[aNormal].value-6
hero.child[aINT].field[aNormal].value = maximum(intval,3)
Sendric is offline   #2 Reply With Quote