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

Make VC gauge (p3d)

Messages
114
Country
canada
Hi,

I hope this isn't a too complicated question.

I want to know how to make a very basic, dummy gauge for my vc, using only and on.bmp and off.bmp

I have a sheet made and positioned in blender, how to I map the gauge to it? (how do I make the $texture and work with it, etc)

I tried making the xml but I'm not sure if it is correct:

<Gauge Name="test" Version="1.0">


<Element>
<Position X="0" Y="0" />
<Element>
<Position X="0" Y="0" />
<Select>
<Value>(L:test, bool) s0 </Value>
<Case Value="0">
<Image Name="test on.bmp"/>
</Case>
<Case Value="1">
<Image Name="test off.bmp"/>
</Case>
</Select>
</Element>
</Element>

<Mouse>
<Area Left="0" Top="0" Width="85" Height="85">
<Tooltip>Test</Tooltip>
<Cursor Type="Hand"/>
<Click>
(L:test, bool) ! (&gt;L:test, bool)
</Click>
</Area>
</Mouse>

</Gauge>


Once I have the xml gauge, how to I set everything up in the [Vcockpitxx] section.

Thanks!
 
It's the same process as FSX, so use the resources available for that:


etc.
 
Thanks for point me in that direction! I actually fiugred it out after all this time!! i'm so happy!
It's the same process as FSX, so use the resources available for that:


etc.
 
It's the same process as FSX, so use the resources available for that:


etc.
I've got another question: I'm trying to make a flashing/blinking gauge. How can I make it so I click on the gauge and then it starts blinking (ON CALL LIGHT), and I click to turn it off the blinking (ON CALL DARK). Right now it just blinks.

Also if possible, how could I make it so the gauge is connected to the master battery visibility, but everytime I turn the battery on, it defaults to ON CALL LIGHT and not whatever I lasted clicked to.

Here is my script:

<Gauge Name="EMER CALL" Version="1.0">


<Element>
<Position X="0" Y="0" />
<Element>
<Position X="0" Y="0" />
<Select>
<Value>(L:EMER CALL, bool) s0 </Value>
<Case Value="0">
<Image Name="ON CALL DARK.bmp"/>
</Case>
<Value>(L:EMER CALL, bool) 5 &lt; (P:Absolute time,seconds) 1 % 0.5 > !</Value>
<Case Value="1">
<Image Name="ON CALL LIGHT.Bmp"/>
</Case>
</Select>
</Element>
</Element>

<Mouse>
<Area Left="0" Top="0" Width="85" Height="85">
<Tooltip>EMER CALL</Tooltip>
<Cursor Type="Hand"/>
<Click>
(L:EMER CALL, bool) ! (&gt;L:EMER CALL, bool)
</Click>
</Area>
</Mouse>

</Gauge>
 
Last edited:
Try

Code:
<Gauge Name="EMER CALL" Version="1.0">
<Image Name="ON CALL DARK.bmp"/>

<Element>
 <Visible> (A:Electrical master battery,bool)</Visible>
  <Element>
  <Visible> (L:EMER CALL, bool) 1 == (P:absolute time, number) 1.0 % 0.5 &gt; * </Visible>
    <Image Name="ON CALL LIGHT.bmp"/>
  </Element>
</Element>

<Mouse>

  <Tooltip>EMER CALL</Tooltip>
  <Cursor Type="Hand"/>
  <Click>
  (L:EMER CALL, bool) ! (&gt;L:EMER CALL, bool)
  </Click>

</Mouse>

</Gauge>
 
Try

Code:
<Gauge Name="EMER CALL" Version="1.0">
<Image Name="ON CALL DARK.bmp"/>

<Element>
 <Visible> (A:Electrical master battery,bool)</Visible>
  <Element>
  <Visible> (L:EMER CALL, bool) 1 == (P:absolute time, number) 1.0 % 0.5 &gt; * </Visible>
    <Image Name="ON CALL LIGHT.bmp"/>
  </Element>
</Element>

<Mouse>

  <Tooltip>EMER CALL</Tooltip>
  <Cursor Type="Hand"/>
  <Click>
  (L:EMER CALL, bool) ! (&gt;L:EMER CALL, bool)
  </Click>

</Mouse>

</Gauge>
Sweet thanks! Yea the blinking if perfect. Only thing if the ON CALL LIGHT doesn't automatically come one after battery turns back on. If it was clicked off, battery turned off, then on, if would still show up off. No biggie though, thanks for your help!
 
This might fix that particular problem

Code:
<Gauge Name="EMER CALL" Version="1.0">
<Image Name="ON CALL DARK.bmp"/>

<Element>
 <Visible> (A:Electrical master battery,bool)</Visible>
  <Element>
  <Visible> (L:EMER CALL, bool) 1 == (P:absolute time, number) 1.0 % 0.5 &gt; * </Visible>
    <Image Name="ON CALL LIGHT.bmp"/>
  </Element>
</Element>

<Mouse>

  <Tooltip>EMER CALL</Tooltip>
  <Cursor Type="Hand"/>
  <Click>
  (L:EMER CALL, bool) ! (&gt;L:EMER CALL, bool)
  </Click>

</Mouse>

<Element>
   <Select>
    <Value>
    (A:Electrical master battery,bool) 0 == (L:EMER CALL, bool) 1 == and
         if{  0 (&gt;L:EMER CALL, bool)  }
   </Value>
   </Select>
</Element>

</Gauge>
 
Perfect. Sorry to keep troubling you, but what would I change to have it default to the ON CALL LIGHT and not ON CALL DARK.
Also one more thing I should add. What I'm trying to do exactly involves 3 steps if thats possible:

1682518009756.png
ON CALL DARK.bmp
1682518077652.png
ON CALL LIGHT.bmp
1682518099898.png
ON LIGHT.bmp
1682518128835.png
CALL LIGHT.bmp

ON CALL DARK would be normal, switch off display.
Click and the ON LIGHT is static, but only the CALL LIGHT flashes. Then click again and goes back to ON CALL DARK.
Then again, once battery powers off and on, always starts with the ON CALL LIGHT

Thanks!
 
This should catch some of your requirements. What exactly should show when the battery is turned on first?

Code:
<Gauge Name="EMER CALL" Version="1.0">
<Image Name="ON CALL DARK.bmp"/>

<Element>
 <Visible> (A:Electrical master battery,bool)</Visible>
  <Element>
  <Visible> (L:EMER CALL, bool) 1 == </Visible>
    <Image Name="ON LIGHT.bmp"/>
  </Element>
  <Element>
  <Visible> (L:EMER CALL, bool) 1 == (P:absolute time, number) 1.0 % 0.5 &gt; * </Visible>
    <Image Name="CALL LIGHT.bmp"/>
  </Element>
</Element>

<Mouse>

  <Tooltip>EMER CALL</Tooltip>
  <Cursor Type="Hand"/>
  <Click>
  (L:EMER CALL, bool) ! (&gt;L:EMER CALL, bool)
  </Click>

</Mouse>

<Element>
   <Select>
    <Value>
    (A:Electrical master battery,bool) 0 == (L:EMER CALL, bool) 1 == and
         if{  0 (&gt;L:EMER CALL, bool) }
   </Value>
   </Select>
</Element>

</Gauge>
 
Or maybe this is more like it...

Code:
<Gauge Name="EMER CALL" Version="1.0">
<Image Name="ON CALL DARK.bmp"/>

<Element>
 <Visible> (A:Electrical master battery,bool)</Visible>
  <Element>
    <Image Name="ON LIGHT.bmp"/>
  </Element>
  <Element>
  <Visible> (L:EMER CALL, bool) 1 == (P:absolute time, number) 1.0 % 0.5 &gt; * </Visible>
    <Image Name="CALL LIGHT.bmp"/>
  </Element>
</Element>

<Mouse>

  <Tooltip>EMER CALL</Tooltip>
  <Cursor Type="Hand"/>
  <Click>
  (L:EMER CALL, bool) ! (&gt;L:EMER CALL, bool)
  </Click>

</Mouse>

<Element>
   <Select>
    <Value>
    (A:Electrical master battery,bool) 0 == (L:EMER CALL, bool) 1 == and
         if{  0 (&gt;L:EMER CALL, bool) }
   </Value>
   </Select>
