GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Custom font timer problem..

GLGAMESGLGAMES SingaporePosts: 988Member
edited January 2012 in Working with GS (Mac)
Anyone can show me a better way to have custom font timer, regardless count up or count down?

My problem is that it will show 60sec before adding the 1min, i set it when timer >59 add 1 to min.



no more embed ?

Comments

  • GLGAMESGLGAMES SingaporePosts: 988Member
    anyone with a timer template with custom font that i could use?
  • calvin9403calvin9403 Posts: 3,190Member
    Then use when timer is 59 sec

    Timer one sec

    Change it to a minute

    And make sure you stop the clock at 59 sec too
  • GLGAMESGLGAMES SingaporePosts: 988Member
    hmm i tried when timer =59 change timer to 0
    timer min +1 but it will still show the 60sec ,very strange
  • GSgames10GSgames10 Posts: 2Member
    edited January 2012
    you can try this ..
    attribute sec and min

    if{sec <60}

    timer: every second sec +1
    }

    if{ sec =59 }

    change attribute min=min+1
    change attribute sec = 0

    }
  • GLGAMESGLGAMES SingaporePosts: 988Member
    no matter how i try it will show 60sec before going to 01 never show 00 at all.
  • GSgames10GSgames10 Posts: 2Member
    when you do it like i wrote it ,it can´t show 60 sec..

    maybe you have a different timer rule somewhere else
  • MotherHooseMotherHoose Posts: 2,456Member
    edited January 2012
    also one can use the actorAttribute self.Time to track seconds & milliseconds
    displayText: exp: floor(self.Time) … use floorFunction so the milliseconds don't show

    at 22 minutes of play/run the self.Time will read 1320 seconds

    good video: Tshirtbooth's Displaying Time

    TSB uses game.Time … that's hour/minute/second/milliseconds …
    use this to help with self.Time … (just the stuff about seconds)
    the expressions used are in the Comments
    (wish this also had a download project!)
    ===
    IMO a customFont timer that is so small is hardly worth the work

    somewhat confused as minutes count-down and seconds count-up … or is the " * " denoting minus?
    (not criticizing; but the display is very small … if you are using Quicktime to record please select only the actual sceneSize to record)
    the word before the minutes could be removed and 22 minus seconds might work for clarity


    @};- MH
  • GLGAMESGLGAMES SingaporePosts: 988Member
    i wanted to try the game.time previously and divide the whole num with 60 so i can get min but i dunno how to get the sec which is the remainder of the division.
    @mothermoose, it's small cos the embed function is no more, you can only view it full screen so the image can be seen properly.
  • MotherHooseMotherHoose Posts: 2,456Member
    extracting from TSB excellent video

    for just seconds display:
            ":"..floor(( self.Time %60)/10)..floor( self.Time %10)
    do in ExpressionEditor and select the two self.Time … the other values you can type in

    displays :59 seconds then :00

    @};- MH
  • GLGAMESGLGAMES SingaporePosts: 988Member
    Anyone else know how to use custom font with game.time ??
  • MotherHooseMotherHoose Posts: 2,456Member
    TSB's video on GameSalad Channel: Scorekeeping, part 3, works with any numbers

    @};- MH
  • GLGAMESGLGAMES SingaporePosts: 988Member
    i have the timer running with display text, but is it also possible with a custom font display?
  • MotherHooseMotherHoose Posts: 2,456Member
    see above … :-B

    @};- MH
  • GLGAMESGLGAMES SingaporePosts: 988Member
    edited February 2012
    It's ok, i've solved it, been looking the whole thing in the wrong direction.
    I am trying to display the custom font correctly instead of the timer and it's now working thx to OST Demo and TSB timer demo.
    it's something like this for the benefit of those who want to know.



    floor(floor(( game.Timer %3600)/60)/10)..".png" (1st digit Min)
    floor((floor( game.Timer %3600)/60)%10)..".png" (2nd digit Min)
    floor(( game.Timer %60)/10)..".png" (1st digit Sec)
    floor( game.Timer %10)..".png" (2nd digit Sec)
    By combining both demos i was able to come out with this finally.
    And game.timer is just every 1 sec +1 to itself.
  • MotherHooseMotherHoose Posts: 2,456Member
    edited February 2012
    and, of course, knowing the needed expression for just seconds … might have helped … =))

    glad You solved it! … @GLGAMES

    @};- MH
  • JuggerJugger Posts: 238Member, PRO
    Hi, guys. Can anyone share a template?
  • mrpacogpmrpacogp Posts: 400Member
    edited November 2012
    Yes, a template of that maybe impressive....^^
    Nevermind, is too easy^^
  • mrpacogpmrpacogp Posts: 400Member
    I have a simple problem with math...
    for a countdown timer, maybe i set an attribute, game.timer 500 as integer.
    i have the template working with text plain, but, using the constrain attribute for self.image with "floor( game.Game Timer %10)..".png"" dont work
    countdown in 3 and 3 seconds. whats its the correct value?
  • famekraftsfamekrafts Posts: 834Member, BASIC
    I made a counter for my game, i made a minute custom font separate from second custom font. so there are 2 font actors for minutes and 2 for seconds, when seconds turn to 60, minutes become = minutes+1 and seconds become zero again. simple and worked.
  • mrpacogpmrpacogp Posts: 400Member
    Yes, i have that, but i need it with a countdown
    This is for count real time:
    floor(floor(( game.Timer %3600)/60)/10)..".png" (1st digit Min)
    floor((floor( game.Timer %3600)/60)%10)..".png" (2nd digit Min)
    floor(( game.Timer %60)/10)..".png" (1st digit Sec)
    floor( game.Timer %10)..".png" (2nd digit Sec)

    And i want to set, time to complete a level, ..500 sec
    And next the countdown, i can take the example, but when move time, countdown in 3 and 3 secons
  • mrpacogpmrpacogp Posts: 400Member
    I cant find a math to complete that, countdown time to image
    i have test alot of options of floor( game.Timer %10)..".png" (2nd digit Sec)
    ...
    If anyone go it maybe helpme..
  • mrpacogpmrpacogp Posts: 400Member
    Ok, the problem are on my scene attribute game time, i have create another countdown and now works fine
  • shark1505shark1505 Posts: 75Member
    By the way, you use constrain attribute, not change attribute as the behavior. It had me stumped for an hour.
This discussion has been closed.