Object Visibility with Weather Variable?

Hello,

I’d like to make it possible for a mesh attached to a Node to be displayed or hidden according to a weather SimVar.

I’ve found the “AMBIENT PRECIP STATE” Simvar but my code doesn’t seem to work. I want my object to be displayed when there’s snow.

here’s the code i use:

<Component ID="SNOW_TOWER" Node="SNOW_TOWER">**
**        <Visibility>**
**        <Parameter>	**
**            <Code>(A:AMBIENT PRECIP STATE, Enum) 8  ==</Code>**
**		</Parameter>**
**        </Visibility>**
**</Component>

It’s not an Sim object

To run Anim code it needs to be a simobject, non simobjects can only have looping animations

Even juste a visibility code ?

Every code needs a Simobject

Don’t be scared of them :sweat_smile:

1 Like

I’m not afraid of Simobjects :joy:

I just thought that we didn’t have to make one for a visibility code, but if not, I’ll make one.

However, that didn’t solve my initial question because I’m still trying (now in Simobject) to make it visible only when there’s snow with the var “AMBIENT PRECIP STATE”.

I don’t know if I’m wrong or if there’s another simvar.

I tried with these 2 codes:

<Component ID="SNOW_TOWER" Node="SNOW_TOWER">
    <UseTemplate Name="ASOBO_GT_Visibility">
        <VISIBILITY_CODE>(A:AMBIENT PRECIP STATE, Number) 8 == if{ 1 } els{ 0 }</VISIBILITY_CODE>
    </UseTemplate>
</Component>

or

<Component ID="SNOW_TOWER" Node="SNOW_TOWER">
    <Visibility>
        <Parameter>
            <Code>(A:AMBIENT PRECIP STATE, Number) 8 == if{ 1 } els{ 0 }</Code>
        </Parameter>
    </Visibility>
</Component>

I also think I must have made a mistake in the way I described the conditions to him?

Does the object show up at all?
If it does you can have a look in the devmode/tools/behaviours menu to see what might be happening

This simvar will also only work when snowing, not with snow on the ground.

yes but i want it to show only when it snow or the conditions is suitable to snow

i tried the behaviours menu but i don’t find any tips for

Do you have a the SNOW_TOWER node in your object?

If so, wouldn’t you mind posting the full .XML? Maybe there is a issue elsewhere

E.g. AMBIENT PRECIP STATE type is Mask, not Number

https://docs.flightsimulator.com/html/Programming_Tools/SimVars/Miscellaneous_Variables.htm?rhhlterm=ambient%20precip&rhsearch=AMBIent%20precip

Okey
Snow_Tower.xml (434 Bytes)

The Component is child of Behaviors, you need to add it

See attached sample

lidl-signals.xml (749 Bytes)

Thanks its work

1 Like