User Tag List

Results 1 to 4 of 4

Thread: Need help creating a stopwatch!

  1. #1
    No Products Registered

    Join Date
    Nov 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help creating a stopwatch!

    I need some help on how to create a stopwatch that shows hundredths. The Date & Time object only shows hours, minutes and seconds. Not hundredths. Can someone please help me?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Need help creating a stopwatch!

    Keep track of which frame number it is.

    Hundreds: (Frame Number*1.0/Frame Rate) mod 1*100
    Seconds: (Frame Number/Frame Rate) mod 60
    Minutes: (Seconds/60) mod 60
    Hours: Minutes/60

    If you want an anglog'ish stopwatch, you can use the values you get to set the angle of some active objects to act as hands.

  3. #3
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,544
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Need help creating a stopwatch!

    the game only elapses at the maximum framerate you have set it to.

    If you have 50 frames per second, the smallest increment of time you could adjust is by 0.02 seconds. However, you can read the internal timer in terms of thousandths since then start of the frame by using "timer" in the expression editor.

    This is inside the expression editor, under the "Timer" object. The very first property it has


    To get hundredths from this, just divide by 10. Keep in mind this value is cumulative from the start of the frame and won't just be the "thousandth" place digit, unlike "time in seconds" and so on. If you want to retrieve just the last few digits, use the "Mod" function.

    For example, the line:

    "timer mod 1000" would give you the thousandths places

    or

    "(timer / 10) mod 100" would give you the hundredths places

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Need help creating a stopwatch!

    I recommend my method if you're doing e.g. a speedrun or race timer. First, there's no possible reason for accuracy greater than the game's FPS if you're timing something that happens in the game itself. You don't need accuracy greater than 0.02 seconds if nothing happens in between. Second, if by some reason there's a latency caused by e.g. a CPU spike due to something in the game or some scheduled application start or auto-update, you want the stopwatch to slow down to the speed the game is currently running in. If you're using a timer that's not frame based, you can actually get a worse score because there were a latency.

    Just note that I didn't mean you should get the framerate via the FrameRate expression, that'll produce dodgy results if the framerate changes during gameplay due to CPU usage. You should just use a constant that's equal to the game's default framerate.

Similar Threads

  1. Stopwatch
    By Skyhunter in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 7th March 2013, 04:15 AM
  2. Date & Time Stopwatch help
    By kungsangun in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 23rd June 2010, 10:28 PM
  3. Help with creating an app...
    By GabSt in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 9th October 2008, 12:19 AM
  4. Stopwatch and Fastloops
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 26th January 2008, 04:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •