Constrain attribute

bluebyu25bluebyu25 Member Posts: 500
edited November -1 in Working with GS (Mac)
Im not sure, but I think this is the behavior that I need?

I'm trying to make it to where game.misses cannot equal anything lower than 0.

I'm trying to set it up to where every 1,000 points a player gets a "miss" taken off his misses (and I know how to do that) I just dont want the total misses to become -1 if he gets 1,000 points and hasnt missed any yet.

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    whatever you have changing total misses to total misses-1 have that in a rule that states when attribute total misses > 0

    that way it wil only subtract when its more then zero like you want

    cheers
  • bluebyu25bluebyu25 Member Posts: 500
    Thanks John
  • bluebyu25bluebyu25 Member Posts: 500
    This is what I have but it still isn't working. Did I follow your suggestion correctly?

    image

    Sorry pic isnt working but what I have is:

    RULE: when game.score is = game.score+1000

    then

    RULE: game.misses >0

    then change attribute game.misses to -1
  • WolvennaWolvenna Member Posts: 11
    Why would you want to change the attribute to -1 if you were trying to keep it from becoming anything less than zero?

    when game.misses > 0
    then change attribute game.misses to game.misses -1

    That should subtract only when it's above zero. The way you had it, it sounds like it would insta-change it to -1 every time.
Sign In or Register to comment.