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

1 (>K:TOGGLE_TAXI_LIGHTS)
(1) does not assign a value to the event and does not pass it to the dependent variable. I also described to you how TOGGLE events work. In fact, this is a button and when pressed once, if the variable is FALSE, it will switch to TRUE and when pressed again, TRUE will switch to FALSE.

In the first position, you press ('TOGGLE') and turn on the taxi lights, in the second position, press('TOGGLE') again and of course you turn off the taxi lights
 
My 2D switch for a Taxi/TakeOff Light Switch would have included this code in both places if the Options are "None, Taxi, TakeOff":

Code:
<!-- Turn off taxi and landing lights  -->
                      (L:switch_taxi_takeoff,number) 0 ==
                          if{ (A:LIGHT TAXI, bool) 1 == if{ 0 (&gt;K:TOGGLE_TAXI_LIGHTS) }
                               0 (&gt;L:LIGHT_TAKEOFF, bool) }
  <!-- Turn on taxi lights and turn off landing lights  -->
                      (L:switch_taxi_takeoff,number) 1 ==
                          if{ (A:LIGHT TAXI, bool) 0 == if{ 0 (&gt;K:TOGGLE_TAXI_LIGHTS) }
                               0 (&gt;L:LIGHT_TAKEOFF, bool) }
  <!-- Turn off taxi lights and turn on landing lights  -->
                      (L:switch_taxi_takeoff,number) 2 ==
                          if{ (A:LIGHT TAXI, bool) 1 == if{ 0 (&gt;K:TOGGLE_TAXI_LIGHTS) }
                               1 (&gt;LIGHT_TAKEOFF, bool)  }

Or if the Options are "None, Taxi, Taxi+TakeOff":

Code:
<!-- Turn off taxi and landing lights  -->
                      (L:switch_taxi_takeoff,number) 0 ==
                          if{ (A:LIGHT TAXI, bool) 1 == if{ 0 (&gt;K:TOGGLE_TAXI_LIGHTS) }
                               0 (&gt;L:LIGHT_TAKEOFF, bool) }
  <!-- Turn on taxi lights and turn off landing lights  -->
                      (L:switch_taxi_takeoff,number) 1 ==
                          if{ (A:LIGHT TAXI, bool) 0 == if{ 0 (&gt;K:TOGGLE_TAXI_LIGHTS) }
                               0 (&gt;L:LIGHT_TAKEOFF, bool) }
  <!-- Turn on taxi lights and turn on landing lights  -->
                      (L:switch_taxi_takeoff,number) 2 ==
                          if{ (A:LIGHT TAXI, bool) 0 == if{ 0 (&gt;K:TOGGLE_TAXI_LIGHTS) }
                               1 (&gt;LIGHT_TAKEOFF, bool)  }

Walter
 
Heres my latest update:
This has got me close to doing exactly what I want, the only part now is I'm stuck getting the rightsingle to do the reverse order of the left single. But the leftsingle works (ie. 0 is off, 1 is taxi lights and 2 is taxi+takeoff):

<PartInfo> <Name>switch_taxi_takeoff_330</Name> <AnimLength>50</AnimLength> <Animation> <Parameter> <Code> (L:switch_taxi_takeoff_330, enum) 0 == if{ 0 } (L:switch_taxi_takeoff_330, enum) 1 == if{ 25 } (L:switch_taxi_takeoff_330, enum) 2 == if{ 50 } </Code> <Lag>400</Lag> </Parameter> </Animation> <MouseRect> <Cursor>Hand</Cursor> <TooltipText>Annunciator Light Switch</TooltipText> <MouseFlags>WheelDown+WheelUp+LeftSingle+RightSingle</MouseFlags> <CallbackCode> (M:Event) 'LeftSingle' scmp 0 == (M:Event) 'WheelDown' scmp 0 == or if{ (L:switch_taxi_takeoff_330, enum) ++ s0 2 &gt; if{ 0 } els{ l0 } (&gt;L:switch_taxi_takeoff_330, enum) (L:switch_taxi_takeoff_330, enum) (L:switch_taxi_takeoff_330, enum) 1 == if{ 1 (&gt;K:TOGGLE_TAXI_LIGHTS) 0 (&gt;L:LIGHT_TAKEOFF) } (L:switch_taxi_takeoff_330, enum) 2 == if{ 1 (&gt;A:LIGHT TAXI) 1 (&gt;L:LIGHT_TAKEOFF) } } (M:Event) 'RightSingle' scmp 0 == (M:Event) 'WheelUp' scmp 0 == or if{ (L:switch_taxi_takeoff_330, enum) -- s0 2 &lt; if{ 2 } els{ l0 } (&gt;L:switch_taxi_takeoff_330, enum) (L:switch_taxi_takeoff_330, enum) (L:switch_taxi_takeoff_330, enum) 1 == if{ 1 (&gt;K:TOGGLE_TAXI_LIGHTS) 0 (&gt;L:LIGHT_TAKEOFF) } (L:switch_taxi_takeoff_330, enum) 2 == if{ 1 (&gt;A:LIGHT TAXI) 1 (&gt;L:LIGHT_TAKEOFF) } } </CallbackCode> </MouseRect> </PartInfo>
 
Adrian,

I have no idea how that code fulfills all of the requirements, beats me!

However, it looks like the condition for reverse should be (L:switch_taxi_takeoff_330, enum) -- s0 0 &lt; if{ 2 } els{ l0 }

Walter
 
Its perfect!! It's done! Thanks you guys!
Edit ok almost. this is the final code, last question is it possible to prevent the left+right singles from clicking is that makes sense. For example can I make it so I can only (switch up) turn on the lights using the left click and only switch down with right click. Right now I can also start by right clicking but it would go out of order. If not no problem, I'm very happy with how it came together anyways

