• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX Miliseconds on a clock

Messages
92
Country
poland
Hi.
I'm working on a 3d gauge - a clock and I want to add a 4th hand showing millisecond (or any other parts of a second).

I tried to use this code:
<Code>(E:LOCAL TIME, second) flr 60 % 5 *</Code>
and add animation of 60 rotations of the hand in animation length, but it looks like the needle stays on 0.

From movement of seconds hand (<Code>(E:LOCAL TIME, second) flr 60 %</Code>) I concluded, that that code gives only full seconds and cannot give it's parts (in this form it changes by 5 every 1 second and not by 1 every 1/5 second).

Is there other way to get seconds parts, or maybe I screwed up something and it should work, but I'm simply dumb.

Thanks for any ideas.
 
And you can then use that to increment the local seconds value, if needed.
 
I've used both
<Code>(P:Absolute time,seconds)</Code>
and
<Code>(P:Absolute time,seconds) flr 60 % 5 *</Code>
- the needle still on 0.
 
(E:LOCAL TIME, seconds) 60 * 60 % will get you there and will return 0 to 60 based on milliseconds from 0 to 1000 (tested and it works for me).

First this multiplies local time by 60 which puts it into your range of keyframes. Then takes a modulus of 60. Modulus is equivalent to dividing by 60 and keeping the remainder. So 113.56 60 % = 53.56.

If you wanted to have the plain milliseconds then you would do:

(E:LOCAL TIME, seconds) 1000 * 1000 %

which would return a value between 0 and 1000 with that value being the number milliseconds. You could then divide this by 16.66666 to get a range of 0 to 60 for keyframes. Or you could use the code at the top which does the same thing.

Be aware that in my experience I have found the time variables are only updated 18 times per second. If you want greater precision you will need to use C++.
 
If I recall, E:LOCAL TIME, seconds is only integer seconds Ant. That's why I suggested P:ABSOLUTE TIME, seconds

Edit...I see Mellin's test shows otherwise.
 
Last edited:
Thank you!
(E:LOCAL TIME, seconds) 5 * 60 % worked best for me (300 frames - 60 rotations by 5 frame each)
Thank for the effort, everyone who tried to help!
 
Back
Top