• 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 Mach indicator

Messages
218
Country
greece
f4-mach-airspeed.jpg

I'm trying to make the seen instrument. The operation is as follows:
-A single needle is used to indicate IAS and mach.
-The mach scale starts at 0.4M/258kts.
-Depending on Inlet Air Temperature and other outside factors, the dial rotates so that the IAS needle also shows the correct mach number

What I've thought of doing is associate mach number at a given speed (say 250kts) and calculate what this value would be at different altitudes.
This means that I would animate/tag it with the altimeter needle animation.
The problem with using this is that if the user plays around with the Kohlsman settings, he'll also move the mach dial.

So, is there an absolute altitude variable I can use that is independent of the Kohlsman setting?

I've found a few in the SimVars document, but I'm not sure if they're what I need (STRUCT LATLONALT, PLANE ALTITUDE). If someone has an idea, please let me know.
 
Last edited:
(A:PLANE ALT ABOVE GROUND, feet) (A:GROUND ALTITUDE,feet) +

This should give you an explicit value (from sea level).



Also, what's wrong with (A:AIRSPEED MACH, mach)?
 
Nothing, really...

This is what I use for the Mach dial. I "calibrate" it via keyframes in Max/GMax:

Code:
  <PartInfo>
    <Name>B737_needle_asi_mach</Name>
    <AnimLength>120</AnimLength>
    <Animation>
      <Parameter>
        <Code>
          (A:AIRSPEED MACH,mach) 100 *
        </Code>
      </Parameter>
    </Animation>
  </PartInfo>
 
Also, what's wrong with (A:AIRSPEED MACH, mach)?

I cannot calibrate it as both the needle and Mach readouts are moving at the same time. So I'll animate the mach scale in relation to absolute altimeter. This way the needle will show a good approximate of the true Mach -as good as an analog instrument can be.
 
I cannot calibrate it as both the needle and Mach readouts are moving at the same time. So I'll animate the mach scale in relation to absolute altimeter. This way the needle will show a good approximate of the true Mach -as good as an analog instrument can be.

Umm...why not simply animate the readout with a different animation tag and thus calibration?

Keeping it simple and stuff.
 
You just want the bit of the disc with the right Mach number at the end of the needle. This is easier if you attach the disc to the needle and animate it accordingly.
 
At sea level, the IAS and Mach agree with this instrument. This means that the Mach scale does not rotate. The needle will give IAS and the correct Mach.
As altitude increases, the Mach scale should rotate counterclockwise which means that the IAS for a given Mach number will be less.
Code:
<!-- ======================= Mach===================== -->
	<Element>
		<Select>
			<Value>(A:INDICATED ALTITUDE, feet) 1000 / -3.75 * 518.7 + sqrt 0.044 * (>L:MACHSHIFT_A,number)</Value>
		</Select>
	</Element>
	<Element>
		<Select>
			<Value>(A:SIGMA SQRT,number) (L:MACHSHIFT_A,number) * (>L:MACHSHIFT_B,number)</Value>
		</Select>
	</Element>
	<Element>
		<Select>
			<Value>(L:MACHSHIFT_B,number) 1 - -1.0 * (>L:MACHSHIFT,number)</Value>
		</Select>
	</Element>
Above is the code I used for this instrument in an A-7D. The first expression gives the change of Mach with altitude as TAS. The second expression converts TAS to IAS and the third deals with the rotation direction.
Animation uses L:Machshift,number.

Roy
 
I think that will help.
Another one that came up.
I'm making a needle that shows positive AOA from 0 to 30 degrees. The needle is stuck at 1 degree AoA.
Code:
      <PartInfo>
        <Name>needle_AOA_indexer</Name>
        <AnimLength>90</AnimLength>
        <Animation>
            <Parameter>
                <Code>
		  (A:INCIDENCE ALPHA) 0 &gt; if{(A:INCIDENCE ALPHA) 3 *}
                </Code>
            </Parameter>
        </Animation>
    </PartInfo>
  <PartInfo>
 
