• 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

Ah ok thanks. should probably read the sdk documentation more often;)
All I can do is give you one of my xml which is working. Maybe something is weong with your node name?
XML:
<?xml version="1.0" ?>



    
    <ModelInfo guid="{f3c59f69-a2a8-443b-aba3-dfe6b6ec9ee7}" version="1.1">

        <LODS>

            <LOD MinSize="0" ModelFile="steffhundEND.gltf"/>

        </LODS>

        <Animation guid="f111307b-0e32-4e24-8a77-9e4d21d6a781" name="Action" type="Standard" typeparam="AutoPlay" typeparam2="Action"/>

    </ModelInfo>
    
    
    
    
    <Behaviors>

<Component ID="hund" Node="hund">
<Visibility>
<Parameter>
 <Code>(E:LOCAL TIME, Seconds) 36000 &gt;= (E:LOCAL TIME, Seconds) 64800 &lt;= and (A:AMBIENT PRECIP STATE, mask) 3.0 &lt; and (E:Time of Day, enum) 2 &lt; and if{ 1 } els{ 0 } </Code>
</Parameter>
</Visibility>
</Component>

</Behaviors>
 
What's in the zip doesn't contain the xml-code that You showed us here.
you should find pbk-walking.xml in this folder \Wadi Rum-PZ60\PackageSources\SimObjects\Landmarks\pbk-walking\model Guido. The download is the source code for the whole project as far as I've taken it. I did remove the Packages and _PackageInt folders

Kev
 
i've posted this in antother 3d as long as the source code and a video

at Asobo they said the right thing,
first the ModelInfo, then the ModelBehaviors

therefore, in your code, after the LODS section, you need to close the ModelInfo, but you are closing it at the end of the file, thus, it is not working!



<ModelInfo version=”1.0” guide=””> <!-- Model Info XML here --> </ModelInfo> <ModelBehaviors> <!-- ModelBehaviors XML here --> </ModelBehaviors>

Code:
<?xml version="1.0" ?>



    <ModelInfo version="1.1" guid="{ad5dde0c-89ed-4c5d-398f-724796ef3eab}">
        <Animation guid="fa05e40c-090c-43eb-85bc-825d1e041540" name="ball" type="Standard" typeParam="Autoplay"/>
        <LODS>

            <LOD MinSize="0" ModelFile="kidsPlaying.gltf"/>


        </LODS>

</ModelInfo>


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


    </ModelBehaviors>
 
Ah ok thanks. should probably read the sdk documentation more often;)
All I can do is give you one of my xml which is working. Maybe something is weong with your node name?
XML:
<?xml version="1.0" ?>



   
    <ModelInfo guid="{f3c59f69-a2a8-443b-aba3-dfe6b6ec9ee7}" version="1.1">

        <LODS>

            <LOD MinSize="0" ModelFile="steffhundEND.gltf"/>

        </LODS>

        <Animation guid="f111307b-0e32-4e24-8a77-9e4d21d6a781" name="Action" type="Standard" typeparam="AutoPlay" typeparam2="Action"/>

    </ModelInfo>
   
   
   
   
    <Behaviors>

<Component ID="hund" Node="hund">
<Visibility>
<Parameter>
<Code>(E:LOCAL TIME, Seconds) 36000 &gt;= (E:LOCAL TIME, Seconds) 64800 &lt;= and (A:AMBIENT PRECIP STATE, mask) 3.0 &lt; and (E:Time of Day, enum) 2 &lt; and if{ 1 } els{ 0 } </Code>
</Parameter>
</Visibility>
</Component>

</Behaviors>
Hi Stefan,

in this line <Component ID="hund" Node="hund"> is the Node a real node or just the name of the model file? In my case the model animation was exported from 3DS Max and doesn't have a node as such so I used the filename for Component and Node values.

Kev
 
i've posted this in antother 3d as long as the source code and a video

at Asobo they said the right thing,
first the ModelInfo, then the ModelBehaviors

therefore, in your code, after the LODS section, you need to close the ModelInfo, but you are closing it at the end of the file, thus, it is not working!



<ModelInfo version=”1.0” guide=””> <!-- Model Info XML here --> </ModelInfo> <ModelBehaviors> <!-- ModelBehaviors XML here --> </ModelBehaviors>

