Multiple Landing Lights

With X-Plane 920 you can use multiple landing lights controlled by independent switches.

= Datarefs to Control Landing Lights =

With X-Plane 900, there are up to 16 landing light switch datarefs. The old "global" switch is now considered switch 0 and can be referenced with: sim/cockpit2/switches/landing_lights_on (new in v9, preferred) sim/cockpit/electrical/landing_lights_on (available in any version of X-Plane) This switch can be on or off.

The array version of the variable is of type floating point and allows a ratio. This allows landing lights to be set at 50% power. sim/cockpit2/switches/landing_light_switch[N] where N is 0-15.

The Plane-Maker landing light built-in instrument will always control landing light switch 0.

You can use a generic instrument to control any of the landing light switches by array index; for example, the rotary and rheostats can both control these datarefs easily.

= Ways to Create Landing Lights =

Using PlaneMaker
PlaneMaker's view screen allows for the positioning of up to two landing lights - simply check whether the plane has a landing light and position them.

Note that this legacy technique always ties both of these lights to switch zero!

Using Named Lights
You can use named lights in an OBJ that is attached to your airplane to add landing lights. Simply use the names: airplane_landing (X-Plane 9 and later, uses switch 0) airplane_landing0 (X-Plane 920 and later, uses switch 0) airplane_landing1 (X-Plane 920 and later, uses switch 1) airplane_landing2 (X-Plane 920 and later, uses switch 2) airplane_landing3 (X-Plane 920 and later, uses switch 3)

IMPORTANT: if you do not use the built-in Plane-Maker lights but do use the objects, set the position of landing light zero to the average center position of all lights. This will be used to project the landing light halo on runways.

This is an example OBJ that puts landing lights on the 747.

A 800 OBJ TEXTURE ../United-Air_paint.png POINT_COUNTS 0 0 0 0 LIGHT_NAMED	airplane_landing0	-5.4864 -1.49352 21.8456 LIGHT_NAMED	airplane_landing1	 5.4864 -1.49352 21.8456

Using Custom Lights
You can use the custom-light system to create lights using the dataref:

sim/graphics/animation/lights/airplane_landing_light

The R, G and B parameters that you specify will be the direction vector for the landing light. (Use 0,0,-1 for a forward-facing landing light). Note that animations surrounding the light will alter direction, as expected. The alpha color is used to specify which landing light you want to use. This object makes two custom landing lights on the default 747:

A 800 OBJ TEXTURE ../United-Air_paint.png POINT_COUNTS 0 0 0 0 LIGHT_CUSTOM -5.4864 -1.49352 21.8456 0 0 -1 0  2.5   0 0 1 1 sim/graphics/animation/lights/airplane_landing_light LIGHT_CUSTOM 5.4864 -1.49352 21.8456 0 0 -1 1   2.5   0 0 1 1 sim/graphics/animation/lights/airplane_landing_light

Note that you must provide the light billboard texture when using LIGHT_CUSTOM. We recommend using NAMED_LIGHT whenever possible!