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

FSXA Animations/XML help

euroastar350

Resource contributor
Messages
863
Country
us-delaware
Guys,

I am on home stretch with my Bell 206 project, but I have 2 issues with 2 animated 3D knobs. I have the XML set in the modeldef doc and I can get a hand symbol im sim, but they will not animate. Here are the 2 part codes I am using:

Code:
<PartInfo>
<Name>ADF_Card</Name>
<AnimLength>100</AnimLength>
	<Animation>
	<Rotation>Z</Rotation>
		<Parameter>
			<Sim>
				<Variable>ADF CARD</Variable>
				<Units>Grads</Units>
				<Bias>50</Bias>
				<Scale>1</Scale>
			</Sim>
		</Parameter>
	</Animation>
	<MouseRect>
		<Cursor>Hand</Cursor>
		<HelpID>HELPID_GAUGE_ADF</HelpID>
		<MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown+DownRepeat</MouseFlags>
		<CallbackJumpDragging>
                  <YMovement>
		    <Delta>-3</Delta>
		    <EventIDInc>ADF_CARD_INC</EventIDInc>
		    <EventIDDec>ADF_CARD_DEC</EventIDDec>
		  </YMovement>
		</CallbackJumpDragging>
	</MouseRect>
</PartInfo>

Code:
<PartInfo>
<Name>OBS2_key</Name>
<AnimLength>100</AnimLength>
	<Animation>
	<Rotation>Z</Rotation>
		<Parameter>
			<Sim>
				<Variable>NAV OBS</Variable>
				<Units>Grads</Units>
				<Bias>50</Bias>
				<Scale>1</Scale>
			</Sim>
		</Parameter>
	</Animation>
	<MouseRect>
		<Cursor>Hand</Cursor>
		<HelpID>HELPID_GAUGE_VOR2_OBS2</HelpID>
		<MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown+DownRepeat</MouseFlags>
		<CallbackJumpDragging>
                  <YMovement>
		    <Delta>-3</Delta>
		    <EventIDInc>VOR2_OBI_INC</EventIDInc>
		    <EventIDDec>VOR2_OBI_DEC</EventIDDec>
		  </YMovement>
		</CallbackJumpDragging>
	</MouseRect>
</PartInfo>


Once I have these 2 parts animated and fully working in sim, I can relax and get the Bell 206 finished and ready for release. Any help is appreciated.
 
re write both so they use M:Events....This Vor works here:

Code:
  <PartInfo>
    <Name>switch_course_select</Name>
    <AnimLength>50</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (L:switch_course_select) 25 * 25 +
        </Code>
      </Parameter>
    </Animation>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <HelpID>HELPID_GAUGE_VOR1_OBS</HelpID>
      <TooltipID>TOOLTIPTEXT_COURSE_SELECT</TooltipID>
      <MouseFlags>WheelUp+WheelDown+LeftDrag+LeftSingle+MoveRepeat+LeftRelease</MouseFlags>
      <CallbackCode>
        (M:Event) 'LeftSingle'  scmi 0 == if{ (>K:VOR1_OBI_DEC) }
        (M:Event) 'RightSingle'  scmi 0 == if{ (>K:VOR1_OBI_INC) }
        (M:Event) 'WheelUp'     scmi 0 == if{ (>K:VOR1_OBI_INC) }
        (M:Event) 'WheelDown'   scmi 0 == if{ (>K:VOR1_OBI_DEC) }
      </CallbackCode>
    </MouseRect>
  </PartInfo>

DG:cool:
 
Last edited:
Also,

On the first one you have Z rotation and in the mouse section Y movement. But it could just be the controls differences you require, just thought it might be a typo.
 
If you search modeldef for <rotation> you get no hits, at least I do not.

Not sure what it would do anyway.

Roy
 
Rotation tags aren't supported in FSX...
Delete "<Rotation>Z</Rotation>" and try it out.
 
Okay, I get a movement on the gauge and not on the 3D part itself. How many keyframes are used when animating the part itself and in which direction? Sorry for all the questions, still pulling my hair while figuring out this XML stuff:D
 
The ADF CARD variable units are degrees and (whatever it is) it will rotate through 360 degrees so the best way to animate it is with 360 frames at say 90 degree intervals. The rotation direction should be obvious, but try one and if it is wrong, do the same with reversed sign. No need to use grads. Use the same for the knob. ADF CARD is not included in modeldef so you need to make a custom entry.

The NAV OBS variable also uses degrees. It can be controlled by the standard modeldef "knob_nav_obs" and I would recommend using that for simplicity, since it works.

