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

XML LVAR state

Messages
39
Country
us-newhampshire
I am trying to create a moving switch to animate a refueling probe.
I have the mouse area code: " (L:SWITCH_PROBE_REFUEL, bool) ! (>L:SWITCH_PROBE_REFUEL, bool)"

But not the element value code for the switch to move.

<Element>
<Position X="232" Y="12"/>
<Select>
<Visible>(L:REFUEL PROBE SWITCH, bool)</Visible>
<Case Value="100">
<Image Name="down_on.bmp"/>
</Case>
<Case Value="000">
<Image Name="up_off.bmp"/>
</Case>
</Select>
</Element>

Any thoughts would be appreciated..
 
I am trying to create a moving switch to animate a refueling probe.
I have the mouse area code: " (L:SWITCH_PROBE_REFUEL, bool) ! (>L:SWITCH_PROBE_REFUEL, bool)"

But not the element value code for the switch to move.

<Element>
<Position X="232" Y="12"/>
<Select>
<Visible>(L:REFUEL PROBE SWITCH, bool)</Visible>
<Case Value="100">
<Image Name="down_on.bmp"/>
</Case>
<Case Value="000">
<Image Name="up_off.bmp"/>
</Case>
</Select>
</Element>

Any thoughts would be appreciated..
The L:Var names are not the same.
 
I tried rewording and changing visible for value with no effect.

<Element>
<Position X="232" Y="12"/>
<Select>
<Value>(L:SWITCH PROBE REFUEL, bool)</Value>
<Case Value="100">
<Image Name="down_on.bmp"/>
</Case>
<Case Value="000">
<Image Name="up_off.bmp"/>
</Case>
</Select>
</Element>
 
Two possible problems.