<PartInfo> <Name>switch_taxi_takeoff_330</Name> <AnimLength>50</AnimLength> <Animation> <Parameter> <Code> (L:switch_taxi_takeoff_330, enum) 0 == if{ 0 } (L:switch_taxi_takeoff_330, enum) 1 == if{ 25 } (L:switch_taxi_takeoff_330, enum) 2 == if{ 50 } </Code> <Lag>400</Lag> </Parameter> </Animation> <MouseRect> <Cursor>Hand</Cursor> <TooltipText>Annunciator Light Switch</TooltipText> <MouseFlags>WheelDown+LeftSingle+RightSingle</MouseFlags> <CallbackCode> (M:Event) 'LeftSingle' scmp 0 == (M:Event) 'WheelDown' scmp 0 == or if{ (L:switch_taxi_takeoff_330, enum) ++ s0 2 &gt; if{ 0 } els{ l0 } (&gt;L:switch_taxi_takeoff_330, enum) (L:switch_taxi_takeoff_330, enum) (L:switch_taxi_takeoff_330, enum) 1 == if{ 1 (&gt;K:TOGGLE_TAXI_LIGHTS) 0 (&gt;L:LIGHT_TAKEOFF) } (L:switch_taxi_takeoff_330, enum) 2 == if{ 1 (&gt;A:LIGHT TAXI) 1 (&gt;L:LIGHT_TAKEOFF) } } (M:Event) 'RightSingle' scmp 0 == (M:Event) 'WheelDown' scmp 0 == or if{ (L:switch_taxi_takeoff_330, enum) -- s0 0 &lt; if{ 2 } els{ l0 } (&gt;L:switch_taxi_takeoff_330, enum) (L:switch_taxi_takeoff_330, enum) 0 == if{ 1 (&gt;K:TOGGLE_TAXI_LIGHTS) 0 (&gt;L:LIGHT_TAKEOFF) } (L:switch_taxi_takeoff_330, enum) 1 == if{ 1 (&gt;A:LIGHT TAXI) 0 (&gt;L:LIGHT_TAKEOFF) } (L:switch_taxi_takeoff_330, enum) 2 == if{ 1 (&gt;A:LIGHT TAXI) 1 (&gt;L:LIGHT_TAKEOFF) } } </CallbackCode> </MouseRect> </PartInfo>
 
Last edited:
Adrian,

1 (&gt;A:LIGHT TAXI) is definitely wrong coding (as far as I know). Either an L: or a K:, but not an A:.

(L:switch_taxi_takeoff_330, enum) 0 == if{ 1 (&gt;K:TOGGLE_TAXI_LIGHTS) 0 (&gt;L:LIGHT_TAKEOFF) } is used in the second iteration but only (L:switch_taxi_takeoff_330, enum) in the first.

I never really understood what this construction does (L:switch_taxi_takeoff_330, enum) -- s0 0 &lt; if{ 2 } els{ l0 } (&gt;L:switch_taxi_takeoff_330, enum), or how it does it, but maybe your problem lies in it.

Walter
 
😅Yes that I know too, but A: worked. I replaced it with L: and that works too. But ya I don't fully understand a lot of how this works either (obviously). Anyways, while probably not perfect, the switch works mostly how i want it so I'm pleased. Thanks for all the input!
 
Yes that I know too, but A: worked.
This is not true, you cannot change the local variable A:LIGHT TAXIvia XML code. By writing 1 (>A:LIGHT TAXI)you have simply removed the condition and variable control from the code. It’s completely wrong to write code this way and it doesn’t work. In general, remove 1 (>A:LIGHT TAXI) from the code.
XML:
      (M:Event) 'LeftSingle' scmp 0 ==
      (M:Event) 'WheelDown' scmp 0 == or
      if{
        (L:switch_taxi_takeoff_330, enum) ++ s0 2 &gt; if{ 0 } els{ l0 }
        (&gt;L:switch_taxi_takeoff_330, enum)
        (L:switch_taxi_takeoff_330, enum)

        (L:switch_taxi_takeoff_330, enum) 1 == if{ 1 (&gt;K:TOGGLE_TAXI_LIGHTS) 0 (&gt;L:LIGHT_TAKEOFF) } <!-- Turn on taxi and landing switch off lights  -->

        (L:switch_taxi_takeoff_330, enum) 2 == if{ 1 (&gt;A:LIGHT TAXI) 1 (&gt;L:LIGHT_TAKEOFF) } <!-- Turn on landing  lights switch, (1 (&gt;A:LIGHT TAXI) - inop) -->
      }
      (M:Event) 'RightSingle' scmp 0 ==
      (M:Event) 'WheelDown' scmp 0 == or
      if{
        (L:switch_taxi_takeoff_330, enum) -- s0 0 &lt; if{ 2 } els{ l0 }
        (&gt;L:switch_taxi_takeoff_330, enum)
        (L:switch_taxi_takeoff_330, enum) 0 == if{ 1 (&gt;K:TOGGLE_TAXI_LIGHTS) 0 (&gt;L:LIGHT_TAKEOFF) } <!-- Turn off taxi and landing switch off lights  -->
        (L:switch_taxi_takeoff_330, enum) 1 == if{ 1 (&gt;A:LIGHT TAXI) 0 (&gt;L:LIGHT_TAKEOFF) } <!-- Turn landing switch off lights, 1 (&gt;A:LIGHT TAXI) - inop -->
        (L:switch_taxi_takeoff_330, enum) 2 == if{ 1 (&gt;A:LIGHT TAXI) 1 (&gt;L:LIGHT_TAKEOFF) } <!-- Turn landing switch on lights, 1 (&gt;A:LIGHT TAXI) - inop -->
      }
 
Last edited:
Back
Top