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

Messages
21
Country
hungary
Played a bit with model behaviors :)


leaves_1.gif
 

Attachments

  • leaves_2.gif
    leaves_2.gif
    2.1 MB · Views: 70
Messages
8
Country
netherlands
Guys,

I'm by no means a programmer, which makes it pretty difficult.
However, I managed, with the help of the above and Mamu's vid, to open my hangar between 800 and 1800 local time.
Now I would like to add the possibility to toggle the doors with the NAV light switch, and I thought the code attached would work. It does not.
So I hope you can help me out to adjust the code in such a way, that it does.

Code:
<PartInfo>
        <Name>HangarDoorLeft</Name>
        <AnimLength>140</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (E:LOCAL TIME, SECONDS) 28800 &gt; (E:LOCAL TIME, SECONDS) 64800 &lt; and (L:LIGHTING_NAV_1,Bool) 1 == or if{ 140 } els{ 0 }
                </Code>
                <Lag>10</Lag>
            </Parameter>
        </Animation>
    </PartInfo>
    <PartInfo>
        <Name>HangarDoorRight</Name>
        <AnimLength>80</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (E:LOCAL TIME, SECONDS) 28800 &gt; (E:LOCAL TIME, SECONDS) 64800 &lt; and (L:LIGHTING_NAV_1,Bool) 1 == or if{ 80 } els{ 0 }
                </Code>
                <Lag>10</Lag>
            </Parameter>
        </Animation>
    </PartInfo>

I Appreceate your help.

Best, Rob
 
Messages
8
Country
netherlands
Brilliant Mamu, now the nav light switch works!!!

Edit: but not the timing anymore 😕

Edit 2: Ow, and now (I changed the timing code back to 64800) the nav light switch does not work anymore, but the timing does. Even after a restart of the sim etc.
This random behaviour is strange.
Same plane...

Code:
<PartInfo>
        <Name>HangarDoorLeft</Name>
        <AnimLength>140</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (E:LOCAL TIME, SECONDS) 28800 &gt; (E:LOCAL TIME, SECONDS) 72000 &lt; and (A:LIGHT NAV,bool) 1 == or if{ 140 } els{ 0 }
                </Code>
                <Lag>10</Lag>
            </Parameter>
        </Animation>
    </PartInfo>
 
Last edited:
Messages
767
Country
italy
Anyone else interested in the topic,
this code adds the nav light switch to the timeframe
Because sometimes developers are using
(L:LIGHTING_NAV_1,Bool) or (L:LIGHTING_NAV_0,Bool)
Both of them are included in the evalutation code
As per other L: variables, also those are aircraft dependent


XML:
<PartInfo>
        <Name>portaDXEst</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Code>
                (E:LOCAL TIME, Seconds) 28800 &gt; (E:LOCAL TIME, Seconds) 64800 &lt; and (L:LIGHTING_NAV_1,Bool) 1 == (L:LIGHTING_NAV_0,Bool) 1 == or or if{ 100 } els{ 0 }
                </Code>
                <LAG>20</LAG>
            </Parameter>
        </Animation>
    </PartInfo>
 
Messages
473
Country
hungary
Hi Guys!

I am totaly noob for xml syntax. What I do not understand is how to combine together the conditions.

Do I understand well when I place two condition like part 1 in the picture the "and" or the "or" operator at the end is refenced for the "day of year". Same with part two where after the "Local Time" thing the and is valid. But where do I connect these two together?

What I want to achieve here is to show the object only between day 90 and 310 and when it is daytime.


Other silly question. What if I want to display the object / nod all the time?


Thanks a lot!

1671203476827.png
 
Messages
21
Country
hungary
Hi Guys!

I am totaly noob for xml syntax. What I do not understand is how to combine together the conditions.

Do I understand well when I place two condition like part 1 in the picture the "and" or the "or" operator at the end is refenced for the "day of year". Same with part two where after the "Local Time" thing the and is valid. But where do I connect these two together?

What I want to achieve here is to show the object only between day 90 and 310 and when it is daytime.


Other silly question. What if I want to display the object / nod all the time?


Thanks a lot!

View attachment 85495

you can add multiple operators like this and you can use || for or, & for and, easier to read and seperate logical seperators.

XML:
<Code>(E:LOCAL TIME, Seconds) 25200 &gt;= (E:LOCAL TIME, Seconds) 75600 &lt;= and (E:LOCAL MONTH OF YEAR, Number) 4 &lt;= (E:LOCAL MONTH OF YEAR, Number) 10 &gt;= || and (A:AMBIENT TEMPERATURE, celsius) -10.0 &gt; and if{ 1 } els{ 0 }  </Code>

if you would like to make is visible all the time, simply dont use visibility code for it.
 
Messages
473
Country
hungary
Hi Guys!

I am totaly noob for xml syntax. What I do not understand is how to combine together the conditions.

Do I understand well when I place two condition like part 1 in the picture the "and" or the "or" operator at the end is refenced for the "day of year". Same with part two where after the "Local Time" thing the and is valid. But where do I connect these two together?

What I want to achieve here is to show the object only between day 90 and 310 and when it is daytime.


Other silly question. What if I want to display the object / nod all the time?


Thanks a lot!

View attachment 85495
Anybody wondering the solution was 2x and at the end.


