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

Hello all,
Really great post !
I search to do something like described here but not for an objet but a polygon .
I want that a small river have water when it is raining only .
Do you think it is something possible ?
Thanks
Kind regards
 
The code structure is slightly different in the case of 'Model Behaviours'. Firstly, the custom code for any simobject needs to go in a separate <ModelBehaviours> tag within the .XML and not within the <ModelInfo> tag. Secondly, The 'node' name is missing which defines exactly which part will use the code. Try with the attached code and see if it helps. Just replace the text in red with your required conditions. PS: I haven't tried this for visibility conditions, but it's working for other purposes and it should work here too.


XML:
<ModelBehaviors>
  
        <Component ID="Any Name of your choice" Node="3ds max object name">
            <Visibility>
                <Parameter>
                    <Code>***Insert Code here***</Code>
                </Parameter>
            </Visibility>
        </Component>
  
</ModelBehaviors>
Hi :)
do you think 3ds max is mandatory?
I use blender and if i use the name of my (blender) object
the Node is not recognized
and <Visibility> doesn't work
and I see both objects (should only see one according to the wind direction)
the console gives me this error:
Attempted to Create A Visibilty without a valid Node Reference. Ignored

is there anyone who can confirm that this works if using blender or can it be an issue of Blender2MSFS?

;)
 
Hi,
Sorry for my poor english, but I think that Node="3ds max object name" is not the best description in this case.

When you edit with MCX your object, you can read via the icon "Object information", two datas:
- the GUID of the object,
- the name of the object.

The name is the information to use to define the Node. => Node= "MCX object name" is more apropriate in my own opinion.
So you can use 3DS or Blender without any trouble.
 
thanks for the answer, you anticipated me :)
i just tried using the blender object name
and everything works
yesterday it didn't work, so I was afraid it was a limit of Blender2MSFS
;)
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi,
Sorry for my poor english, but I think that Node="3ds max object name" is not the best description in this case.

When you edit with MCX your object, you can read via the icon "Object information", two datas:
- the GUID of the object,
- the name of the object.

The name is the information to use to define the Node. => Node= "MCX object name" is more apropriate in my own opinion.
So you can use 3DS or Blender without any trouble.
Be aware that many things in the behaviour xml refer to a node instead the model (e.g. a specific scenegraph node or modelpart). These are not named based on the model name in MCX. MCX does number them automatically.
 
Hi all. Does anyone know how to tag a visibility condition for aircraft in 3ds? Do I use the Babylon animation tool? I have a very simple code I like to use that worked fine in FSX but I'm sure how to get this working for FS2020. Where would I define this code in the xml file? Thanks in advance

<PartInfo>
<Name>inair</Name>
<Visibility>
<Parameter>
<Code>
(A:SIM ON GROUND, bool) ; if{ 0 } els{ 1 }
</Code>
</Parameter>
</Visibility>
</PartInfo>
 
Thank you for this!

Here is the code if you want, for example, that something is only visible between 10 and 18 o'clock every day. Maybe it helps someone
XML:
<Visibility>
<Parameter>
<Code>(E:LOCAL TIME, Seconds) 36000 &gt;= (E:LOCAL TIME, Seconds) 64800 &lt;= and if{ 1 } els{ 0 }</Code>

</Parameter>
</Visibility>
Yes, that helps me indeed, thank you so much!
Dan
 
Finally I managed to get a lot of things working

1/ making my test object appear only in April and
2/ animate it based on system variables (turning 360° in 60 seconds) =(thanks Christain Bahr!)
3/ make that object appear/disappear at a certain distance (using LOD)


What doesn't seem to work is to make that object be replaced by an other object using a second LOD.

Does anybody of you know, where the .gltf and .bin files of the second object must be placed, to make MSFS find it?

Here comes my XML-code:

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

<ModelInfo version="1.1" guid="{221a99b9-717b-4938-c79a-2b653370bfb4}">

<LODS>
<LOD minSize="0" ModelFile="bfd_test.gltf"/>
<LOD minSize="25" ModelFile="bfd_test_LOD01.gltf"/>
</LODS>

