No index attribute in tables - how to keep integer always positive?

DanielDoeDanielDoe Member Posts: 307
edited August 2012 in Working with GS (Mac)
How to keep attributes that goes into integer table always positive?

Comments

  • simo103simo103 Member, PRO Posts: 1,331
    edited August 2012
    @danielhalat .... before I learnt what index was :P I used integer for things like my timers. I had a timer counting down and of course it went negative. So I just put in if timer<1 then timer=0 so that might help?
  • DanielDoeDanielDoe Member Posts: 307
    Ok, it's a kind of solution :)
  • simo103simo103 Member, PRO Posts: 1,331
    @danielhalat .... or you could use

    ABS
    Usage: abs(x)
    The absolute value of the number. i.e. make the number positive if it is negative.
  • DanielDoeDanielDoe Member Posts: 307
    I found something like min / max in expression ediitor. max set the minimal number that can an attribute contain. Very usefull! E.x. Change attribute:Life > max(1, 50-100) - the attribute Life will be never lower than 1 or any number you put instead of 1.
Sign In or Register to comment.