</Element>

</Gauge>
 
Ok, the blinking is perfect, thank you!

As for the batetry start up, that wasn't the best example for that. Just in general with this code, how could I have it start with OFF DARK when sim starts up and battery is on and everything, I can click it between light and dark, turn the battery off and it goes to OFF DARK again, but default to OFF LIGHT once the battery is turned on, instead of whatever was last active:

1682553387529.png
OFF LIGHT.bmp
1682553400348.png
OFF DARK.bmp

<Gauge Name="ADR 1" Version="1.0">


<Element>
<Position X="0" Y="0" />
<Element>
<Position X="0" Y="0" />
<Select>
<Value>(L:ADR 1, bool) s0 </Value>
<Case Value="0">
<Image Name="OFF LIGHT.bmp"/>
</Case>
<Case Value="1">
<Image Name="OFF DARK.Bmp"/>
</Case>
</Select>
</Element>
</Element>

<Mouse>
<Area Left="0" Top="0" Width="85" Height="85">
<Tooltip>ADR 1</Tooltip>
<Cursor Type="Hand"/>
<Click>
(L:ADR 1, bool) ! (&gt;L:ADR 1, bool)
</Click>
</Area>
</Mouse>

</Gauge>
 
Last edited:
The code below should achieve the results required above.

However, while I believe it will work fine for a dummy switch, it probably will fail miserably if you try at some stage to use the switch to control an aircraft system, eg, Fuel Pump, Ant-Ice or whatever.

In my very limited experience of switches like this, the state of the switch, OFF DARK or OFF LIGHT, should really depend on the state of the system it controls, eg, is the Fuel Pump pumping fuel, is the Anti-Ice heating the wing surface - and not on whether someone has simply pushed the switch.

Let me know if you intend at some stage to control an aircraft system using a switch like this, and the code can be amended as necessary.

Code:
<Gauge Name="ADR 1" Version="1.0">
<Image Name="OFF DARK.bmp"/>

<Element>
 <Visible> (A:Electrical master battery,bool)</Visible>
  <Element>
  <Visible> (L:ADR1, bool) 1 == </Visible>
    <Image Name="OFF LIGHT.bmp"/>
  </Element>
</Element>

<Mouse>

  <Tooltip>ADR1</Tooltip>
  <Cursor Type="Hand"/>
  <Click>
  (L:ADR1, bool) ! (&gt;L:ADR1, bool)
  </Click>

</Mouse>

<Element>
   <Select>
    <Value>
    (A:Electrical master battery,bool) 0 == (L:ADR1, bool) 0 == and
         if{  1 (&gt;L:ADR1, bool) }
   </Value>
   </Select>
</Element>

</Gauge>
 
Last edited:
That is perfect! Thanks mate for all you help - literally life saver!

I agree it would be the goal to have the actual systems being controlled. I'm no expert on how and what order the switches would work in real lief, but then there's also the complication of having fault messages under certain conditions and working together with other swtiches. For me it's all a bit complicated, but you already have a better grasp on this than I do. ;) I'll definitely ask if it comes to that, I just hate making you do all this.

Although, if you want to show me the anti-ice for ENG1 for example so I can see how you would do it.

