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

Need some XML animation code help (custom modeldef.xml entry)

Messages
2
Country
unitedstates
I've got two little bits of custom XML animation tag code that I'm trying to get working and they're driving me crazy.

The first one is a simple mechanical angle-of-attack vane mounted on the nose pitot. Originally I had it set up to use the AOA needle code, but it was always parallel to the ground. It should always be pointing in the direction of travel. I've tried to do that using forward and vertical speed to derive a 2D vector and then taking the arctangent and adjusting it to a 0-180 range instead of -90 to 90, but I'm having a heck of a time getting the atg operator to work.

The AOA vane object is keyed from 0-180, with 0 straight down and 180 straight up. I'm not worried about the 180 degree arc to the rear, so I just blocked out negative values of horizontal momentum by taking the absolute value (the plane should never be falling or climbing backwards, anyhow). Here's the code I have so far...

Code:
<PartInfo>
	<Name>needle_pitch_vane</Name>
	<AnimLength>180</AnimLength>
	<Animation>
		<Parameter>
			<Code>((A:VELOCITY BODY Y, ft/sec) ((A:VELOCITY BODY Z, ft/sec) abs) /) atg rddg 90 +</Code>
		</Parameter>
	</Animation>
  </PartInfo>

At first I didn't have the rddg (radians to degrees) operator in there, but all the other trig functions output in rads and I'm guessing atg does as well. The problem is I'm guessing it also needs input in radians like the other trig functions, and I need it to give me the arctangent of the slope of the line (vert speed)/(absolute value of(horiz speed)). I don't know quite enough trig to take the two speed vectors and do my computations with a result in radians to make the atg operator happy.


The other animation I'm trying to do just needs to take a 100 frame loop and scale up the animation speed based on airspeed, so the faster the aircraft goes, the faster the animation loops. I tried using the fly_wheel animation tag but it doesn't seem to be functional.

Any help would be fantastic. Thanks in advance!
 
The other animation I'm trying to do just needs to take a 100 frame loop and scale up the animation speed based on airspeed, so the faster the aircraft goes, the faster the animation loops. I tried using the fly_wheel animation tag but it doesn't seem to be functional.

Any help would be fantastic. Thanks in advance!
Hi
Cant help with the first question but try this for teh 2nd one
Code:
<PartInfo>
    <Name>speed_adim</Name>
    <AnimLength>100</AnimLength>
    <Animation>
    <Parameter>
        <Code>
           (A:Airspeed select indicated or true,degrees per second) (E:ABSOLUTE TIME, second) * 360 % 3.6 /
        </Code>
    </Parameter>
    </Animation>
  </PartInfo>
note wind speed will also effect it, so if your sitting on the ground with a 30knt wind it will rotate ;)
Wozza
 
Hi
Cant help with the first question but try this for teh 2nd one
Code:
<PartInfo>
    <Name>speed_adim</Name>
    <AnimLength>100</AnimLength>
    <Animation>
    <Parameter>
        <Code>
           (A:Airspeed select indicated or true,degrees per second) (E:ABSOLUTE TIME, second) * 360 % 3.6 /
        </Code>
    </Parameter>
    </Animation>
  </PartInfo>
note wind speed will also effect it, so if your sitting on the ground with a 30knt wind it will rotate ;)
Wozza

Awesome, thank you Wozza!
 
Back
Top