1. #1
    Hp_venomZ's Avatar Senior Member
    Join Date
    Mar 2014
    Posts
    1,008

    need help...

    i was wondering if anybody knew how to calculate time on a board, if u don't understand what i mean, go play in the track moto madness, we can see in the background that their is a board that indicates the time your doing on the track.

    Plz tell me how!!!
    Share this post

  2. #2
    Lukeyy19's Avatar Member
    Join Date
    Mar 2014
    Location
    UK
    Posts
    449

    Re: need help...

    There's so many different ways dependant on how you want it to look, whether you want it live or just the final time etc... Even once you figure out what you need, it's going to be a pretty complicated process to make it work.

    How competent are you with all the logic stuff? Have you looked at the Editor Guides stickies at the top of the forum and watched all the tutorial videos?
    Share this post

  3. #3
    dasraizer's Avatar Senior Member
    Join Date
    Apr 2014
    Location
    UK, Isle of Wight
    Posts
    1,195

    Re: need help...

    that is quite complex and is based on math with logical checks to set visibility events on the segments of the display, you'll have to basically build yourself a clock.

    i'll walk you thought the decoding part of the game time, the filtering part will be based on these decoded numbers.

    the game time is in 60ths of a second (like most of the interval settings) and you'll need to decode this number.

    so we have 1 second = 60 ticks, 1 minute = 3600 ticks and as the game has a maximum of 30 minutes, this is good as we do not need to worry about hours,

    so if the game time is 5827 ticks this would be 1 minute 37 seconds and 7/60ths of a second, but to get that into minutes and seconds takes some maths and a handy function call floor, the one input operator holds the function floor.

    so 5827/3600=1.618

    so floor(1.618) = 1 , this gives the minutes as floor basically ignores the part after the decimal point.

    now to get the seconds

    take the minutes and multiply it by 3600 and subtract this from the original game time of 5827, so

    1*3600=3600

    5827-3600=2227

    now divide the 2227 by 60 so

    2227/60=37.1166 now floor this value and you get 37 which gives you the seconds

    now to get the 1/60ths of a second

    take the seconds 37 and multiply by 60 and subtract this from the 2227, so

    37*60=2220

    2227-2220=7 which is the 1/60ths of a second

    ok let me explain some of the fundamental numbers shown, the 3600 is made from the following 60seconds (a.k.a. 1 minute) multiplied by 60 (a.k.a. ticks per second), the next level is the seconds, this is simply 60 as each second holds 60 ticks, you could think of it being a base 60 number system.

    so now to decode the 1/60ths of a second to some more meaningful decimal number.

    take the 7 and divide by 60, this will convert it to the decimal fraction, but this needs to be displayed and to make this easier multiply this value by 1000 (when you understand this, just condense the /60*1000 part) so

    7/60=0.116666
    0.11666*1000=116.66, to make things easier floor this value, so its now 116.

    now doing the same as above this time using base 10 to decode

    116/100=1.16 floored = 1 or the 10th part of the decimal output

    multiply the 10th value (1) by 100 and subtract this from the start value of 116, so

    116-(1*100)=16

    divide this by 10 and floor it to get the 100ths value, so
    16/10=1.6 floored =1

    now multiply the 100th value by 10 and again subtract from the 16 above to get the 1000ths, so
    16-(1*10)=6

    after the decode you'll end up with

    1 37 1 1 6 , to display this use generic filtering to toggle on/off the visibility events of the segments based on these values.

    few, i hope this helps some and i've explained it well enough.

    edit:

    FYI the 5827 was made by

    (1*3600)+(37*60)+7=5827

    also i'll leave you to work out the full decode of the minutes and seconds, as this will work up to 9 minutes/seconds, as 10+minutes/seconds will need further decoding.
    Share this post

  4. #4
    Lukeyy19's Avatar Member
    Join Date
    Mar 2014
    Location
    UK
    Posts
    449

    Re: need help...

    Wow dasraiser, that is complicated, I'm glad you explained that so I didn't have to try and figure it out.

    dasraiser's method gives you an accurate clock that you can use to display the final time.

    in case that is not what you were after, and you wanted a live clock you could drive past and see it counting, I went down that method with my tutorial. It's not as accurate as dasraiser's but it counts in real time, and as such I wouldn't suggest letting the player see it before the game begins or after the finish line, I made it as an object for the background you can drive past.

    https://docs.google.com/drawings/d/1...CaslpPEog/edit

    I'm sure there are other easier or better ways to do this, but this is what I came up with, I haven't actually tested it in game but it should work.
    Share this post

  5. #5
    dasraizer's Avatar Senior Member
    Join Date
    Apr 2014
    Location
    UK, Isle of Wight
    Posts
    1,195

    Re: need help...

    i got to say lukeyy19, i wish i'd have thought of flip flop time keeping soo much simpler, kind of reminds me of those push button click counters.

    edit: you can also OPE the whole thing to new locations along the track.

    edit²: i wonder if the retargeter could shrink this! although it needs a couple of ticks to stabilise, i'll have a long hard on this.
    Share this post

  6. #6

    Re: need help...

    well the easy fix then would be to combine the 2
    lukeyys method for minutes and seconds

    and dasraisers for the 100ths
    you could just use a looping cds for it
    Share this post