1. Case values are not in numerical order (ie you have 100 before 0). I don't know if this is actually a problem but I like to keep things in nice numerical order just in case. I'd also write <Case Value="0"> and not use triple zero (again I don't know if this would be a problem but I like to keep things nice and neat and not waste processing time on superfluous characters).

2. You're checking for case value = 100. It will never be 100. With the mouse area code you have the L var switch between 0 and 1 so you should check for case value = 1 and case value = 0 only.
 
Two possible problems.

1. Case values are not in numerical order (ie you have 100 before 0). I don't know if this is actually a problem but I like to keep things in nice numerical order just in case. I'd also write <Case Value="0"> and not use triple zero (again I don't know if this would be a problem but I like to keep things nice and neat and not waste processing time on superfluous characters).

2. You're checking for case value = 100. It will never be 100. With the mouse area code you have the L var switch between 0 and 1 so you should check for case value = 1 and case value = 0 only.


I tried your suggestions but sad to say no luck.

<Element>
<Position X="232" Y="12"/>
<Select>
<Value>(L:SWITCH PROBE REFUEL, bool)</Value>
<Case Value="0">
<Image Name="down_on.bmp"/>
</Case>
<Case Value="1">
<Image Name="up_off.bmp"/>
</Case>
</Select>
</Element>
 
Here are two ways both very simple to follow -
Code:
<Gauge Name="Floor Lights switch" Version="1.0">
   <Element>
      <Select>
         <Value>(L:floorlights,bool)</Value>
         <Case Value="0">
            <Image Name="OH_SWITCH_2_OFF.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="OH_SWITCH_2_ON.bmp"/>
         </Case>
      </Select>
   </Element>
   <Mouse>
         <Tooltip>Floor Lights</Tooltip>
      <Cursor Type="Hand"/>
    <Click>(L:floorlights,bool) 0 != if{ 0 (&gt;L:floorlights,bool) 1 (>L:Sound_button,enum) } els{ 1 (>L:Sound_button,enum) 1 (&gt;L:floorlights,bool) }</Click>
   </Mouse>
</Gauge>

1 (>L:Sound_button,enum) refers to the sound the switch makes

Code:
<Gauge Name="Ground Flight Switch" Version="1.0">

<Element>
      <Select>
         <Value>(G:Var1)</Value>
         <Case Value="0">
            <Image Name="FUEL_SWITCH_3_OFF.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="FUEL_SWITCH_3_ON.bmp"/>
         </Case>
      </Select>
   </Element>
   <Mouse>
      <Tooltip>Ground Flight Switch</Tooltip>
      <Cursor Type="Hand"/>
        <Click>(G:Var1) 0 != if{ 0 (&gt;G:Var1) 1 (>L:Sound_button,enum) 1 (>L:ground2,enum) 0 (>L:flight,enum) (P:local time, seconds) 0.21 + (>L:BUS_SWITCH,number) } els{ 1 (&gt;G:Var1) 1 (>L:Sound_button,enum) 1 (>L:flight,enum) 0 (>L:ground2,enum) (P:local time, seconds) 0.21 + (>L:BUS_SWITCH,number) }</Click>
   </Mouse>
</Gauge>

In this one also you see the switch sound and a small delay that makes al the cockpit system warning lights turn off briefly as the switchover from ground power to a/c power is made
 
I am not sure of what are you getting.

Which of the two bitmaps are you seeing, "down_on.bmp" or "up_off.bmp" ?

Tom
 
Here are two ways both very simple to follow -
Code:
<Gauge Name="Floor Lights switch" Version="1.0">
   <Element>
      <Select>
         <Value>(L:floorlights,bool)</Value>
         <Case Value="0">
            <Image Name="OH_SWITCH_2_OFF.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="OH_SWITCH_2_ON.bmp"/>
         </Case>
      </Select>
   </Element>
   <Mouse>
         <Tooltip>Floor Lights</Tooltip>
      <Cursor Type="Hand"/>
    <Click>(L:floorlights,bool) 0 != if{ 0 (&gt;L:floorlights,bool) 1 (>L:Sound_button,enum) } els{ 1 (>L:Sound_button,enum) 1 (&gt;L:floorlights,bool) }</Click>
   </Mouse>
</Gauge>

1 (>L:Sound_button,enum) refers to the sound the switch makes

Code:
<Gauge Name="Ground Flight Switch" Version="1.0">

<Element>
      <Select>
         <Value>(G:Var1)</Value>
         <Case Value="0">
            <Image Name="FUEL_SWITCH_3_OFF.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="FUEL_SWITCH_3_ON.bmp"/>
         </Case>
      </Select>
   </Element>
   <Mouse>
      <Tooltip>Ground Flight Switch</Tooltip>
      <Cursor Type="Hand"/>
        <Click>(G:Var1) 0 != if{ 0 (&gt;G:Var1) 1 (>L:Sound_button,enum) 1 (>L:ground2,enum) 0 (>L:flight,enum) (P:local time, seconds) 0.21 + (>L:BUS_SWITCH,number) } els{ 1 (&gt;G:Var1) 1 (>L:Sound_button,enum) 1 (>L:flight,enum) 0 (>L:ground2,enum) (P:local time, seconds) 0.21 + (>L:BUS_SWITCH,number) }</Click>
   </Mouse>
</Gauge>

In this one also you see the switch sound and a small delay that makes al the cockpit system warning lights turn off briefly as the switchover from ground power to a/c power is made
Here are two ways both very simple to follow -
Code:
<Gauge Name="Floor Lights switch" Version="1.0">
   <Element>
      <Select>
         <Value>(L:floorlights,bool)</Value>
         <Case Value="0">
            <Image Name="OH_SWITCH_2_OFF.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="OH_SWITCH_2_ON.bmp"/>
         </Case>
      </Select>
   </Element>
   <Mouse>
         <Tooltip>Floor Lights</Tooltip>
      <Cursor Type="Hand"/>
    <Click>(L:floorlights,bool) 0 != if{ 0 (&gt;L:floorlights,bool) 1 (>L:Sound_button,enum) } els{ 1 (>L:Sound_button,enum) 1 (&gt;L:floorlights,bool) }</Click>
   </Mouse>
</Gauge>

1 (>L:Sound_button,enum) refers to the sound the switch makes

Code:
<Gauge Name="Ground Flight Switch" Version="1.0">

<Element>
      <Select>
         <Value>(G:Var1)</Value>
         <Case Value="0">
            <Image Name="FUEL_SWITCH_3_OFF.bmp"/>
         </Case>
         <Case Value="1">
            <Image Name="FUEL_SWITCH_3_ON.bmp"/>
         </Case>
      </Select>
   </Element>
   <Mouse>
      <Tooltip>Ground Flight Switch</Tooltip>
      <Cursor Type="Hand"/>
        <Click>(G:Var1) 0 != if{ 0 (&gt;G:Var1) 1 (>L:Sound_button,enum) 1 (>L:ground2,enum) 0 (>L:flight,enum) (P:local time, seconds) 0.21 + (>L:BUS_SWITCH,number) } els{ 1 (&gt;G:Var1) 1 (>L:Sound_button,enum) 1 (>L:flight,enum) 0 (>L:ground2,enum) (P:local time, seconds) 0.21 + (>L:BUS_SWITCH,number) }</Click>
   </Mouse>
</Gauge>

In this one also you see the switch sound and a small delay that makes al the cockpit system warning lights turn off briefly as the switchover from ground power to a/c power is made


Thanks for the code as I can use it for other switches in the panel.
 
Which of the bitmaps are you contantly seeing, "down_on.bmp" or "up_off.bmp"; or maybe none?

Tom

Sorry for the confusion, I have a bigger problem as it looks like the LVAR name is not correct. I've searched through the mdl file and tried what seems to be
the code but am missing the correct syntax.
 
I tried your suggestions but sad to say no luck.

<Element>
<Position X="232" Y="12"/>
<Select>
<Value>(L:SWITCH PROBE REFUEL, bool)</Value>
<Case Value="0">
<Image Name="down_on.bmp"/>
</Case>
<Case Value="1">
<Image Name="up_off.bmp"/>
</Case>
</Select>
</Element>
Your <Mouse> section is using underscores between the words, your <Value> section is not. Choose one or the other for consistency!
Code:
<Value>(L:SWITCH PROBE REFUEL, bool)
versus
<Click>(L:SWITCH_PROBE_REFUEL, bool)
 
Back
Top