• 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.

Any way to make an object move (or rotate) ONLY at specific times?

Messages
288
Country
unitedstates
I have a rotating beacon that I made which sits on top of the tower at KOCF. This beacon rotates and has its own "light" which translates into the MSFS beacon light when pulled far enough away during periods of "night". The "light" portion of it ONLY comes on at night, BUT the beacon rotates 24 / 7 and looks odd rotating during the daylight hours.

Is there any way I can get it to rotate ONLY at "night" (or when the beacon would start "on")? Would also be awesome if it would rotate and light up during IFR conditions as in real life, day or night, but that may be too much to ask for.

Any help / advice is always welcome!

TB2
 

Attachments

  • beacon.jpg
    beacon.jpg
    120.6 KB · Views: 25
You could try something like this:
XML:
<ModelInfo>
    <Animation name="YOUR ANIMATION NAME" guid="{YOUR ANIMATION GUID}" />
    
    <Behaviors>
        <Behavior Name="BeaconController">
            <Animation>
                <Name>YOUR ANIMATION NAME</Name>
                <Guid>{YOUR ANIMATION GUID}</Guid>
                <Parameter>
                    <Script>
                        (A:TIME OF DAY, hours) 6 &gt; 18 &lt; or
                        (A:VISIBILITY, meters) 1000 &lt; or
                    </Script>
                </Parameter>
                <Lag>0</Lag>
            </Animation>
        </Behavior>
    </Behaviors>
</ModelInfo>