A: variables must have a units part.

Something like (A:INCIDENCE ALPHA, degrees)

Hope this helps,
 
You're welcome. Now if only I could eat that cake through the computer! :)
 
A few more questions have popped up.

I animated the AS/Mach indicator and ADI needles. The animation plays smoothly, except when I dive the a/c and accelerate rapidly (usually past Mach 1). In the latter case, it seems as if the ASI is moving frame-by-frame and the needles seem to move like this too. I'm getting a minimum of 30 and average of 60fps, so I don't get it.

For the ASI, it is animated through 850 keyframes from 0-850 KIAS.
The Mach drum is animated through 1000kf, from 0-100k feet.

Also the ADI calibration knobs don't function and the kohlsman knob functions but doesn't animate. All parts have a mouserect and animation attached. I'm actually thinking of making my own attitude calibration code instead of using Prepar3D's stock animations, if such problems keep showing up.

Finally, my last question:
I have achieved gunsight collimation, but it isn't hidden by the blocking cone.
I'm using the precise materials as provided by Chuck Jodry in his file.

The differences are:
1) I'm not using the same glass texture for the cone as with the canopy
2) The gunsight isn't a $VC texture, it's a normal texture instead.

I'd appreciate any help.
 
Last edited:
Reviving this topic with a smaller problem.

I'm trying to animate a ring in the F-4 Virtual cockpit. It's supposed to hang towards the ground at all times, so I linked it to aircraft pitch and animated.

While it works OK from -90 through +90 degrees pitch, when inverted it doesn't animate properly and goes back to 0. It has been keyframed every 45 degrees, but doesn't intend to work so far.

Any ideas?

Ring%20problem.jpg
 
Try this:
Code:
90 270 (A:PLANE BANK DEGREES,degrees) rng 
if{ (A:PLANE PITCH DEGREES,degrees) /-/ }
els{ (A:PLANE PITCH DEGREES,degrees) }

or shorter:
Code:
(A:PLANE PITCH DEGREES,degrees) 90 270 (A:PLANE BANK DEGREES,degrees) rng if{ /-/ }

but I think that A:GForce is more realistic than A:Pitch/Bank for this animation.
 
What are the value ranges for (A:PLANE PITCH DEGREES,degrees) and (A:PLANE BANK DEGREES,degrees)?

0-360 or -90/180 to 90/180?
 
Bank is from 180 to -180 going from left to right.
Pitch is from 90 to -90.
 
Last edited:
Sorry, my code above is for FS9, in which the bank is in the range 0...360. :o

Code for FSX, where the bank is in the range of -180...+180:
Code:
(A:PLANE BANK DEGREES,degrees) abs 90 > 
if{ (A:PLANE PITCH DEGREES,degrees) /-/ }
els{ (A:PLANE PITCH DEGREES,degrees) }
 
What are the value ranges for (A:PLANE PITCH DEGREES,degrees) and (A:PLANE BANK DEGREES,degrees)?

A quick tip.

Make a poly and map it with this gauge.

Code:
<Gauge Name="Readouts" Version="1.0">
   <Image Name="7030_Background.bmp" ImageSizes="70,30,0,0"/>
   <Element>
   <Element>
      <Position X="7" Y="5"/>
      <Text X="70" Y="20" Luminous="Yes" Length="5" Font="Digital-7" Fixed="Yes" FontWeight="800" Color="WHITE">
         <String>%((A:DECISION HEIGHT, feet))%!04.0f!</String>
      </Text>
   </Element>
   </Element>
</Gauge>

Whenever you need to know a range etc just replace the A:var in the string with the variable you want to read :)

Either that or you can make a new PartInfo entry with this to the mouserec part.

Code:
<MouseRect>
	      <Cursor>Hand</Cursor>
	      <TooltipText>%((A:DECISION HEIGHT, feet))%!04.0f!</TooltipText>
</MouseRect>

Then its just to hover your mouse over the part to get the desired readout.
 
Back
Top