• 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 Determining day and night

The code with ModelBehaviors is fine,
(When using Behaviors, instead, the block of code must go into the ModelInfo section)

So, if you have a "Night" node in your secret.gltf , that node should show only during night time

You said you modify a object .xml,
I hope you know that ModelBehaviors (or Behaviors) are supposed to be used inside a Simobject, that requires a special folder structure (they are not inside the modelLib)

Inviato dal mio Mi 9 Lite utilizzando Tapatalk
 
The code with ModelBehaviors is fine,
(When using Behaviors, instead, the block of code must go into the ModelInfo section)

So, if you have a "Night" node in your secret.gltf , that node should show only during night time

You said you modify a object .xml,
I hope you know that ModelBehaviors (or Behaviors) are supposed to be used inside a Simobject, that requires a special folder structure (they are not inside the modelLib)

Inviato dal mio Mi 9 Lite utilizzando Tapatalk
Oh, I didn’t know this. I actually copied the XML file from the Simobject sample code you had attached earlier and it looked like the ModelBehaviors was outside the ModelInfo section there. I’ll try putting it back in.

My object is inside a separate model library, I’m not sure if that helps? If you have more details I would appreciate it.

Also if you have any tips on how I could achieve hiding a group of Scenery objects (not just my own but generic ones added from Asobo libraries).
 
Oh, I didn’t know this. I actually copied the XML file from the Simobject sample code you had attached earlier and it looked like the ModelBehaviors was outside the ModelInfo section there. I’ll try putting it back in.

My object is inside a separate model library, I’m not sure if that helps? If you have more details I would appreciate it.

Also if you have any tips on how I could achieve hiding a group of Scenery objects (not just my own but generic ones added from Asobo libraries).
If you scroll up in this 3d, there is a tutorial about Simobject 😉
You can control only objects where you have the full source files (glTF bin XML)
 
If you scroll up in this 3d, there is a tutorial about Simobject 😉
You can control only objects where you have the full source files (glTF bin XML)
Thank you, I will try more things when I get back to my sim rig before asking more questions. By the way are you the mamu who created the solar panels mod?
 
If you scroll up in this 3d, there is a tutorial about Simobject 😉
You can control only objects where you have the full source files (glTF bin XML)
Allright, I created a SimObject, put the model in is as per your tutorial. I can put the SimObject in the airport now, but it appears all the time, the time of day doesn't seem to have an effect. I noticed that in Simvar Watcher there is no Simvar Name "TIME OF DAY" or anything similar, so I cannot test what the value is as in your tutorial.

After building the project, if I go to my Packages\<project name>\SimObjects\Airplanes\daat-secret\model\daat-secret.xml file, it came out like this:

Code:
<?xml version="1.0" encoding="utf-8"?>
<ModelInfo guid="{ebb99e88-a7b4-43da-b2d0-1d2c7dcc23f2}" version="1.1">
    <LODS>
        <LOD minSize="0" ModelFile="daat-secret.gltf"/>
    </LODS>
    <Behaviors>
        <Include ModelBehaviorFile="Asobo\Misc\SimObjects.xml"/>
        <Component ID="secret" Node="daat-secret">
            <Visibility>
            <Parameter>
                <Code> (E:TIME OF DAY, enum) 3 == if{ 1 } els{ 0 } </Code>
             </Parameter>
            </Visibility>
        </Component>
    </Behaviors>
</ModelInfo>

Note that I added the <Include> tag to see if it helps, but it does not.
My SimObject is in the Airplanes folder because that's what MSFS wanted it to be by default and it's a static aircraft so either way works for me, but I don't know if that has implications on the code. Initially I tried changing it to "Scenery" in the AssetDir and OutputDir directories in Inspector but that caused my SimObject to not appear in the list of packages when I select SimObjects under "object type" in the editor. If I just kept everything as default and changed all my files to "daat-secret" it was appearing and the object can be added, it just doesn't behave as intended.
 
Back
Top