Code:
<?xml version="1.0" ?>



    <ModelInfo version="1.1" guid="{ad5dde0c-89ed-4c5d-398f-724796ef3eab}">
        <Animation guid="fa05e40c-090c-43eb-85bc-825d1e041540" name="ball" type="Standard" typeParam="Autoplay"/>
        <LODS>

            <LOD MinSize="0" ModelFile="kidsPlaying.gltf"/>


        </LODS>

</ModelInfo>


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


    </ModelBehaviors>
Hiya,

that's how my original code looked with the ModelBehaviors container external to the ModelInfo container.

However this structure is straight from the latest SDK documents and puts the <Behaviors> container inside the <ModelInfo>
<?xml version="1.0" encoding="UTF-8"?>
<ModelInfo version="1.0" guid="<!-- GUID HERE -->"> <!-- General Model XML Here --> <Behaviors> <Component ID="Some_Unique_Id" Node="Node_Name_To_Hide_Here"> <Visibility> <Parameter> <Sim> <Variable>STALL WARNING</Variable> <Units>bool</Units> </Sim> </Parameter> </Visibility> <Component> </Behaviors> </ModelInfo>

Now that some other errors have been found it will be worth trying that structure again.

Kev
 
I think Node="root" may work. Look at the nodes section of your glTF file and the primary node is named "root"
This works for me:

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

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

    <LODS>
        <LOD MinSize="0" ModelFile="AngryGretchen.gltf"/>
    </LODS>

    <Animation guid="8cdafe5e-8bab-4164-b4d2-33dc9f24fb02" name="mixamo.com" type="Standard" typeparam="AutoPlay" typeparam2="mixamo.com"/>

    <Behaviors>

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

        <Component ID="AngryGretchen" Node="RootNode">
            <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>

And my main node is named "RootNode".

VisibilityAngryGretchen.zip
 
Last edited:
1635617445882.png

This shows your problem. The node name is not valid. If you use blender, the name needs to be in the following window
1635617568697.png

In my case, my node name is SpotpaleN so use your unique name in your blender and your xml file (pbk-walking)
 
View attachment 77804
This shows your problem. The node name is not valid. If you use blender, the name needs to be in the following window
View attachment 77805
In my case, my node name is SpotpaleN so use your unique name in your blender and your xml file (pbk-walking)
That is some detective work Guido I would never of spotted that. Looking in the gltf file it's showing the name as root that rhumbaflappy suggested looking for. The animation has been exported from 3DS Max using the Babylon exporter, as blender is very limited using bones/armatures so I'm not sure where to look for, or set, that information in 3DS Max.

I tried using Node="root" using the code above with the Behavior container both inside and outside the ModelInfo container without success. Looks like I need to step back abit and revisit the animation in 3DSMax to find the Node

onward and upward !
Kev
 
YOU R WRONG it works fine.
This is the code that works with your model:
<?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"/>

</ModelInfo>

<ModelBehaviors>

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

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

</ModelBehaviors>
 
No walking of your two moon walkers during night hours
By the way this is a better coding for day and night as it will work through the whole year...
(E:TIME OF DAY, Enum) 1 == if{ 0 } els{ 1 }
 
That is some detective work Guido I would never of spotted that. Looking in the gltf file it's showing the name as root that rhumbaflappy suggested looking for. The animation has been exported from 3DS Max using the Babylon exporter, as blender is very limited using bones/armatures so I'm not sure where to look for, or set, that information in 3DS Max.

I tried using Node="root" using the code above with the Behavior container both inside and outside the ModelInfo container without success. Looks like I need to step back abit and revisit the animation in 3DSMax to find the Node

onward and upward !
Kev
1635619676986.png

That's what you used in 3DS
 
To close out my saga of woe. I've finally got it working correctly and I can continue putting together my team on Mars :) Thank you all for your contributions and interest.

Kev
FWIW this code works correctly after exporting the model from 3DS Max using the Babylon exporter. It is important to name the Node correctly using the info in the model.

Code:
<?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"/>

</ModelInfo>

    <ModelBehaviors>

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

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

    </ModelBehaviors>
 
Last edited:
good morning, could someone help me.
I created a hangar with animation, where the doors open and closewith with the GuidoH (thanks very much) .
My problem starts when I add a sound of this door opening.
The code I used refers to LocalVar , where the sound is played correctly when opening the door. however this sound when we return the yoke to its place the sound in the reproduction because it understands that it should only be reproduced when we remove the yoke.
How can I write this code so that the sound plays in both directions of the animation (open and closed)down the soundai.xml code I wrote . It works and plays the sound added via Wwise. Sorry for the writing errors because I use google translator to communicate.

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