1682604837103.png
ON DARK.BMP
1682604847144.png
ON BLUE LIGHT.BMP
1682604862232.png
FAULT LIGHT BLUE ON.BMP
1682604880432.png
FAULT LIGHT.BMP
(not sure if it's easier having the lightups together or separate textures, but there are options)

1682604948477.png

This is just here for reference, if the exact switch process isn't possible thats totally fine, basic function is much appreciated too! Thanks!
 

Attachments

  • 1682604877088.png
    1682604877088.png
    1.2 KB · Views: 50
You can try this, for Engine 1.

I find I am not able to use the Switch bmps as attached on your messages, I have to 'do a job' on them to make them show up - something to do with transparency. So I cannot guarantee that the bmps that I use behave in the same way as yours.

I also found that the 737 that I use normally, even though it has Engine Anti Ice, doesn't appear to use the P3D standard commands and variables, but this definitely works on an older version.

If you right-click on the switch the Fault Message will show (just to prove that it is there, I don't think anything is going to trigger it otherwise). Right-click again to remove the fault.

The manual excerpt above mentions that the Fault light comes on briefly while the valve transits - I have no idea as to how long it takes, but you can increase/decrease the time by changing the line 20 (&gt;L:Eng1 Fault Counter,number) to a higher or lower number.

If this code works for Engine 1 then you can replicate the switch for Engines 2, 3 and 4 - simply change anything wirh Eng1 to Eng2, and (A:ENG ANTI ICE:1,bool) to (A:ENG ANTI ICE:2,bool)

Code:
<Gauge Name="Eng1 Anti Ice" Version="1.0">
<Image Name="BLUE ON DARK.bmp"/>

<Element>
 <Visible> (A:Electrical master battery,bool)</Visible>
  <Element>
  <Visible> (A:ENG ANTI ICE:1,bool) 1 == </Visible>
    <Image Name="BLUE ON LIGHT.bmp"/>
  </Element>
  <Element>
  <Visible> (L:Eng1 Anti Ice Fault, bool) 1 == </Visible>
    <Image Name="FAULT LIGHT.bmp"/>
  </Element>
</Element>

<Mouse>

  <Tooltip>EAI1</Tooltip>
  <Cursor Type="Hand"/>
  <Click Kind="LeftSingle+RightSingle">
        (M:Event) 'LeftSingle' scmp 0 ==
                  if{ 1 (&gt;K:ANTI_ICE_TOGGLE_ENG1)
                      1 (&gt;L:Eng1 Anti Ice Fault, bool)
                      20 (&gt;L:Eng1 Fault Counter,number) }
        (M:Event) 'RightSingle' scmp 0 ==
                  if{ (L:Eng1 Anti Ice Fault, bool) ! (&gt;L:Eng1 Anti Ice Fault, bool) }
  </Click>

</Mouse>

<Element>
   <Select>
    <Value>
    (A:Electrical master battery,bool) 0 == (A:ENG ANTI ICE:1,bool) 1 == and
         if{  0 (&gt;K:ANTI_ICE_SET_ENG1)
              0 (&gt;L:Eng1 Anti Ice Fault, bool) }
   </Value>
   </Select>
</Element>

<Element>
   <Select>
    <Value>
    (L:Eng1 Fault Counter,number) 0 &gt;
        if{ (L:Eng1 Fault Counter,number) 1 - (&gt;L:Eng1 Fault Counter,number)
            (L:Eng1 Fault Counter,number) 1 ==
               if{ 0 (&gt;L:Eng1 Anti Ice Fault, bool) } }
   </Value>
   </Select>
</Element>

</Gauge>

Best of luck, Walter
 
You can try this, for Engine 1.

I find I am not able to use the Switch bmps as attached on your messages, I have to 'do a job' on them to make them show up - something to do with transparency. So I cannot guarantee that the bmps that I use behave in the same way as yours.

I also found that the 737 that I use normally, even though it has Engine Anti Ice, doesn't appear to use the P3D standard commands and variables, but this definitely works on an older version.

If you right-click on the switch the Fault Message will show (just to prove that it is there, I don't think anything is going to trigger it otherwise). Right-click again to remove the fault.

The manual excerpt above mentions that the Fault light comes on briefly while the valve transits - I have no idea as to how long it takes, but you can increase/decrease the time by changing the line 20 (&gt;L:Eng1 Fault Counter,number) to a higher or lower number.

If this code works for Engine 1 then you can replicate the switch for Engines 2, 3 and 4 - simply change anything wirh Eng1 to Eng2, and (A:ENG ANTI ICE:1,bool) to (A:ENG ANTI ICE:2,bool)

Code:
<Gauge Name="Eng1 Anti Ice" Version="1.0">
<Image Name="BLUE ON DARK.bmp"/>

<Element>
 <Visible> (A:Electrical master battery,bool)</Visible>
  <Element>
  <Visible> (A:ENG ANTI ICE:1,bool) 1 == </Visible>
    <Image Name="BLUE ON LIGHT.bmp"/>
  </Element>
  <Element>
  <Visible> (L:Eng1 Anti Ice Fault, bool) 1 == </Visible>
    <Image Name="FAULT LIGHT.bmp"/>
  </Element>
</Element>

<Mouse>

  <Tooltip>EAI1</Tooltip>
  <Cursor Type="Hand"/>
  <Click Kind="LeftSingle+RightSingle">
        (M:Event) 'LeftSingle' scmp 0 ==
                  if{ 1 (&gt;K:ANTI_ICE_TOGGLE_ENG1)
                      1 (&gt;L:Eng1 Anti Ice Fault, bool)
                      20 (&gt;L:Eng1 Fault Counter,number) }
        (M:Event) 'RightSingle' scmp 0 ==
                  if{ (L:Eng1 Anti Ice Fault, bool) ! (&gt;L:Eng1 Anti Ice Fault, bool) }
  </Click>

</Mouse>

<Element>
   <Select>
    <Value>
    (A:Electrical master battery,bool) 0 == (A:ENG ANTI ICE:1,bool) 1 == and
         if{  0 (&gt;K:ANTI_ICE_SET_ENG1)
              0 (&gt;L:Eng1 Anti Ice Fault, bool) }
   </Value>
   </Select>
</Element>

<Element>
   <Select>
    <Value>
    (L:Eng1 Fault Counter,number) 0 &gt;
        if{ (L:Eng1 Fault Counter,number) 1 - (&gt;L:Eng1 Fault Counter,number)
            (L:Eng1 Fault Counter,number) 1 ==
               if{ 0 (&gt;L:Eng1 Anti Ice Fault, bool) } }
   </Value>
   </Select>
</Element>

</Gauge>

Best of luck, Walter
Got another question, how would I go about rotating a whole gauge (like all the elements) say 90 degrees.
 
You would want to show us what gauge it was and what exactly is required...
The way it is oriented on the texture sheet is what's causing it to be rotated. Need it rotated 90 degrees to the right.

Here is the code:

<Gauge Name="ENG 1 FIRE AGENT" Version="1.0"> <Element> <Position X="0" Y="0" /> <Element> <Position X="0" Y="0" /> <Select> <Value>(A:CIRCUIT GENERAL PANEL ON, bool) 1 == if{ (A:FIRE BOTTLE DISCHARGED:1,bool) 2 * (A:FIRE BOTTLE SWITCH:1,bool) + } els{ 0 }</Value> <Case Value="0"> <Image Name="DISCH DARK.bmp"/> </Case> <Case Value="1"> <Image Name="SQUIB LIGHT UPPER.Bmp"/> </Case> <Case Value="2"> <Image Name="DISCH LIGHT.Bmp"/> </Case> <Case Value="3"> <Image Name="DISCH LIGHT SQUIB.Bmp"/> </Case> </Select> </Element> </Element> <Mouse> <Area Left="0" Top="0" Width="85" Height="85"> <Tooltip>ENG 1 FIRE AGENT</Tooltip> <Cursor Type="Hand"/> <Click> 11 (&gt;K:EXTINGUISH_ENGINE_FIRE) </Click> </Area> </Mouse> </Gauge>
 

Attachments

  • Screenshot 2023-05-01 071718.png
    Screenshot 2023-05-01 071718.png
    337.9 KB · Views: 58
I'm afraid I am a little bit lost in this case, and probably of little use to you, because I have no idea what a texture sheet is or where it comes into this - I have never used one.

Do you not have a number of bmps depicting the Agent switch options, one each for DISCH DARK, SQUIB LIGHT UPPER and DISCH LIGHT?

If you do, then why not simply rotate them in an editor?

Or is this all to do with the fact that this appears in a VC?

Wow, life gets complicated, don't it?

(Looking at the A340 Panel in Google and how the Fire Protection System works:

DISCH DARK is the background bmp, nothing illuminated

SQUIB LIGHT UPPER, with a white SQUIB illuminated, shows when the Fire Button for that engine is pressed

DISCH LIGHT, with DISCH illuminated, would show when the Agent button has been pressed.

Without the texture sheet complication, this switch would probably be an easy one to implement - though I probably would never have thought or dared to use the complicated formula in the Value clause. )
 
Back
Top