In neither case do you need bias.

While you can use <sim></Sim> inside the <Parameter></Parameter> section, you should probably use <Code></Code> like the "knob_nav_obs" example.

Best thing to do in my opinion is to find a modeldef section that looks like what you want to achieve and take it from there, always remembering that any new section also needs a declaration statement with a new GUID, similar to:
Code:
<Animation name="knob_nav_obs" guid="75187b85-3b38-49b9-943b-d04471d7c31a" length="360" type="Sim" typeParam2="knob_nav_obs" typeParam="AutoPlay"/>

Put another way, it is a lot easier to copy and modify something in modeldef that works in FSX or FSXA than try to convert something from FS9.

Roy
 
Okay, this is the code I have now....problem is that the part will not move in sim, even though it is animated from 0-100. Any ideas:confused:

Code:
<PartInfo>
<Name>OBS2_Key</Name>
<AnimLength>100</AnimLength>
	<Animation>
	<Parameter>
	    <Code>(A:NAV1 OBS, degrees) 10 * dnor</Code>
        </Parameter>
	</Animation>
	<MouseRect>
		<Cursor>Hand</Cursor>
		<HelpID>HELPID_GAUGE_VOR2_OBS2</HelpID>
	<MouseFlags>WheelUp+WheelDown+LeftDrag+LeftSingle+MoveRepeat+LeftRelease</MouseFlags>
      <CallbackCode>
        (M:Event) 'LeftSingle'  scmi 0 == if{ (>K:VOR1_OBS_DEC) }
        (M:Event) 'RightSingle'  scmi 0 == if{ (>K:VOR1_OBS_INC) }
        (M:Event) 'WheelUp'     scmi 0 == if{ (>K:VOR1_OBS_INC) }
        (M:Event) 'WheelDown'   scmi 0 == if{ (>K:VOR1_OBS_DEC) }
      </CallbackCode>
    </MouseRect>
</PartInfo>
 
<AnimLength>360</AnimLength>

keyframes: 0 - 90 - 180 - 270 - 360
 
If this is for NAV2, then the code needs to be
Code:
<Code>(A:NAV2 OBS, degrees) 10 * dnor</Code>

or
Code:
<Code>(A:NAV OBS:2, degrees) 10 * dnor</Code>

Roy
 
Try this:

Code:
<Animation name="OBS2_Key" guid="75187b85-3b38-49b9-943b-d04471d7c31a" length="360" type="Sim" typeParam2="OBS2_Key" typeParam="AutoPlay"/>

Code:
<PartInfo>
<Name>OBS2_Key</Name>
<AnimLength>360</AnimLength>
	<Animation>
	<Parameter>
	    <Code>(A:NAV OBS:2, degrees) 36 * 180 /</Code>
        </Parameter>
	</Animation>
	<MouseRect>
		<Cursor>Hand</Cursor>
		<HelpID>HELPID_GAUGE_VOR2_OBS2</HelpID>
	<MouseFlags>WheelUp+WheelDown+LeftDrag+LeftSingle+MoveRepeat+LeftRelease</MouseFlags>
      <CallbackCode>
        (M:Event) 'LeftSingle'  scmi 0 == if{ (>K:VOR2_[COLOR="Red"]OBI[/COLOR]_DEC) }
        (M:Event) 'RightSingle'  scmi 0 == if{ (>K:VOR2_[COLOR="Red"]OBI[/COLOR]_INC) }
        (M:Event) 'WheelUp'     scmi 0 == if{ (>K:VOR2_[COLOR="Red"]OBI[/COLOR]_INC) }
        (M:Event) 'WheelDown'   scmi 0 == if{ (>K:VOR2_[COLOR="Red"]OBI[/COLOR]_DEC) }
      </CallbackCode>
    </MouseRect>
</PartInfo></Code>

They set up fsx OBS with OBI for the DEC and INC

DG:cool:
 
Last edited:
Yep. Spelling mistake in FSX... That one always gets me.

The same commands were used in FS8 and FS9.

OBI = Omni-bearing Indicator
OBS = Omni-bearing Selector

Technically, OBI is the device itself, and the OBS is the knob which "selects" the desired radial!

See:
http://www.pilotfriend.com/training/flight_training/nav/vor.htm

and
http://en.wikipedia.org/wiki/VHF_omnidirectional_range

In essence, FS simply has the two acronyms reversed. The A:var should have been OBI and the K:event should have been OBS... :D
 
Ah, of course - hadn't thought of the difference between the two, actually... It just looks like a mistake because one variable does it one way and one variable does it another.
 
Back
Top