Download the Plane Maker Manual - X-Plane
Download the Plane Maker Manual - X-Plane
Download the Plane Maker Manual - X-Plane
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
72 5. CREATING AN INSTRUMENT PANEL<br />
With your panel image has been saved to <strong>the</strong> correct folder, it should appear <strong>the</strong> next time<br />
you open <strong>the</strong> Panel dialog in <strong>Plane</strong> <strong>Maker</strong>. With <strong>the</strong> panel loaded, you can begin dragging and<br />
dropping instruments from <strong>the</strong> list into your cockpit.<br />
5.3 Sliders in <strong>the</strong> Panel<br />
Normally, a switch in <strong>the</strong> X-<strong>Plane</strong> panel is ei<strong>the</strong>r on or off, and going between <strong>the</strong> two states is<br />
instantaneous. For instance, as far as X-<strong>Plane</strong> is concerned, an aircraft’s landing gear is ei<strong>the</strong>r all<br />
<strong>the</strong> way up (with <strong>the</strong> background dataref sim/cockpit2/controls/gear handle down set to 0) or all<br />
<strong>the</strong> way down (with said dataref set to 1). Thus, <strong>the</strong> landing gear switch in <strong>the</strong> instrument panel is<br />
ei<strong>the</strong>r all <strong>the</strong> way up or all <strong>the</strong> way down. However, it may be desirable to animate <strong>the</strong> transition<br />
between <strong>the</strong>se states; one might like to specify to X-<strong>Plane</strong> how long an animation should take. This<br />
is where sliders come in.<br />
Basic sliders are designed for animations that X-<strong>Plane</strong> does not have a native mechanism for.<br />
The dataref for a slider can be used to animate an object or a generic instrument (or anything else,<br />
for that matter).<br />
Sliders consist of a couple sets of datarefs and some <strong>Plane</strong> <strong>Maker</strong> settings.<br />
• sim/cockpit2/switches/custom slider on is an array of 24 Boolean values for switches that<br />
“control” slider animations. You set <strong>the</strong>se datarefs using Generic Instruments (for example,<br />
<strong>the</strong> rotary switch).<br />
• sim/flightmodel2/misc/custom slider ratio is an array of 24 ratios that slowly move from 0<br />
to 1 (and back) over time whenever <strong>the</strong> custom slider on switches are changed.<br />
• sim/operation/slider 01 through sim/operation/slider 20 are 20 commands that toggle <strong>the</strong><br />
custom slider on datarefs. This lets users bind keyboard or joystick commands to <strong>the</strong> various<br />
actions. You can also use <strong>the</strong>se with manipulators to drive your animations in 3-D.<br />
Each of <strong>the</strong> 24 sliders has a cycle time, as seen in Figure 5.2, which is set in <strong>the</strong> Sliders tab of<br />
<strong>Plane</strong> <strong>Maker</strong>’s Systems dialog box. This controls how long it takes <strong>the</strong> ratio variable to move from<br />
its current value to <strong>the</strong> value of <strong>the</strong> switch.<br />
Figure 5.2: The cycle time settings for a single slider<br />
Essentially, <strong>the</strong> sliders act as a time-delay mechanism, running a sequence of ratios over a set<br />
amount of time when a source switch is set. This lets you create animation sequences where a user<br />
sees <strong>the</strong> entire sequence.<br />
For example, consider a staircase for a regional jet which needed to deploy over <strong>the</strong> course of<br />
10 seconds. To make this happen in X-<strong>Plane</strong>, we would to <strong>the</strong> following:<br />
• Create a staircase switch on our 2-D panel (using <strong>the</strong> generic rotary instrument) using<br />
sim/cockpit2/switches/custom slider on[0]<br />
• Attach a 3-D staircase to <strong>the</strong> aircraft as a misc. object that animates based on<br />
sim/flightmodel2/misc/custom slider ratio[0]. It would animate from 0 to 1.