Display Timer?

I know I can display the in game timer, but I want to display the timer behavior counting down to zero. Thank you if you find out because this is needed for my game to work.

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    100 - game.time

  • CowuniverseCowuniverse Member, PRO Posts: 97

    @Socks said:
    100 - game.time

    I don't understand

  • SocksSocks London, UK.Member Posts: 12,822

    @Cowuniverse said:
    I don't understand

    100 - game.time will count down from 100.

  • CowuniverseCowuniverse Member, PRO Posts: 97

    @Socks said:
    100 - game.time will count down from 100.

    Yes, but will that work in the timer behavior. Because when it do that all it displays is 0

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2015

    @Cowuniverse said:
    Yes, but will that work in the timer behavior. Because when it do that all it displays is 0

    In your post you say you want to display a timer, so I have suggested something that you would display ! :)

  • CowuniverseCowuniverse Member, PRO Posts: 97

    @Socks said:

    sorry but thanks for the help

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

    If you want to count down from 100 (or another number), create a real attribute called game.customTimer and set its value to 100. In a Timer set to every 0.1 seconds, change game.customTimer to game.customTimer - 0.1

    Use a Display Text behavior to display game.customTimer. Use the roundTo() function to shorten the number of digits.

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

  • CowuniverseCowuniverse Member, PRO Posts: 97

    @tatiang said:
    If you want to count down from 100 (or another number), create a real attribute called game.customTimer and set its value to 100. In a Timer set to every 0.1 seconds, change game.customTimer to game.customTimer - 0.1

    Use a Display Text behavior to display game.customTimer. Use the roundTo() function to shorten the number of digits.

    Thank you this has worked so far, but the only thing is I don't understand how the roundto function works.

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

    You can select it from the math function drop-down menu or type it in. RoundTo() is explained in the cookbook, at the bottom of this page: https://help.gamesalad.com/hc/en-us/articles/202699556-1-11-Glossary.

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

  • SocksSocks London, UK.Member Posts: 12,822

    @Cowuniverse said:
    sorry but thanks for the help

    Didn't it work for you ?

  • CowuniverseCowuniverse Member, PRO Posts: 97

    @Socks said:
    Didn't it work for you ?

    Yeah I just had it count down a second at a time instead of .1 seconds

Sign In or Register to comment.