Personal tools

Creating an Instrument Panel

From X-Plane Wiki

Jump to: navigation, search

Creating a basic 2-D instrument panel in Plane Maker is as easy as choosing a panel background image and dragging the instruments you want where you want them. Creating panels that use generic (user-created) instruments are more complicated, as are 3-D panels; both generic instruments and 3-D panels are beyond the scope of this manual, and will thus be discussed only briefly.


Introduction to Panel Creation

With the aircraft whose panel you want to design open, open the Standard menu and click Panel: 2-D. The panel design window will appear.

This window is made up of a number of different sections. The buttons in the toolbar at the top of the screen (labeled 1 in Figure 5.1) perform a variety of functions; mouse over each button to get a description as well as the keyboard shortcut that does the same thing, where available. For instance, mousing over the far left button, whose icon is a floppy disk, tells us that this button saves the file, and that you can also save by pressing Ctrl + s.

Two groups of information panes lie on the left and right of the screen, respectively. On the left is the Instrument List, which is combined with the Preview, Description, and Properties panes, and on the right is the Hierarchy, combined with the Key Frames pane. These left and right groups can be displayed or hidden by clicking the large Instrument List and Hierarchy buttons at the top of the screen, respectively.

Creation of an instrument panel, then proceeds this way. First, find the instrument you're looking for in the instrument list (labeled 2 in Figure 5.1) and click on it. For instance, in Figure 5.1, the general aviation altimeter, whose filename is alt_GA.png, is selected. With an instrument selected, you can see what it will look like in the Preview tab (labeled 3 in Figure Figure 5.1). Beneath this is the Description tab (labeled 4 in Figure 5.1), which details what the selected instrument does.

Figure 5.1: The panel design window with its various parts numbered

Having found the instrument you’re looking for, click it in the instrument list and drag it into the layout pane, labeled 5 in Figure 5.1. Doing so will cause the instrument to also be listed in the hierarchy pane, labeled 6 in Figure 5.1. With an instrument in the panel, click on it to select it; selecting an instrument in either the layout or the hierarchy pane will cause it to be selected in both.

When an instrument has been added to the panel layout, it will appear in the Hierarchy pane. You can select an instrument from the layout pane by clicking its name here. Additionally, you can set its status to visible or invisible by clicking the eye icon to the left of it, and you can set it to locked or unlocked (that is, unmovable or movable) by clicking the padlock icon.

When an instrument is selected in the layout and hierarchy panes, the Properties tab (labeled 7 in Figure 5.1) will display its settings. This includes what lighting is used on the instrument, which electrical bus the instrument is on, and what Tool Tip (if any) will be displayed when the Show Instrument Descriptions setting is activated and it is moused over in X-Plane. The comment property is simply for use in designing and will have no effect in X-Plane.

To select multiple instruments in either the hierarchy pane or the layout pane, hold down either the Control or Shift keys and click the desired instrument. To group instruments together in the hierarchy pane, select them and press the G key. With a group created, you can also click and drag other instruments into the group in the hierarchy pane.

With an instrument selected, you can drag it around to reposition it, or use the arrow keys to move it by very small amounts. If there is more than one instrument in the panel, guide lines will appear to which the instrument will “snap,” allowing you to align instruments perfectly.

Use the = and - keys or your mouse wheel to zoom in and out in the layout pane. To pan your view of the panel left and right, you can right click (or hold the Control key and left click) on the panel and drag it; alternatively, you can use the left, right, up, and down arrow keys to “nudge” the panel each direction, and press Shift with an arrow key to jump to the far edge in a given direction. Press the Alt key to view each instrument’s index (duplicates of a single instrument will have different indices in order to differentiate them). Click and drag anywhere in the layout pane to form a box that selects multiple instruments. To delete an instrument, select it and hit the Backspace key.

If two instruments are placed on top of one another in the layout pane, the instrument closest to the bottom of the list in the hierarchy pane will be displayed on top of the instruments higher up the list. To change an instrument’s name, double-click it in the hierarchy pane and type its new name.

Finally, in the very bottom of the window is the status bar (labeled 8 in Figure 5.1). Here, you can see the level of zoom for the panel layout pane, the name and position of the currently selected instrument, the object’s size (as a ratio compared to its original size), and whether the instrument uses the copilot’s pitot tube.

Setting a Panel Background

Before beginning the layout, you may want to create the background image that your panel will use. Plane Maker will supply a default panel image based on your cockpit type setting in the Viewpoint window (e.g., General Aviation, Airliner, Fighter, etc.), but you may want a different image for a number of reasons. Many aircraft designers today use a panel that is around 1600 pixels wide so that the panel is usable at lower resolutions (e.g., 1024 x 768), but it also shines at high resolutions (e.g., 1920 x 1080). Note that the panel is limited to a maximum of 2048 x 2048 pixels, and a minimum of 1024 x 1024 pixels, but the image does not have to be square.

Panel backgrounds in Plane Maker can follow one of two naming conventions. The old convention is simply to name the image “Panel.png” (without the quotes, of course). As of version 9, Plane Maker will still work with a panel named this way. The new convention, and the one you should use when creating new aircraft, is to name the image to match the “cockpit” setting in Plane Maker's Viewpoint window.

For instance, if the cockpit setting in the Viewpoint window were set to General Aviation, the panel image would be named Panel_General.png. If it were instead set to Airliner, the image would be named Panel_Airliner.png.

The official names for panels are the same as in the folder Resources/bitmaps/cockpit/-PANELS-/ and are:

  • Panel_General.png
  • Panel_Airliner.png
  • Panel_Fighter.png
  • Panel_Glider.png
  • Panel_Helo.png
  • Panel_Autogyro.png
  • Panel_General_IFR.png
  • Panel_Autogyro_Twin.png
  • Panel_Fighter_IFR.png