(A:TIME OF DAY, hours) 6 &gt; 18 &lt; or (Lights should be off between 6AM and 6PM in a clear day...or)
(A:VISIBILITY, meters) 1000 &lt; or (Light should come in visibility is less than 1000M, even if it's day)

Let me know if this helps!
 
You could try something like this:
XML:
<ModelInfo>
    <Animation name="YOUR ANIMATION NAME" guid="{YOUR ANIMATION GUID}" />
   
    <Behaviors>
        <Behavior Name="BeaconController">
            <Animation>
                <Name>YOUR ANIMATION NAME</Name>
                <Guid>{YOUR ANIMATION GUID}</Guid>
                <Parameter>
                    <Script>
                        (A:TIME OF DAY, hours) 6 &gt; 18 &lt; or
                        (A:VISIBILITY, meters) 1000 &lt; or
                    </Script>
                </Parameter>
                <Lag>0</Lag>
            </Animation>
        </Behavior>
    </Behaviors>
</ModelInfo>

(A:TIME OF DAY, hours) 6 &gt; 18 &lt; or (Lights should be off between 6AM and 6PM in a clear day...or)
(A:VISIBILITY, meters) 1000 &lt; or (Light should come in visibility is less than 1000M, even if it's day)

Let me know if this helps!
Is this psedo code or AI?
Afaik, A: VISIBILITY doesn't exist

(There is AMBIENT VISIBILITY but is useless)
Also the <Script> and <Guid> tags don't exist
 
I have a rotating beacon that I made which sits on top of the tower at KOCF. This beacon rotates and has its own "light" which translates into the MSFS beacon light when pulled far enough away during periods of "night". The "light" portion of it ONLY comes on at night, BUT the beacon rotates 24 / 7 and looks odd rotating during the daylight hours.

Is there any way I can get it to rotate ONLY at "night" (or when the beacon would start "on")? Would also be awesome if it would rotate and light up during IFR conditions as in real life, day or night, but that may be too much to ask for.

Any help / advice is always welcome!

TB2
I have always used a model with two nodes,
One with the static mesh, the other one with the animation

And swap the visibility of the nodes according to the conditions

A snippet showing the emissive also to turn on and off the beacon , off course add a component with a node for your static mesh

XML:
<Component ID="lidl-xmasLights" Node="lidl-xmasLights">
    <Visibility>
        <Parameter>
            <Code>
                (E:LOCAL DAY OF YEAR, Number) 342 &gt; (E:LOCAL DAY OF YEAR, Number) 7 &lt; or if {1} els {0}
            </Code>
        </Parameter>
    </Visibility>
</Component>


<Component ID="lidl-xmasLights-lamps" node="lidl-xmasLightsLamps">
      <UseTemplate Name="ASOBO_GT_Material_Emissive_Code">
                <EMISSIVE_CODE>
                   (E:ZULU TIME, seconds) 2 % 0.5 &gt; if{ 10 } els{ 0.05 }
                </EMISSIVE_CODE>
            </UseTemplate>
</Component>


It should be possible to play a loop animation using ANIMATION DELTA TIME ,following is NOT TESTED

XML:
<Component ID="beacon" node="beacon">
      <UseTemplate Name="ASOBO_GT_Anim_Code">
        <ANIM_NAME>rotatingBeacon</ANIM_NAME>
        <ANIM_CODE>(E:TIME OF DAY,enum) 3 == if{ (A:ANIMATION DELTA TIME, seconds) 100 * } els { 0 }</ANIM_CODE>
        <ANIM_LENGTH>100</ANIM_LENGTH>
        <ANIM_WRAP>1</ANIM_WRAP>
        <ANIM_DELTA>1</ANIM_DELTA>
      </UseTemplate>
    </Component>
 
Wow! Great replies, and I'll get to it (relatively) soon, BUT, WHICH FILE DO I EDIT / MODIFY?? Is it the ".xml" file that includes the animation and LOD information for that object? (I would think so,). Or am I creating a new .xml file and it gets compiled when I compile everything else?

(How did you guys add the xml files to your replies as shown above???)

I can get the job done, but I'm ignorant as to WHERE to go to get the job done! LOL!!!

Thanks! I'm sure there will be other questions as I progress. This isn't happening overnight, so be patient with me please.

TB2
 
Last edited:
Wow! Great replies, and I'll get to it (relatively) soon, BUT, WHICH FILE DO I EDIT / MODIFY?? Is it the ".xml" file that includes the animation and LOD information for that object? (I would think so,). Or am I creating a new .xml file and it gets compiled when I compile everything else?

(How did you guys add the xml files to your replies as shown above???)

I can get the job done, but I'm ignorant as to WHERE to go to get the job done! LOL!!!

Thanks! I'm sure there will be other questions as I progress. This isn't happening overnight, so be patient with me please.

TB2
Uhm

Let me introduce the to the world of Simobjects
(You will need to know to accomplish your task)

 
I have a rotating beacon that I made which sits on top of the tower at KOCF. This beacon rotates and has its own "light" which translates into the MSFS beacon light when pulled far enough away during periods of "night". The "light" portion of it ONLY comes on at night, BUT the beacon rotates 24 / 7 and looks odd rotating during the daylight hours.

Is there any way I can get it to rotate ONLY at "night" (or when the beacon would start "on")? Would also be awesome if it would rotate and light up during IFR conditions as in real life, day or night, but that may be too much to ask for.

Any help / advice is always welcome!

TB2

This reminds me of the rotating Beacon at KCGX Meigs in Chicago.

It rotates day and night, reflects "white" on nearby objects, but has no light flash or beam, although the glTF shows 59 AttachPoint lights.

MSFS_2020_KCGX_Rotating_Beacon_1.jpg


[MSFS-2020_Packages]\Official\OneStore\microsoft-airport-kcgx-meigs-field\scenery\Microsoft\MeigsField\ModelLib.bgl > Object 23/99

MSFS_2020_KCGX_Rotating_Beacon_MCX_Info.jpg


MSFS_2020_KCGX_Rotating_Beacon_MCX_Attached_Objects.jpg


I used to have the issue of MSFS-2020 airport rotating beacons aliased as flashing "bogus" airport static beacons not showing a Green flash from the lens unless I had "Bloom" enabled in MSFS' Graphic settings menu; this was later fixed by Asobo ~ 2 years ago.

It did reflect "Green" on nearby objects, but there was no Green flash from the lens (until it was 'fixed').

It would be good to learn how to 'fix' the 24 Hour rotation and add the missing light beams on such objects since Asobo does not recognize this is an essential feature that should work properly in a "Flight Simulator".

Many thanks to Federico for sharing some of his insights on these types of 3D model enhancements in MSFS. :)

GaryGB
 
Last edited:
Is this psedo code or AI?
Afaik, A: VISIBILITY doesn't exist

(There is AMBIENT VISIBILITY but is useless)
Also the <Script> and <Guid> tags don't exist

So, I take it this code from Swan-UK is bogus? Shame! It looks straightforward and easy for me to understand it and “see” what’s going on.

The other codes you provided, perhaps I’m too exhausted, but I’ll have to dig into that one. Harder for me to understand and “convert” to my unique needs.

Using a static and dynamic model sounds intriguing. If I can get the code right that may be my answer.

My existing beacon works perfectly as far as lighting up, projecting beams, rotating,…. I used a trick of hiding the “stock” white/green beacon “light” inside of my rotating beacon. That way up close, my beacon is visible and doing things beacons do. When pulled far enough away from the airport, the model (naturally) disappears and the stock MSFS beacon light is visible from long distances. The video on Simobjects is interesting, but not sure it meets this particular need unless I missed something.

If anyone’s curious, look for KOCF on flightsim.to. Download it. You won’t be disappointed.

I may have questions!

Thanks!

TB2
 
Hi,

Your need is to make something when a condition is met (animation at specific times)

In MSFS, the only way to constantly check any condition at runtime is within a Simobject

So you must wrap your beacon in a Simobject

In my video it is explained how to do so
Using two different meshes (nodes)
Because every mesh has its visibility checked against a condition, it perfectly fits your basically

Basically in the code, instead of a reference to the wind like in the video, use the time of the day (where 0 is dusk, 1 is day, 2 is dawn and 3 is hight) as a variable


XML:
<Component ID="beaconOn" Node="beaconOn">
    <Visibility>
        <Parameter>
            <Code>
                (E:TIME OF DAY, enum) 1 != if {1} els {0}
            </Code>
        </Parameter>
    </Visibility>
</Component>

<Component ID="beaconOff" Node="beaconOff">
    <Visibility>
        <Parameter>
            <Code>
                (E:TIME OF DAY, enum) 1 == if {1} els {0}
            </Code>
        </Parameter>
    </Visibility>
</Component>
 
Is this psedo code or AI?
Afaik, A: VISIBILITY doesn't exist

(There is AMBIENT VISIBILITY but is useless)
Also the <Script> and <Guid> tags don't exist
Pseudo code. A rough idea.

Visibility condition could be gathered by a custom WASM module... I make my own variables. Sorry for misunderstanding.
 
Pseudo code. A rough idea.

Visibility condition could be gathered by a custom WASM module... I make my own variables. Sorry for misunderstanding.
Interesting!!
Are you using an API to external weather source? Afaik it is impossible gather such info from the game itself because Meteoblue wouldn't be agree, maybe they changed something?
 
Back
Top