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

MSFS20 Visibility

wow, it just clicked... i get the statements now. thank you! believe it or not i have a computer science degree, but i much mess with triangles than code :P
thanks a lot for this. ill get back to you!
Yes, your code is wrong. You need 3 "and" in the first condition as you are comparing 4 conditions and all 4 of those conditions need to be compared so it's condition 1 AND condition 2 AND condition 3 AND condition 4 which is 3 "and" to compare 4 conditions. You would write this as "and and and" instead of "and and"
'
In your second condition you need "|| and and " . || is the OR operator. As you are comparing the times and seeing if one OR the other is correct (if the time is later than 10pm OR earlier than 5pm). So you check if the time of day is one OR the other AND the year is greater than 2007 AND the year is less than 2025 so you would write this as "|| and and"
 
Yes, your code is wrong. You need 3 "and" in the first condition as you are comparing 4 conditions and all 4 of those conditions need to be compared so it's condition 1 AND condition 2 AND condition 3 AND condition 4 which is 3 "and" to compare 4 conditions. You would write this as "and and and" instead of "and and"
'
In your second condition you need "|| and and " . || is the OR operator. As you are comparing the times and seeing if one OR the other is correct (if the time is later than 10pm OR earlier than 5pm). So you check if the time of day is one OR the other AND the year is greater than 2007 AND the year is less than 2025 so you would write this as "|| and and"
this still doesn't work:

Code:
        <Component ID="ATR72_closed" Node="ATR72_closed">
            <Visibility>
                <Parameter>
                    <Code>(E:LOCAL YEAR, Number) 2007 &gt;= (E:LOCAL YEAR, Number) 2025 &lt;= (E:LOCAL TIME, Seconds) 81600 &gt;= (E:LOCAL TIME, Seconds) 18000 &lt;=  and and || if{ 1 } els{ 0 }</Code>
                </Parameter>
            </Visibility>
        </Component>

