plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

We prepared 3 new YouTube tutorials about Audio! They are available here.
You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.

Please take a moment to read the platform’s guidelines before you get started!


question

Photosbykev avatar image
Photosbykev asked Photosbykev answered

SimObject visibility timing errors

Hi,

I'm working on a number of simObjects animations that have their visibility turned on or off depending on the time of day. Typically the schedule is on the hour or on the 1/2 hours.

The animation duration is 100 seconds (3000 frames) and I only want the animation to be visible for this length of time to prevent it looping.

I'm using this code to control the visibility, however the sim doesn't always turn the animation visibility on at precisely 01:00 or 02:00 etc. Instead it can be upto 90 seconds, or more, late. When this delay occurs the animation starts at the beginning but gets turned off after 10 seconds (100 seconds - delay) because the visibility 'window' is only 100 seconds and the timing for turning the visibility off 100 seconds after the hour start appears to be very precise.

Is this a know problem or is there a workaround for it in the code?

Code snippet

<ModelBehaviors>

<Include ModelBehaviorFile="Asobo\Generic\FX.xml"/>

<Component ID="Launch-schedule" Node="starship">

<Visibility>

<Parameter>

<Code>(E:LOCAL TIME, seconds) 3600 % 0 &gt;= (E:LOCAL TIME, seconds) 3600 % 100 &lt;= and</Code>

</Parameter>

</Visibility>

</Component>

</ModelBehaviors>

The animation is working really well but I'm struggling with the timing.



animation
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

1 Answer

·
Photosbykev avatar image
Photosbykev answered

Further testing using standard coding like

<!--
Rocket starts 10:00:00 Rocket stops 10:01:40
Engines start 10:00:10 Engines stop 10:01:40
-->

<Include ModelBehaviorFile="Asobo\Generic\FX.xml"/>

<Component ID="Launch-schedule" Node="starship">

<Visibility>

<Parameter>

<Code>(E:LOCAL TIME, seconds) 36000 &gt;= (E:LOCAL TIME, seconds) 36100 &lt;= and if{ 1 } els{ 0 }</Code>

</Parameter>

</Visibility>

</Component>

and the rocket visibility start is varying from 15 seconds late to over 90 seconds late !

The code to start/stop the smoke animation on the launch pad is using very similar code and seems to be very precise.

https://youtu.be/dpXqGgunzIw

very frustrating behaviour

Kev

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.