Rule Question?? (Attributes)

Games4lifeGames4life Member, PRO Posts: 279

Hi GS community,

I am trying to get the attribute "timer" to add one second every time the attribute, "stop" is true. This rule is not working and just adding 1 to the attribute.

Goal: Reset the scene with an extra second on the clock
Ex: 10 seconds to start but stop attribute is true so now I want the scene to reset and +1 second and now there SHOULD be 11 seconds.

Thank for your help!
~G4L

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Rules only trigger when their status changes from false to true. So if game.Stop is true, it will trigger the rule ONCE. You would then need to reset game.Stop to false for the rule to trigger the next time game.Stop is true.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • IceboxIcebox Member Posts: 1,485
    edited May 2016

    @Games4life said:
    I am trying to get the attribute "timer" to add one second every time the attribute, "stop" is true. This rule is not working and just adding 1 to the attribute.
    Goal: Reset the scene with an extra second on the clock
    Ex: 10 seconds to start but stop attribute is true so now I want the scene to reset and +1 second and now there SHOULD be 11 seconds.

    The timer wont reset back to 10 on its own, its a game attribute you need to set it to 10 as default and then add 1 to this 10. so add a change attribute , change timer to 10 as default every time the scene starts , now you can add 1 to make it 11 or add 2 to make it 12 etc.

    I didnt try it but i think you need to add a rule by itself , if game.timer is = 10 and game.stop is true then change attribute game.timer to game.timer +1 , that should work i think.

  • ka822ka822 Member, PRO Posts: 40

    I tried this kind of rule before. If your game.timer is running continuously (decreasing), the 1 additional sec is hard to notice since the timer itself is decreasing very quickly.

    If you are resetting the clock, then your rule needs to change to reflect that each time stop is true clock timer resets to original value plus1.

Sign In or Register to comment.