Page 1 of 1

custom stats if(exp, then, else)

PostPosted: Sat Aug 30, 2008 12:24 pm
by elr18
hi! im working on a custom stat and i was wondering if there was a way to add 2 if(exp , then, else) expressions together like this :
if(exp , then, else) + if(exp , then, else) . the 2 expressions work well alone but when i addition them together i never seem to get the rights results. i also seem to get trouble with : if(exp , then, else) + x when the if expression is negative : ex.: if the if expression is worth -2 : if(exp , then, else) + 5 , i get 4 as a result
thank you!

Re: custom stats if(exp, then, else)

PostPosted: Sat Aug 30, 2008 1:06 pm
by WhiteRider
Try putting them in brackets:

( if(exp , then, else) ) + ( if(exp , then, else) )

I'm not sure that will work, but it's worth a shot.

If not you will have to do something like
if( exp1, if(exp2, then1+then2, then1), if(exp2,then2,0) )