it disappears based on year but the time doesnt affect it.. :(
 
(E:LOCAL YEAR, number) 2007 >= (E:LOCAL YEAR, number) 2025 <= and (E:LOCAL TIME, seconds) 81600 >= (E:LOCAL TIME, seconds) 18000 <= or and if{ 1 } els{ 0 }
should work.
correction: ">=" has to be like "&gt;=" before as well as the "&lt;=" - sorry I thought you would recognise the main difference which is
part 1 of the statement - "(E:LOCAL YEAR, number) 2007 >= (E:LOCAL YEAR, number) 2025 <= and"
part 2 of the statement - (E:LOCAL TIME, seconds) 81600 >= (E:LOCAL TIME, seconds) 18000 <= or and if{ 1 } els{ 0 }
There is a nice (webpage) tool with which you can simulate RPN/RNP conversion and check the statement. You can find it on gitahub and is documented in the sdk documentation

https://docs.flightsimulator.com/ht...hsearch=Converting InFix To PostFix&ux=search (move to the very bottum)
 
Last edited:
(E:LOCAL YEAR, number) 2007 >= (E:LOCAL YEAR, number) 2025 <= and (E:LOCAL TIME, seconds) 81600 >= (E:LOCAL TIME, seconds) 18000 <= or and if{ 1 } els{ 0 }
Should work
so greater or equal signs work? i havent tested this yet but i feel a bit hopeless :s
 
this still doesn't work:

Code:
        <Component ID="ATR72_closed" Node="ATR72_closed">
            <Visibility>
                <Parameter>
                    <Code>(E:LOCAL YEAR, Number) 2007 &gt;= (E:LOCAL YEAR, Number) 2025 &lt;= (E:LOCAL TIME, Seconds) 81600 &gt;= (E:LOCAL TIME, Seconds) 18000 &lt;=  and and || if{ 1 } els{ 0 }</Code>
                </Parameter>
            </Visibility>
        </Component>

it disappears based on year but the time doesnt affect it.. :(
How did "|| and and" become "and and ||"?

You are writing in reverse polish notation. I know this is unintuitive but "|| and and" processes the || for the comparison between the local time, that result is then "and" with the 2025 year and that result is "and" with the 2007 year.

By changing the order of the operators what you have written is greater than 2007 OR less than 2025 and after 10pm and before 5pm.

Greater than and equal signs work in XML. But less than signs do not because they are part of the XML language. Notice how every element opens with a less than sign. That character is reserved and cannot be used. Personally, I use &gt; and &lt; simply because it saves me having to remember that only one of them works.
 
How did "|| and and" become "and and ||"?

You are writing in reverse polish notation. I know this is unintuitive but "|| and and" processes the || for the comparison between the local time, that result is then "and" with the 2025 year and that result is "and" with the 2007 year.

By changing the order of the operators what you have written is greater than 2007 OR less than 2025 and after 10pm and before 5pm.

Greater than and equal signs work in XML. But less than signs do not because they are part of the XML language. Notice how every element opens with a less than sign. That character is reserved and cannot be used. Personally, I use &gt; and &lt; simply because it saves me having to remember that only one of them works.
 
Could you give us the full code here? And is there an option to make it work with seasons (or specify specific months)?

upd: It's not exactly what I would have wanted, though. I would like the animation to be triggered at a certain time of day, but not through visibility, so that the object does not disappear.
 
Last edited:
I would appreciate a peer check on this xml code to hide an animated simObject at night.

I've tried multiple variations of the code without success and this is the last version that didn't work. The Include path line came from this thread but I tried with and without the line, The Component line is the unique name and the node is just the filename, again I've tried with and without. I've replaced ModelBehaviors with Behaviors as I understand ModelBehaviors is deprecated but tried both ways. The animation is exported from 3DS max using the Babylon exporter and is working well in the sim but I just cannot hid the damn thing.

best regards
Kev

<?xml version="1.0" ?>

<ModelInfo guid="{2d224228-455d-4ba8-941f-60c8cba71ff6}" version="1.1">

<LODS>

<LOD MinSize="0" ModelFile="pbk-walking.gltf"/>

</LODS>

<Animation guid="3615ef87-c8a2-47da-8edf-c31cabad3e60" name="walking" type="Standard" typeParam="Autoplay"/>

</ModelInfo>

<Behaviors>

<Include Path="Asobo\Misc\SimObjects.xml"/>

<Component ID="pbk-walking" Node="pbk-walking">

<Visibility>
<Parameter>
<Code>(E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>

</Behaviors>

This is the simObject I want to hide at night
 
After </Visibility> you need </Component> I think, to close that out.
 
After </Visibility> you need </Component> I think, to close that out.
I thought that fresh eyes looking at it would find the error I was chasing over 4 hours last night. Thank you very much for looking.

Added the </Component> line and it STILL DOESN'T WORK. My head is getting sore from banging it against a brick wall lmao

Kev

?xml version="1.0" ?>

<ModelInfo guid="{2d224228-455d-4ba8-941f-60c8cba71ff6}" version="1.1">

<LODS>

<LOD MinSize="0" ModelFile="pbk-walking.gltf"/>

</LODS>

<Animation guid="3615ef87-c8a2-47da-8edf-c31cabad3e60" name="walking" type="Standard" typeParam="Autoplay"/>

</ModelInfo>

<Behaviors>

<Include Path="Asobo\Misc\SimObjects.xml"/>

<Component ID="pbk-walking" Node="pbk-walking">

<Visibility>
<Parameter>
<Code>(E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>

</Component>

</Behaviors>
 
Kev, I offered Ben to have a short chat on discord which makes it easier to check your code online on your screen. He didn't buy it but feel free to contact me GuidoH#4520
 
I thought that fresh eyes looking at it would find the error I was chasing over 4 hours last night. Thank you very much for looking.

Added the </Component> line and it STILL DOESN'T WORK. My head is getting sore from banging it against a brick wall lmao

Kev

?xml version="1.0" ?>

<ModelInfo guid="{2d224228-455d-4ba8-941f-60c8cba71ff6}" version="1.1">

<LODS>

<LOD MinSize="0" ModelFile="pbk-walking.gltf"/>

</LODS>

<Animation guid="3615ef87-c8a2-47da-8edf-c31cabad3e60" name="walking" type="Standard" typeParam="Autoplay"/>

</ModelInfo>

<Behaviors>

<Include Path="Asobo\Misc\SimObjects.xml"/>

<Component ID="pbk-walking" Node="pbk-walking">

<Visibility>
<Parameter>
<Code>(E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>

</Component>

</Behaviors>
By the way, the coding is wrong...
You closed the <modelinfo> block too early. Move </ModelInfo> to the end
 
By the way, the coding is wrong...
You closed the <modelinfo> block too early. Move </ModelInfo> to the end
Thank you for the offer of help Guido :) I picked up the wrong placement of the </ModelInfo> myself from the SDK docs and tried it using the code below but it still isn't working :(

A lot of the examples on-line appeared to put the Behavior or ModelBehavior container outside the ModelInfo one but I've now gone with the SDK documented structure.

<?xml version="1.0" ?>

<ModelInfo guid="{2d224228-455d-4ba8-941f-60c8cba71ff6}" version="1.1">

<LODS>

<LOD MinSize="0" ModelFile="pbk-walking.gltf"/>

</LODS>

<Animation guid="3615ef87-c8a2-47da-8edf-c31cabad3e60" name="walking" type="Standard" typeParam="Autoplay"/>

<Behaviors>

<Include Path="Asobo\Misc\SimObjects.xml"/>

<Component ID="pbk-walking" Node="pbk-walking">

<Visibility>
<Parameter>
<Code>(E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>

</Component>

</Behaviors>

</ModelInfo>

For something that is relatively straight forward I'm amazed at how difficult I'm making it lol. I'd be happy to put up the whole project on-line if anyone wants to troubleshoot it

regards
Kev
 
Does this work?

XML:
<?xml version="1.0" encoding="utf-8" ?>

<ModelInfo  version="1.1" guid="{2d224228-455d-4ba8-941f-60c8cba71ff6}">

    <LODS>
        <LOD MinSize="0" ModelFile="pbk-walking.gltf"/>
    </LODS>

    <Animation guid="3615ef87-c8a2-47da-8edf-c31cabad3e60" name="walking" type="Standard" typeParam="Autoplay"/>

    <Behaviors>

        <Include Path="Asobo\Misc\SimObjects.xml"/>

        <Component ID="pbk-walking" Node="pbk-walking">
            <Visibility>
                <Parameter>
                    <Code>(E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and if{ 1 } els{ 0 }</Code>
                </Parameter>
            </Visibility>
        </Component>

    </Behaviors>

</ModelInfo>

Make sure you close out all the elements.
 
Does this work?

XML:
<?xml version="1.0" encoding="utf-8" ?>

<ModelInfo  version="1.1" guid="{2d224228-455d-4ba8-941f-60c8cba71ff6}">

    <LODS>
        <LOD MinSize="0" ModelFile="pbk-walking.gltf"/>
    </LODS>

    <Animation guid="3615ef87-c8a2-47da-8edf-c31cabad3e60" name="walking" type="Standard" typeParam="Autoplay"/>

    <Behaviors>

        <Include Path="Asobo\Misc\SimObjects.xml"/>

        <Component ID="pbk-walking" Node="pbk-walking">
            <Visibility>
                <Parameter>
                    <Code>(E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and if{ 1 } els{ 0 }</Code>
                </Parameter>
            </Visibility>
        </Component>

    </Behaviors>

</ModelInfo>

Make sure you close out all the elements.
Just compiling it now, 5 minutes. Other than the encoding="utf-8" in the header I don't see a difference between my latest version and the one you've posted but I'll try anything now lol

regards
Kev
 
Does this work?

XML:
<?xml version="1.0" encoding="utf-8" ?>

<ModelInfo  version="1.1" guid="{2d224228-455d-4ba8-941f-60c8cba71ff6}">

    <LODS>
        <LOD MinSize="0" ModelFile="pbk-walking.gltf"/>
    </LODS>

    <Animation guid="3615ef87-c8a2-47da-8edf-c31cabad3e60" name="walking" type="Standard" typeParam="Autoplay"/>

    <Behaviors>

        <Include Path="Asobo\Misc\SimObjects.xml"/>

        <Component ID="pbk-walking" Node="pbk-walking">
            <Visibility>
                <Parameter>
                    <Code>(E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and if{ 1 } els{ 0 }</Code>
                </Parameter>
            </Visibility>
        </Component>

    </Behaviors>

</ModelInfo>

Make sure you close out all the elements.
No success I'm afraid :( I've uploaded the source code for the whole project to my google drive if anyone has the time to troubleshoot it for me. I'll keep trying alternative code combination but my gut feeling is I've missed something elsewhere?

Google Drive https://drive.google.com/file/d/1DQF61U9ceK-0NDFgJk8AxQ4BFjuWcLJX/view?usp=sharing

Kev
 
Hi,

I use <ModelBehaviors> not <Behaviors>...

Stefan
Hi Stefan, I used to use ModelBehaviors but I found this in the latest SDK documents

<ModelBehaviors>​

The <Behaviors> element is how all new SimObject behaviors should be defined, but previously this was done using the <ModelBehaviors> element, like this:

<ModelInfo version=”1.0” guide=””> <!-- Model Info XML here --> </ModelInfo> <ModelBehaviors> <!-- ModelBehaviors XML here --> </ModelBehaviors>
This format has been deprecated for the [model].xml files and should not be used for new projects. However, everything described in this section of the documentation can be applied equally to <ModelBehaviors> as it can to <Behaviors>.

Having said that I haven't got anything else so it's worth a shot :)

Kev
 
Last edited:
Back
Top