<Animation name="cube_green" guid="71fffad9-c36d-439e-8a39-fe3e4d362d90" length="60" type="Sim" typeParam2="cube_green" typeParam="AutoPlay"/>

<PartInfo>
<Name>cube_green</Name>
<AnimLength>60</AnimLength>
<Animation>
<Parameter>
<Code>
(E:LOCAL TIME, seconds) flr 60 %
</Code>
</Parameter>
</Animation>
</PartInfo>

</ModelInfo>

<ModelBehaviors>
<Include Path="Asobo\Misc\SimObjects.xml"/>
<Component ID="cube_green" Node="cube_green">
<Visibility>
<Parameter>
<Code>(E:LOCAL MONTH OF YEAR, Number) 4 == if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>
</Component>

</ModelBehaviors>

Or do I have to name that second object somehow in the sim.cfg file?

Here my actual file:

[VERSION]
Major=1
Minor=0

[fltsim.0]
title=bfd_test
model=
texture=

[General]
category=StaticObject
 
Hi,
yes you write it in the sim.cfg

XML:
[VERSION]
Major=1
Minor=0

[fltsim.0]
title=bfd_test
model=bfd_test
texture=

[fltsim.1]
title=bfd_test2
model=bfd_test2
texture=

[General]
category=StaticObject

The folder with glTF xml and bin is named like model.bfd_test and model.bfd_test2. Textures for all models in one TEXTURE Folder.
 
Woaw Steffsim, thanks a lot, i will check that soon and report. I am nearly at the end of my learning/testing journey to this subject and then go back to what I really want and like: scenery production!
 
Not working, unfortunately, this code in the sim.cfg makes bfd-test appear at the desired distance, but if increasing the distance bfd_test disappears, but the other object bfd_test_LOD01 does NOT appear (no textures needed, both gltf/bin in the same folder):

[VERSION]
Major=1
Minor=0

[fltsim.0]
title=bfd_test
model=
texture=

[fltsim.1]
title=bfd_test_LOD01
model=
texture=

[General]
category=StaticObject

If I do it this way:

[VERSION]
Major=1
Minor=0

[fltsim.0]
title=bfd_test
model=bfd_test
texture=

[fltsim.1]
title=bfd_test_LOD01
model=bfd_test_LOD01
texture=

[General]
category=StaticObject

I get an error message in the SDK:

1608652439337.png


Any idea on what is wrong here? Thank you very much for any kind of help.
 
You DO NOT define LODS with additional fltsim entries. That is not how LODs in the sim works.

Each fltsim entry is a unique sim object (think each repaint for an aircraft although with aircraft you can change the model as well if needed). When you place the object in the sim it places the fltsim object. You'd need to place 2 objects if you use multiple fltsim entries. So you don't do that. You sort out your <LODS> so they work properly.

Step 1 would be to reorganise it:

Code:
<LODS>
<LOD MinSize="25" ModelFile="bfd_test.gltf"/>
<LOD MinSize="0" ModelFile="bfd_test_LOD01.gltf"/>
</LODS>

As per the example I capitalized MinSize and arranged in size order. Don't know if this is your problem but it's best to start there.

Code:
<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo>
    <LODS>
        <LOD MinSize="70" ModelFile="Windmill.gltf"/>
        <LOD MinSize="50" ModelFile="Windmill_LOD1.gltf"/>
        <LOD MinSize="40" ModelFile="Windmill_LOD2.gltf"/>
        <LOD MinSize="0" ModelFile="Windmill_LOD3.gltf"/>
        
    </LODS>
    <Behaviors>
        <Include ModelBehaviorFile="Asobo\Misc\SimObjects.xml"/>
        
        <Component ID="WindTurbine">
            <UseTemplate Name="ASOBO_WindTurbine_Template">
            </UseTemplate>
            
            <!-- Commented until an emissive node is defined in model
            <Component ID="WindTurbine_Light" Node="">
                <UseTemplate Name="ASOBO_GT_Material_Emissive_Code">
                    <EMISSIVE_CODE>(E:SIMULATION TIME, seconds) 10 * 5 %</EMISSIVE_CODE>
                </UseTemplate>
            </Component>
            -->
        </Component>
    </Behaviors>
