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

FSX XML: Transponder Setting

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
For some reason ACES provided a key event for setting the 4th digit of the transponder with a "carry" function, but didn't provide one for setting the 2nd digit...

...which is a real PITA if one only has two knobs for setting the XPDR code!

So, here's one solution for that missing key event. When incrementing the 2nd digit, upon reaching a count of 7, the very next "click" will increment the 1st digit. Similarly, when decrementing the 2nd digit, upon reaching a count of 0, the very next "click" will decrement the 1st digit:

Code:
  <PartInfo>
    <Name>B737_XPDR_100s</Name>
    <AnimLength>9</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (A:TRANSPONDER CODE:1,number) 1000 % 100 / flr (>L:XPDR_100_Count,enum)
        </Code>
      </Parameter>
      <Lag>30</Lag>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown</MouseFlags>
      <CallbackCode>
        (M:Event) 'LeftSingle'  scmi 0 ==
        (M:Event) 'WheelUp'     scmi 0 == or
        if{
        (>K:XPNDR_100_INC)
        (L:XPDR_100_Count,enum) 7 == if{ (>K:XPNDR_1000_INC) }
        }

        (M:Event) 'RightSingle' scmi 0 ==
        (M:Event) 'WheelDown'   scmi 0 == or
        if{
        (>K:XPNDR_100_DEC)
        (L:XPDR_100_Count,enum) 0 == if{ (>K:XPNDR_1000_DEC) }
        }
        1 (>L:XMLSND1,bool)
      </CallbackCode>
    </MouseRect>
  </PartInfo>
 
No problem. It's just something I had to do myself, so I figured there's no point in not sharing the script.

One could use the same technique for the 3rd and 4th digits, since the _CARRY event carries forward to the 2nd and 1st digits as well... :rolleyes:
 
Back
Top