In order for Plane Maker to find your background, you must (re)name it using one of these conventions and save it in the following folder:

[Your aircraft folder here]\cockpit\-PANELS-\

Thus, the panel image for X-Plane 9’s Cessna 172 SP is in the following folder:

X-Plane 9\Aircraft\General Aviation\Cessna 172SP\cockpit\-PANELS-\

With your panel image has been saved to the correct folder, it should appear the next time you open the Panel window in Plane Maker. With the panel loaded, you can begin dragging and dropping instruments from the list into your cockpit.

Sliders in the Panel

Normally, a switch in the X-Plane panel is either on or off, and going between the two states is instantaneous. For instance, as far as X-Plane is concerned, an aircraft’s landing gear is either all the way up (with the background dataref sim/cockpit2/controls/gear_handle_down set to 0) or all the way down (with said dataref set to 1). Thus, the landing gear switch in the instrument panel is either all the way up or all the way down. However, it may be desirable to animate the transition between these states; one might like to specify to X-Plane how long an animation should take. This is where sliders come in.

Basic sliders are designed for animations that X-Plane does not have a native mechanism for. The dataref for a slider can be used to animate an object or a generic instrument (or anything else, for that matter).

Sliders consist of a couple sets of datarefs and some Plane Maker settings.

  • sim/cockpit2/switches/custom_slider_on is an array of 24 Boolean values for switches that "control" slider animations. You set these datarefs using Generic Instruments (for example, the rotary switch).
  • sim/flightmodel2/misc/custom_slider_ratio is an array of 24 ratios that slowly move from 0 to 1 (and back) over time whenever the custom_slider_on switches are changed.
  • sim/operation/slider_01 through sim/operation/slider_20 are 20 commands that toggle the custom_slider_on datarefs. This lets users bind keyboard or joystick commands to the various actions. You can also use these with manipulators to drive your animations in 3-D.

Each of the 24 sliders has a cycle time, as seen in Figure 5.2, which is set in the Sliders tab of Plane Maker's Systems window. This controls how long it takes the ratio variable to move from its current value to the value of the switch.

Figure 5.2: The cycle time settings for a single slider

Essentially, the sliders act as a time-delay mechanism, running a sequence of ratios over a set amount of time when a source switch is set. This lets you create animation sequences where a user sees the entire sequence.

For example, consider a staircase for a regional jet which needed to deploy over the course of 10 seconds. To make this happen in X-Plane, we would to the following:

  • Create a staircase switch on our 2-D panel (using the generic rotary instrument) using sim/cockpit2/switches/custom_slider_on[0]
  • Attach a 3-D staircase to the aircraft as a misc. object that animates based on sim/flightmodel2/misc/custom_slider_ratio[0]. It would animate from 0 to 1.
  • Add a “command slider” to the instrument panel. This is labeled “but_command_slider” in the “buttons” folder of the panel design window’s instrument list (labeled 2 in Figure 5.1).
  • Set the cycle time for that slider to 10 seconds in the Sliders tab of Plane Maker’s Systems window.

If you have more than one slider in your instrument panel, you can figure out which number each one is assigned by opening the panel design window and pressing the Alt key (Option in Mac OS X). Small green numbers will appear on each duplicated instrument, as seen in Figure 5.3. For instance, in Figure 5.3, the cycle time for the slider on the far right would be set using the “#3 time” parameter in the Systems window’s Sliders tab.

Figure 5.3: Three sliders in an instrument panel, whose numbers are displayed by pressing the Alt (Option) key

It is also possible to create an animation sequence for parts of the aircraft which you do not want tied to an actual switch in the instrument panel. For instance, you might want to animate the landing light housing unfolding from the wing when the lights are turned on. In this case, you would not want to tie the landing light cockpit switch to sim/cockpit2/switches/slider_on because changing the switch would trigger the animation without actually turning on the landing lights!

To account for this, the slider system allows you to pick any dataref as a “source” for a slider; the slider_on datarefs are merely a default. Thus, in the case of the landing lights, you would simply need to choose the real landing light switch dataref (sim/cockpit2/switches/landing_lights_on) as the source for your sliders. Then, when the landing lights are turned on, the slider will be triggered and the landing lights will work as they should.

To select a custom dataref for a slider, simply open the Systems window’s Sliders tab, check the box labeled “dataref” next to the slider which you would like to use, then box next to the text field below the dataref checkbox. A dialog box will appear that allows you to choose which dataref you will link to.

Note: If you are using custom-assigned sliders, you should begin with slider #24 and move to lower numbers as needed, since actual sliders in the instrument panel (but_command_slider) will be numbered beginning at 1.

Then, in the case of the landing lights, you would set the sliders up this way:

  • In the instrument panel, there would be a normal landing light switch.
  • Slider #24 would have a cycle time of 5 seconds, with the dataref checkbox on, and a dataref of “sim/cockpit2/ switches/landing_lights_on”.
  • In a misc. object for the aircraft there would be a key-framed animation based on sim/flightmodel2/misc/ custom_slider_ratio[0] that animates the landing light housing.

Generic (Custom) Instruments

For information on creating your own instruments using X-Plane’s “generic” instruments, please see the Generic Instruments Wiki entry.

Creating a 3-D Panel

Working with 3-D objects in general, and 3-D instrument panels in particular, is a subject for advanced aircraft design. For information on using 3-D objects in general with X-Plane aircraft files, see the section Creating 3-D Objects for X-Plane in Chapter 8. For information on 3-D panel creation in particular, see the 3D Panel Wiki page.