</ModelInfo>
 
Dear Anthony21

Solved! Thanks, it was the correct coding of the LOD part in the XML-file. Now it works and my test-objects do what they should.
1/ the bfd_test_LOD01-model is displayed in the game and
2/ when I go near that object, it changes and the bfd_test-model ist displayed (with the animation)
3/ the bfd_test_LOD01-model is appearing (only when not being near) the whole year, the bfd_test-model (with the animation) only in April
4/ being near the object in other months than april makes everything disappear.

So I finally succesfully tested all my programming targets with one (two) objects. Thank you very much to all of you helping me out with this, SimObjects are no more "terra incognita" for Dummy-Dan ;-)

No naming of the second object was necessary in the sim.cfg.

Here the complete xml-code for anyone who could encounter similar needs:

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

<ModelInfo version="1.1" guid="{221a99b9-717b-4938-c79a-2b653370bfb4}">

<LODS>
<LOD MinSize="25" ModelFile="bfd_test.gltf"/>
<LOD MinSize="0" ModelFile="bfd_test_LOD01.gltf"/>
</LODS>

<Animation name="cube_green" guid="71fffad9-c36d-439e-8a39-fe3e4d362d90" length="60" type="Sim" typeParam2="cube_green" typeParam="AutoPlay"/>


<PartInfo>
<Name>cube_green</Name>
<AnimLength>60</AnimLength>
<Animation>
<Parameter>
<Code>
(E:LOCAL TIME, seconds) flr 60 %
</Code>
</Parameter>
</Animation>
</PartInfo>


</ModelInfo>

<ModelBehaviors>
<Include Path="Asobo\Misc\SimObjects.xml"/>
<Component ID="cube_green" Node="cube_green">
<Visibility>
<Parameter>
<Code>(E:LOCAL MONTH OF YEAR, Number) 4 == if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>
</Component>

</ModelBehaviors>
 
Hi :)

I learned a lot since the few month I check this great community
Thanks to you guys

I tried to follow what you have said earlier for the visibility but unfortunately, it doesn't works at all


Here is my code in PackageSources\modelLib\bonhomme-de-neige\bonhomme-de-neige.xml
<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo guid="{8861718c-071b-45bd-e444-a7f80aa54802}" version="1.1" />
<ModelBehaviors>
<Component ID="bonhomme-de-neige" Node="bonhomme-de-neige">
<Visibility>
<Parameter>
<Code>(E:LOCAL MONTH OF YEAR, Number) 4 == if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>
</Component>
</ModelBehaviors>

In blender my object (node name if I followed) is always called bonhomme-de-neige as well as when I export the object I always call it bonhomme-de-neige

Have a very nice day :)
 
Test this one:

<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo guid="{8861718c-071b-45bd-e444-a7f80aa54802}" version="1.1">
<LODS>
<LOD MinSize="0" ModelFile="bonhomme-de-neige.gltf"/>
</LODS>
</ModelInfo>

<ModelBehaviors>
<Component ID="bonhomme-de-neige" Node="bonhomme-de-neige">
<Visibility>
<Parameter>
<Code>(E:LOCAL MONTH OF YEAR, Number) 4 == if{ 1 } els{ 0 }</Code>
</Parameter>
</Visibility>
</Component>
</ModelBehaviors>
This exemple adapted from my "Parasol (Open/Closed)" works very well.
 
Test this one:


This exemple adapted from my "Parasol (Open/Closed)" works very well.
Thanks but it doesnt work

It's very strange.

I checked the xml, I rebuild from scratch the entire packager and then I tested in by placing it in community to be sure that it was not the dev mode wich could cause some problems
Also I'm very familiar with blender and export and manipulates xml etc..

I gonna try again but this time with a basic cube
Edit: don't work either :/
I joined the default cube test if someone could test it
Thanks
 

Attachments

  • default_cube_test.zip
    2.2 MB · Views: 41
Last edited:
Top