(E:LOCAL DAY OF YEAR, Number) 90 &gt;= (E:LOCAL DAY OF YEAR, Number) 310 &lt;= and (E:LOCAL TIME, Seconds) 39600 &gt;= (E:LOCAL TIME, Seconds) 61200 &lt;= and and if{ 1 } els{ 0 }

And this is what makes it helpful

 
Messages
11
Country
switzerland
I'm at my wits end...
I've tried hours and hours to get my code done. I've no errors in the console, but my simobject doesn't dissapear when Local Time is 8 am - 8.30 pm as well 6 pm - 6.30 pm. No idea why. Is my code wrong?

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

-<ModelInfo guid="{6a39f4bb-6bda-4f13-9308-ec8705d5750b}" version="1.1">


-<LODS>

<LOD ModelFile="H120 Colibri.gltf" MinSize="10"/>

</LODS>


-<Behaviors>

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


-<Component Node="H120 Colibri" ID="H120 Colibri">


-<Visibility>


-<Parameter>

<Code>(E:LOCAL TIME, Seconds) 28800 >= (E:LOCAL TIME, Seconds) 29800 <= and (E:LOCAL TIME, Seconds) 64800 >= (E:LOCAL TIME, Seconds) 65800 <= and or if{ 1 } els{ 0 } </Code>

</Parameter>

</Visibility>

</Component>

</Behaviors>

</ModelInfo>


If anyone could have a look, thank you for any advice.
 

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
5,945
Country
us-wisconsin
This should work:

XML:
<?xml version="1.0" encoding="utf-8" ?>
<ModelInfo guid="{6a39f4bb-6bda-4f13-9308-ec8705d5750b}" version="1.1">
    <LODS>
        <LOD ModelFile="H120 Colibri.gltf" MinSize="10"/>
    </LODS>
</ModelInfo>

<ModelBehaviors>
    <Include Path="Asobo\Misc\SimObjects.xml"/>
        <Component Node="H120 Colibri" ID="H120 Colibri">
            <Visibility>
                <Parameter>
                    <Code>
                         (E:LOCAL TIME, Seconds) 28800 &gt;= (E:LOCAL TIME, Seconds) 30600 &lt;= and (E:LOCAL TIME, Seconds) 64800 &gt;= (E:LOCAL TIME, Seconds) 66600 &lt;= and or if{ 1 } els{ 0 }
                    </Code>
                </Parameter>
            </Visibility>
        </Component>

</ModelBehaviors>

Are you sure the Component Node is H120 Colibri? My testing node was different (not the glTF name but the mesh node name (<Component ID="cube" Node="cube">)).
 

Christian Bahr

Resource contributor
Messages
951
Country
germany
If you take a closer look at your code, you'll notice the hyphen:

XML:
<?xml version="1.0" encoding="UTF-8"?>
-<ModelInfo guid="{6a39f4bb-6bda-4f13-9308-ec8705d5750b}" version="1.1">

-<LODS>
<LOD ModelFile="H120 Colibri.gltf" MinSize="10"/>
</LODS>

-<Behaviors>
<Include ModelBehaviorFile="Asobo\Misc\SimObjects.xml"/>

-<Component Node="H120 Colibri" ID="H120 Colibri">

-<Visibility>
-<Parameter>
<Code>(E:LOCAL TIME, Seconds) 28800 >= (E:LOCAL TIME, Seconds) 29800 <= and (E:LOCAL TIME, Seconds) 64800 >= (E:LOCAL TIME, Seconds) 65800 <= and or if{ 1 } els{ 0 } </Code>
</Parameter>
</Visibility>

</Component>

</Behaviors>

</ModelInfo>

Does the hyphen have a special meaning in your code? In all my XML files there is no hyphen at this point. Possibly a source of error.
 
Messages
75
Country
germany
Thank you for your help. Unfortunately, it's not working. I've no idea what's wrong.
You must rewrite characters that have special meaning in XML syntax if you want to use them in normal text between tags.

The following characters are affected:

CharacterNotation in XML
<&lt;
>&gt;
&&amp;
"&quot;
'&apos;

e.g.: "28800 >=" must be "28800 &gt;="
 
Messages
11
Country
switzerland
Thanks for your help guys. I will check and let you know, if it works.

Does anybody know, is there a way to use visibility codes for asobo‘s marshaller as well, as an example?
 
Messages
29
Country
norway
Hi!
I am trying to get a snowplow to be visible only when it snows, but it will not work. The snowplow is visible all the time. What am I doing wrong?
snowplowxml.jpg
snowplow.jpg
 
Last edited:
Messages
4
Country
netherlands
Hey Guys,

I tried this code to start an animation. When the BEACON Light is on it starts and when it's off it disappears.

<Code> (A:LIGHT BEACON,bool) 1 == or if{ 1 } els{ 0 } </Code>

This code unfortunately doesn't work and I read somewhere in this forum its from Simvar and I can see it working in Simvar but this code:

<Code> (L:LIGHTING_BEACON_0,Bool) OR (L:LIGHTING_BEACON_1,Bool) == if{ 1 } els{ 0 } </Code>

It works buuut with some payware addons like the PMDG 737 or Fenix A320 it does not work because they use custom lights

If anyone has an idea or want me to help with this problem I will be appreciated it !
 
Top