from the AVSIM MSFS Aircraft and Panel Design Forum

Mini-Tutorial - How to make a VC work.

#3, RE: Panel bitmap
Posted by n4gix on Nov-15-02 at 11:45 PM
In response to message #2

LAST EDITED ON Nov-15-02 AT 11:52 PM (EST)
>Hi Bill,
>Only because I am completely ignorant about how to do it. I
>would much prefer to make it functional. Any tutorials?
>Using FSDS.

Well, not really... there is only one that I'm aware of, and it is based on 'early guesswork' from when VC's were very, very new, and no SDK's existed for FS2k2. As a result, although following the steps outline will get anyone started, there's a lot that is incomplete or misleading.

So, I'm determined to write one as soon as the current project is released, using my experiences with that model, as well as the model itself as a sort of "talking board."

I've actually outlined the process more than once in this forum, but rather than make you search the last seven months or so of messages, I'll attempt outlining enough to get you 'kick started.'

Then, as you go along, feel free to ask questions at any point and one of us who've 'been there, done that' can help... Fair enough?

OK then, let's cover some of the basics...

I) Definitions & Rules

1) FS2k2 'projects' images of gauges that're defined in the panel.cfg onto a transparent 'screen' that you provide in the model. All we are able at this time to use are 'regular gauges.' A certain payware company has developed the tools that will allow 'vector graphic drawn gauges' (such as the gps or Eric Marciano's F16 Radar Gauge) in a Virtual Cockpit, but thus far it is not available for the general public (us!) to use...

2) The program you use to create the FS2k2 model is irrelevant; either GMax or FSDS is quite capable of making a fine VC, as the 'magic' is actually done by FS2k2...

3) Basically, you need to create a planar surface (i.e., 'flat sheet') on which to apply a dummy texture. It is the name we give the texture that is important, not the texture itself! All dummy textures are named with the prefix $, so a primary panel's texture might be called something like $primary_panel.bmp

4) The most important thing to remember is that all of the dummy textures used to create a VC panel must be square, and must be of a size that is a "power of 2." In simple terms, the .bmp files must be 256x256, 512,512, or 1024,1024...

5) There is no rule that the planar surface has to be any particular shape or size, only the texture applied to it! (more on this later.)

II) Basic Steps to Create a Simple VC Panel

1) Start a new project in FSDS (or GMax) to experiment with.

2) Create a simple planar surface of about 16"x8" (there is a reason for this particular size, as we're going to use it to illustrate a major point in VC design later)

3) In your favorite paint program, create a totally black (0,0,0) image of 512x512 pixels, and name it $my_first_vc

4) Go back to FSDS or GMax, and apply the texture $my_first_vc to the planar object you created in step 2. You do not need to copy the texture anywhere, as it is only a "dummy" used to assign a name to the map in the .mdl file that will be generated by FSDS or GMax. FS2k2 will auto-generate the texture needed at run time. Make sure that when you position the texture, you align the top half of the texture with the top of the rectangular surface you created. FS2k2 uses the pixel coordinates of the texture for gauge placement, not the object!

5) Export your work to a .mdl file...

6) Now the fun begins! The way gauges are placed on the little panel you've just created is via the panel.cfg file. Here is a snippet from the C172's panel.cfg for one part of a VC. (I've replaced the square bracket with a { because of being posted here... square brackets are used instead of > and < for HTML code!).


gauge00=Bendix_King_Radio!Bendix-King Radio Nav-Comm 1, 0, 0, 205, 77
gauge01=Bendix_King_Radio!Bendix-King Radio Nav-Comm 2, 206, 0, 205, 77
gauge02=Cessna172!Clock, 413, 1, 93, 93
gauge03=Bendix_King_Radio!Bendix-King Radio DME, 0, 86, 198, 51
gauge04=Bendix_King_Radio!Bendix-King Radio Audio, 201, 85, 198, 34
gauge05=Cessna!Annunciator, 403, 96, 109, 30
gauge06=Bendix_King_Radio!Bendix-King Radio AP, 0, 136, 198, 59
gauge07=Bendix_King_Radio!Bendix-King Radio Xpndr, 0, 196, 198, 61
gauge08=Cessna182s!VOR2, 257, 129, 126, 126
gauge09=Cessna!ADF, 385, 130, 126, 126
gauge10=Cessna!VOR1, 1, 258, 126, 126
gauge11=Cessna!Vertical_Speed, 129, 256, 126, 126
gauge12=Cessna172!Airspeed, 256, 256, 128, 128
gauge13=Cessna!Turn_Indicator, 384, 256, 128, 128
gauge14=Cessna!Altimeter, 1, 383, 126, 126
gauge15=Cessna172!Tachometer, 128, 383, 128, 128
gauge16=Cessna!Heading_Indicator, 256, 384, 128, 128
gauge17=Cessna!Attitude, 383, 384, 128, 128

7) Take careful note of how this part of the panel.cfg is different from the 2d sections.

a) size_pixel and size_mm are both 512,512 (sound familiar?)

b) the name of the texture file is $C172s_1 (hmmm strike a chord here?)

c) background_color is set to 0,0,0 (transparent!)

8) The reason I picked this particular file was because it will allow you to rather quickly see the fruits of your work so far...

a) make a copy of the C172's panel.cfg file for later use.

b) edit the texture line in the section quoted above to be:

c) rename the C172's cessna172sp.mdl file to cessna172sp.mdl.bak for safekeeping.

d) move the .mdl file you just created to the C172's model\ folder, rename it cessna172sp.mdl and start FS2k2. Choose the C172 a/c and let it load.

e) when you switch to the virtual cockpit, assuming you followed all the steps carefully, you should see a little 16"x8" panel "floating" in front of your face, with all the gauges applied...

9) Notice that even though you created a rectangular panel, and a square bitmap, only the solid surface upon which the texture was applied will be visible! Because the image is transparent, where there is no 'surface,' there is nothing at all!

When you get this far, please let me know and we can continue from there!

Have Fun!

Oh yes! Be sure to remove your changed files and rename the default Cessna's files!



Back to TIPS

The Freeflight Design Shop Forum is maintained with WebBBS 2.25.