• 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 Gauge switch

Messages
5
Hello, I'm trying to make a guage that will switch between value 0 and 1, this is the code I have so far

<Gauge Name="Rotor Brake" Version="1.0">
<Element>
<Select>
<Value>(G:Var1)</Value>
<Case Value="1">
<Image Name="Rotor_Brake_ON.bmp"/>
</Case>
<Case Value="0">
<Image Name="Rotor_Brake_OFF.bmp"/>
</Case>
</Select>
</Element>
<Mouse>
<Cursor Type="Hand"/>
<Click>(G:Var1)!(&gt;G:Var1)</Click>
</Mouse>
</Gauge>

if I set the <click> to give the value of 1 to G:Var1 it works but then ofc it doesnt switch back so is there anything wrong there to why this isnt going back and forth?
 
Messages
7
Country
us-missouri
Try this line of code very simple
Code:
 <Gauge Name="Lower Panel Fuel and Clutch" Version="1.0" Author="Donald Elliott">
  <Image Name="lw_pnl_back.bmp" Luminous="no" ImageSizes="411,512" /> 
- <Element>
  <Position X="78" Y="54" /> 
- <Select>
  <Value>(A:Rotor clutch switch pos,bool)</Value> 
- <Case Value="0">
  <Image Name="Rotor_Brake_ON.bmp" /> 
  </Case>
- <Case Value="1">
  <Image Name="Rotor_Brake_OFF.bmp" /> 
  </Case>
  </Select>
  </Element>
- <Mouse>
- <Area Left="78" Right="385" Top="54" Bottom="190">
  <Tooltip>Rotor Clutch: In = ON</Tooltip> 
  <Cursor Type="Hand" /> 
  <Click Event="ROTOR_CLUTCH_SWITCH_TOGGLE" /> 
  </Area>
- </Mouse>
  </Gauge>

IN this example we used the function of an internal variable called Rotor clutch switch pos, and the bool refers to your 0 and 1, or Boolean

Next well do the same function using a User variable G:var1
var1 is refering to a uservariable name could aswell be rusty, puppy, you name it.
G: refers to a variables that apply to only one panel.
I prefer to use the L: it will refer to all panels in a set. meaing 2d and 3d cockpits.
I simple used this to turn on and of a mag switch in L:ing1 and the K:MAGNETO1 is an fs Key token for magnetos.

Code:
<Gauge Name="ing1" Version="1.0">
   <Element>
      <Select>
         <Value>(L:Ing1 off, bool)</Value>
         <Case Value="0">
            <Image Name="switch_off.bmp" ImageSizes="27,39"/>
         </Case>
         <Case Value="1">
            <Image Name="switch_on.bmp" ImageSizes="27,39"/>
         </Case>
      </Select>
   </Element>
   <Mouse>
   <Area Left="0" Right="67" Width="20" Height="20">
        <Tooltip>ING 1</Tooltip>
      <Cursor Type="Hand"/>
      <Click>(L:Ing1 off, bool) ! (>L:Ing1 off, bool) (L:Ing1 off, Bool) if{ 1 (>K:MAGNETO1_BOTH) } els{ 0 (>K:MAGNETO1_LEFT) }</Click>
      </Area>
   </Mouse>
</Gauge>
 
Last edited:
Messages
5
no I just need the switch to switch between 2 values but without using any of the actual game variables, just the G or L variable that's all I need
 
Top