reducing a value by -1 seems to subtract by 4

turnstyleturnstyle Member, PRO Posts: 13
edited November -1 in Working with GS (Mac)
not sure what I'm doing wrong.

I simply created a button with a rule.
The rule has a timer that states: after 1 second, change attribute game.lives to game.lives -1

I start with 5 lives, after this plays I was down to only 1 life rather than 4 left.

THEN I did a test with 100 lives and sure enough it gets chipped away by 4 every second.

-thanks for any help on this

Comments

  • chosenonestudioschosenonestudios Member Posts: 1,714
    can you upload a downloadable project so I can take a look?
  • turnstyleturnstyle Member, PRO Posts: 13
    OK weird, I created a brand new file and setup the exact same thing and it works as expected. not sure why my main file goes by 4's. If I figure it out, I'll post the solution in case this happens to anyone else.
  • chosenonestudioschosenonestudios Member Posts: 1,714
    turnstyle said:
    OK weird, I created a brand new file and setup the exact same thing and it works as expected. not sure why my main file goes by 4's. If I figure it out, I'll post the solution in case this happens to anyone else.

    Something else in your rules is causing this... Look and see if theres any conflicting interests in your rule set :D
  • turnstyleturnstyle Member, PRO Posts: 13
    still unsure why this happened. Maybe a timer conflict, but I solved it by...

    if the player doesn't hit the button in a certain time, then change attribute game.miss to 1

    then in the lives a rule was made if attribute game.miss = 1 then subtract game.lives by 1.

    same thing just instead of using a time limit to trigger a negative 1 to lives, I just triggered an either on or off state to a new attribute called "miss", then the "lives" get changed based on the miss attribute.
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    well if 1 is taking away 4 lives... why dont you do 0.25 so it should go to 1 life/sec???
    this my work/may not :)

    EDIT: opps, didnt see u had already solved it :)
Sign In or Register to comment.