<SoundInfo Version="0.1">

<WwisePackages>
<MainPackage Name="Jamilzeira_Curitiba_Sounds"/>
</WwisePackages>

<SimVarSounds>

<Sound WwiseEvent="Porta_Hangar" WwiseData="true" FadeOutType="2" FadeOutTime="1" LocalVar="XMLVAR_YokeHidden2" Units="BOOLEAN" Continuous="False">
<Range LowerBound="1" />
</Sound>
</SimVarSounds>

</SoundInfo>
 
I found the solution where the sound is reproduced in both directions!!!
it was just removing the <Range LowerBound="1" /> that the audio plays in both directions, as LowerBound gave conditions only when the yoke was removed. Below the code for those who need it. Hug


?xml version="1.0" encoding="utf-8" ?>

<SoundInfo Version="0.1">

<WwisePackages>
<MainPackage Name="Jamilzeira_Curitiba_Sounds"/>
</WwisePackages>

<SimVarSounds>

<Sound WwiseEvent="Porta_Hangar" WwiseData="true" FadeOutType="2" FadeOutTime="1" LocalVar="XMLVAR_YokeHidden2" Continuous="False">

</Sound>
</SimVarSounds>

</SoundInfo>
 
Last edited:
This is a great topic.

I am trying to create a custom deployable lighting consisted of lanterns that is being used in an airfield, by pilot demand. Therefore I would like to set NAV2 as a condition but for testing purposes I am using XPDR code as it is more simple to hande.
For some reason I cannot manage to get the object to show, altough the animation indeed gets triggered by the XPDR code as shown in the folloing picture:
1643469455509.png



This is the code I use:

<?xml version="1.0" encoding="utf-8"?> <ModelInfo guid="{f6f1120f-e2fe-461f-9c6e-6b3c27d5404a}" version="1.1"> <LODS> <LOD MinSize="0" ModelFile="ColemanLanternXPDR.gltf"/> </LODS> <Behaviors> <Include Path="Asobo\Misc\SimObjects.xml"/> <Component ID="ColemanXPDR" Node="node0"> <Visibility> <Parameter> <Code>(A:TRANSPONDER CODE:1,number) 1000 == if{ 1 } els{ 0 }</Code> </Parameter> </Visibility> </Component> </Behaviors> </ModelInfo>

I set XPDR code 1000 to trigger the model visibility, and it looks like it works and the simobject is loaded in MSFS, but the model won't appear.
The strange thing is that by using this line (E:LOCAL TIME, Seconds) 36000 &gt;= (E:LOCAL TIME, Seconds) 64800 &lt;= and if{ 1 } els{ 0 } I manage to trigger the visibility by adjusting the simulator time.

Any ideas?
 
The SDK Documentation says something about the transponder code requiring an "octal number":

msfs_sdk_octal_number_transponder_code.jpg

Maybe it's because your transponder code recipe isn't working.
 
No luck with this code either:

<?xml version="1.0" encoding="utf-8"?> <ModelInfo guid="{f6f1120f-e2fe-461f-9c6e-6b3c27d5404a}" version="1.1"> <LODS> <LOD MinSize="0" ModelFile="ColemanLanternXPDR.gltf"/> </LODS> <Behaviors> <Component ID="ColemanXPDR" Node="node0"> <Visibility> <Parameter> <Code>(A:LIGHT LANDING,Bool) 1 == if{ 1 } els{ 0 }</Code> </Parameter> </Visibility> </Component> </Behaviors> </ModelInfo>
 
So apparantly Environmental variabls are working, this code is working when the day is Wedensday:

[/U] <?xml version="1.0" encoding="utf-8"?> <ModelInfo guid="{f6f1120f-e2fe-461f-9c6e-6b3c27d5404a}" version="1.1"> <LODS> <LOD MinSize="0" ModelFile="ColemanLanternXPDR.gltf"/> </LODS> <Behaviors> <Component ID="ColemanXPDR" Node="node0"> <Visibility> <Parameter> <Code>(E:LOCAL DAY OF WEEK,number) 3 == if{ 1 } els{ 0 }</Code> </Parameter> </Visibility> </Component> </Behaviors> </ModelInfo> [U]
 
I think the A variables will only pertain to the simobject... not to the User Aircraft.
 
Back
Top