1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HDG and CRS knob for FS2004

Discussion in 'Modeling' started by Jakes, 30/8/10.

  1. Jakes

    Jakes

    Joined:
    11/8/10
    Messages:
    241
    Country:
    southafrica
    Can anyone help me with a xml script for animated HDG and CRS knobs for my VC? Cant find any in the MakeMDL sdk

    Thanks!
  2. n4gix

    n4gix Resource contributor

    Joined:
    26/9/06
    Messages:
    9,389
    Country:
    unitedstates
    I'm not including the <Animation...GUID.../> entry, as you can figure that out easily enough! ;)

    In the code below, left-click, right-click, mouse wheel are supported. Wheel-click will synch the heading bug with the current heading of the a/c...

    The OBS knob's code will adjust either input from the NAV1 or NAV2 radio.

    Code:
      <PartInfo>
        <Name>HDG_Knob</Name>
        <AnimLength>360</AnimLength>
        <Animation>
          <Parameter>
            <Code>(A:AUTOPILOT HEADING LOCK DIR, radians) 6 *</Code>
          </Parameter>
        </Animation>
        <MouseRect>
          <Cursor>Hand</Cursor>
          <TooltipID>TOOLTIPTEXT_AUTOPILOT_HEADING_INDICATOR</TooltipID>
          <MouseFlags>LeftSingle+MiddleSingle+RightSingle+WheelUp+WheelDown+DownRepeat</MouseFlags>
          <CallbackCode>
            (M:Event) 'LeftSingle'  scmi 0 == if{ (&gt;K:HEADING_BUG_DEC) }
            (M:Event) 'RightSingle' scmi 0 == if{ (&gt;K:HEADING_BUG_INC) }
            (M:Event) 'WheelUp'     scmi 0 == if{ (&gt;K:HEADING_BUG_INC) }
            (M:Event) 'WheelDown'   scmi 0 == if{ (&gt;K:HEADING_BUG_DEC) }
            (M:Event) 'MiddleSingle' scmi 0 == if{ (A:Plane heading degrees gyro,degrees)  (&gt;K:HEADING_BUG_SET) }
          </CallbackCode>
        </MouseRect>
      </PartInfo>
    
      <PartInfo>
        <Name>HSI_knob_OBS</Name>
        <AnimLength>360</AnimLength>
        <Animation>
          <Parameter>
            <Code>
              (L:HSI_NAV,bool) !
              if{ (A:NAV1 OBS, degrees) 10 * dnor }
              els{ (A:NAV2 OBS, degrees) 10 * dnor }
            </Code>
          </Parameter>
        </Animation>
        <MouseRect>
          <Cursor>Hand</Cursor>
          <HelpID>HELPID_GAUGE_VOR1_OBS </HelpID>
          <TooltipID>TOOLTIPTEXT_COURSE_SELECT</TooltipID>
          <MouseFlags>LeftSingle+MiddleSingle+RightSingle+WheelUp+WheelDown+DownRepeat</MouseFlags>
          <CallbackCode>
            (L:HSI_NAV,bool) !
            if{
            (M:Event) 'LeftSingle'  scmi 0 == if{ (&gt;K:VOR1_OBI_DEC) }
            (M:Event) 'RightSingle' scmi 0 == if{ (&gt;K:VOR1_OBI_INC) }
            (M:Event) 'WheelUp'     scmi 0 == if{ (&gt;K:VOR1_OBI_INC) }
            (M:Event) 'WheelDown'   scmi 0 == if{ (&gt;K:VOR1_OBI_DEC) }
            }
            els{
            (M:Event) 'LeftSingle'  scmi 0 == if{ (&gt;K:VOR2_OBI_DEC) }
            (M:Event) 'RightSingle' scmi 0 == if{ (&gt;K:VOR2_OBI_INC) }
            (M:Event) 'WheelUp'     scmi 0 == if{ (&gt;K:VOR2_OBI_INC) }
            (M:Event) 'WheelDown'   scmi 0 == if{ (&gt;K:VOR2_OBI_DEC) }
            }
          </CallbackCode>
        </MouseRect>
      </PartInfo>
    
  3. Jakes

    Jakes

    Joined:
    11/8/10
    Messages:
    241
    Country:
    southafrica
    Thank you very much! Appreciate it really!
  4. brodhaq

    brodhaq

    Joined:
    18/9/10
    Messages:
    177
    Country:
    czechrepublic
    Hello. Please tell me, how to you use this code writen above? Lets say, that I want to do a heading knob. Not found in SDK as keyframed part name, so I do sucha a code. But where to pace it? Somewhere during export to .mdl? But how? I am using FSDS and its internal export to FS feature, which doesnt allow me to insert any code.

    Thanx for info

    Pavel
  5. n4gix

    n4gix Resource contributor

    Joined:
    26/9/06
    Messages:
    9,389
    Country:
    unitedstates
    FSDS has a rather convoluted way of implementing custom XML scripts, but in every case you do have to add the scripts in to the modeldef.xml file...

    Someone who actually uses FSDS will have to explain the rest, 'cause I don't use it myself! ;)

Share This Page