• 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 Creating my first XML gauge

Messages
657
Country
us-illinois
This may be a redundant post, but I want to try making a simple gauge--like a heading indicator or something. The thing is, I can't find tutorials for beginners anywhere! Also I don't know XML, and I should probably learn it when I get the time. :rolleyes: I just need a step-by-step process of getting a simple gauge into FSX.

I apologize for my Noob-ish-ness...:eek:
 
I'm not going to go into making the gauges as there are tons of different samples in THIS forum and at http://www.aerodynamika.com/cgi-bin/yabb2/YaBB.pl?board=XML


As you probably know there are two types of gauges.

3D gauges and 2D gauges.

3D gauges are pretty much straight forward.
Create the mesh for each part then tag them with the animation manager using the Aces Tools.

2D gauges are a bit different.
To make them work in the sim you need to

- Make the xml code
- Create the bitmaps for each gauge
- Create the "gauge poly" in you model
- Create a new material in Max with the "Is virtual cockpit panel texture" checked.
- Map the correct gauge into the gauge poly
- New entry to the aircraft.cfg

As an example.

In my model there are two kinds of number readouts.
Got some digitals and some analogs.

For the analog I just created the mesh, mapped the part, animated the part and then tagged it with the correct animation code.

For the digital readouts I detached the poly as a new part where the readout is in the cockpit.

I don't want you to tear up your cockpit for this so just make a new poly inside your cockpit so you can easily see it.

Then apply the "is virtual cockpit panel texture" to the part.

Add a new unwrap uwv modifier the list and decide where on the map the gauge will be. You don't want it to be too big or too small.

Think about what you are planning too do.
Are you about to make a small gauge now or a big one?
Well, the digital read out is not that big gauge so it really does not have to take up a lot of space on the UVW map.

Since I know you are using Max use the create uvw template and export it to the resolution you want to.
1024 * 1024 is recommended.

Save the template as an jpeg and call it whatever you like.
The UVW template can now be used at the diffuse texture of the virtual cockpit material created earlier.

Now you know EXACTLY where the gauge are on the UVW map.


For the gauge itself this one is used.

Code:
<Gauge Name="ADF" Version="1.0">
   <Image Name="7030_Background.bmp" ImageSizes="70,30,0,0"/>
   <Element>
   <Visible>(A:ELECTRICAL MASTER BATTERY, bool)</Visible>
   <Element>
      <Position X="23" Y="3"/>
      <Text X="45" Y="7" Luminous="Yes" Length="7" Font="Digital-7" Fixed="Yes" FontWeight="800" Color="Gold">
         <String>%((A:ADF1 ACTIVE FREQUENCY, KHz))%!06.1f!</String>
      </Text>
   </Element>
   </Element>
</Gauge>

So it's just a simple readout of the ADF frequency.
You can see the gauge calls out for a image called 7030_Background.bmp.
Thats just a simple black image used as the backgound from where the numbers will show.
And the image has a size of 70 * 30 pixels.

So lets get cracking!

Make a new folder called that ever you like.
Place the folder inside the PANEL folder of your aircraft.
Make the image file at the correct size and fomat (bmp)
Copy the code provided into your prefereded editor (notepad++ is recommended) and save as an XML file.
Call the XML file ADF.

Drop both the XML file and the image into the folder you made.

Then open you aircraft.cfg and change the first
[Vcockpit01] entry into this:

[Vcockpit01]
file=What you called your image.bmp
Background_color=0,0,0
size_mm=1024,1024
visible=1
pixel_size=1024,1024
texture=What you called your image

gauge00=*What you called your folder*!ADF, 0,0,0,0
Remove the "*", but not the "!"

The 0,0,0,0 needs to be changes by you.

Mine reads 516,4,159,75 as the gauge is 516 pixels to the LEFT and 4 pixels down.
159 pixels wide and 75 pixel in height.

Open the UVW template you created in your photo editor and check the position of the gauge.

The first two zeros represents the position of the TOP LEFT CORNER OF THE GAUGE on the UVW template.

The last two represents the actual size of the gauge.
So check what pixel position the TOP LEFT CORNER of the gauge are and the BOTTOM RIGHT CORNER are.
Then it's just math with subtracting the pixels to get the size of your gauge.

Now make a copy of the template and move it to you panel folder.

Now export your X file and you know the drill.

Should work if I have not forgotten something important :)
 
Last edited:
For simple xml , go to FS2x website.
download tutorial 1 , chapters 1 - 4 .
As far as I know this is the very best resource currently available to any starting xml.

Keep those tutorials for your reference purposes.

Start with something that is nice and simple , like a switch , getting something to work can be very encouraging.

Download the free Notepad ++ editor , it is a important work tool ,
it helps both with layout and visualising your xml script.

Visit this forum and browse the threads , there is a lot of very good information here.

Best of luck.
Cheers
Karol
 
Back
Top