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

SimObject visbility based on year / month

Messages
98
Country
spain
Hello everyone,
i'm having some issues with visibility in MSFS SimObjects. Essentially what i want to do, is show/hide an object by year. whats funny is that this worked perfectly well, but it broke before christmas (after an update, unless i did something terribly wrong and dont recall).
anyone see anything wrong with this code:
------------------
<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo version="1.1" guid="{a7e57515-27c1-4a27-80b3-fd22a273cd5d}">
<LODS>
<LOD MinSize="10" ModelFile="ATR-72.gltf"/>
</LODS>

<ModelBehaviors>
<Component ID="ATR-72" Node="atr-72">
<Visibility>
<Parameter>
<Code>(A:LOCAL YEAR, Number) 2007 &gt;= (A:LOCAL YEAR, Number) 2025 &lt;= and if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>
</Component>
</ModelBehaviors>


</ModelInfo>
---------------------------------------------

For general info, it was just "<Behaviors>", changing it doesnt seem to matter... :S
thanks for the help
ben
 
Hello everyone,
i'm having some issues with visibility in MSFS SimObjects. Essentially what i want to do, is show/hide an object by year. whats funny is that this worked perfectly well, but it broke before christmas (after an update, unless i did something terribly wrong and dont recall).
anyone see anything wrong with this code:
------------------
<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo version="1.1" guid="{a7e57515-27c1-4a27-80b3-fd22a273cd5d}">
<LODS>
<LOD MinSize="10" ModelFile="ATR-72.gltf"/>
</LODS>

<ModelBehaviors>
<Component ID="ATR-72" Node="atr-72">
<Visibility>
<Parameter>
<Code>(A:LOCAL YEAR, Number) 2007 &gt;= (A:LOCAL YEAR, Number) 2025 &lt;= and if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>
</Component>
</ModelBehaviors>


</ModelInfo>
---------------------------------------------

For general info, it was just "<Behaviors>", changing it doesnt seem to matter... :S
thanks for the help
ben


Hi maybe try this:


Code:
<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo version="1.1" guid="{a7e57515-27c1-4a27-80b3-fd22a273cd5d}">
    <LODS>
        <LOD MinSize="10" ModelFile="ATR-72.gltf"/>
    </LODS>
</ModelInfo>



<ModelBehaviors>
        <Component ID="ATR-72" Node="atr-72">
            <Visibility>
                <Parameter>
                    <Code>(E:LOCAL YEAR, Number) 2007 &gt;= (E:LOCAL YEAR, Number) 2025 &lt;= and if{ 1 } els{ 0 }</Code>
                </Parameter>
            </Visibility>
        </Component>
</ModelBehaviors>
 
hey, thanks for this. it still doesnt work. like i said, it was working perfectly before, but now, with your code and mine, it doesnt. i got 2 planes here that are supposed to appear, one up to 2006, the other after, and they just both appear, and nothing disappears when i change the year..
any more ideas?! :(
1614106764664.png
 
you are showing us two planes but only one <ModelBehaviors>
each aircraft must have its own ModelBehaviors
each one with its own visibility parameter
maybe you are not showing us the entire xml file?
What you wrote in the code means that the object ATR-72.gltf will only be visible from the years 2007 to 2025
and it appears to be written correctly (with E: )
 
Just tried the code. It works.
You known this must be in the SimObject folder?
many thanks for your reply. yes they are, here is my setup:
1614111335542.png

(ignore the fact theyre called "landmarks" or "jetway", i will change that)
is there an issue?
 
you are showing us two planes but only one <ModelBehaviors>
each aircraft must have its own ModelBehaviors
each one with its own visibility parameter
maybe you are not showing us the entire xml file?
What you wrote in the code means that the object ATR-72.gltf will only be visible from the years 2007 to 2025
and it appears to be written correctly (with E: )
thanks for your reply. these 2 are seperate simobjects each with its own cfg file.. so there is another :)
 
so it would all seem correct
now it is evident that the condition is not triggered
and your items are always visible
but the code looks correct :rolleyes:

is the node name Node="atr-72" right?

finally a stupid question: you load it into the scenario from the SimObjects list right....? 😊
 
haha yes i am. like i said, it worked before christmas, then stopped :oops:
i have no idea why... :s
also in case youre wondering what im doing, i want my airport to trigger an older generation of plane to appear as static scenery, and a newer from the year finnair started using them (dc-9s replaced by atrs o_O)
haha
 
great idea!
and I think it can be done easily....😇
but it is evident that your object behaves like a ScemeryObj and not as a SimObj...🧐
😉
 
great idea!
and I think it can be done easily....😇
but it is evident that your object behaves like a scenarioObj and not as a SimObj...🧐
😉
hm well i'm pretty new to this. i was just tinkering with it and it worked, then stopped. really have no idea what i'm doing wrong :s let me again try and also show you my setup..
 
check the node name. It must match the name of the mesh in blender (or software you use)
 
great idea!
and I think it can be done easily....😇
but it is evident that your object behaves like a ScemeryObj and not as a SimObj...🧐
😉
my asset groups in the assetdefinition file
1614114117016.png



my simobj folder structure and files
1614114149418.png

and the code is what you sent me :s
 
if the node name is incorrect, the condition does not trigger
probably your problem is that
yes, the node name must be the mesh name and not the gltf file name ;)
 
still nothing. used your code and mine, moved the modelbehaviours in and out of the modelinfo, changed the node name, nothing.. :(
 
Back
Top