Howto:Add aircraft lights: Difference between revisions
Jump to navigation
Jump to search
m (moved Howto: Add aircraft lights to Howto:Add aircraft lights: Robot: Moved page) |
mNo edit summary |
||
Line 3: | Line 3: | ||
== Anti-Collision Beacon lights == | == Anti-Collision Beacon lights == | ||
=== Nasal === | === Nasal === | ||
<source lang="javascript"> | |||
var beacon_switch = props.globals.getNode("controls/switches/beacon", 2); | |||
var beacon = aircraft.light.new( "/sim/model/lights/beacon", [0, 3], "/controls/lighting/beacon" ); | |||
</source> | |||
=== Model === | === Model === | ||
<source lang="xml"> | |||
<animation> | <animation> | ||
<type>select</type> | <type>select</type> | ||
Line 14: | Line 17: | ||
</condition> | </condition> | ||
</animation> | </animation> | ||
</source> | |||
== Strobe lights == | == Strobe lights == | ||
=== Nasal === | === Nasal === | ||
<source lang="javascript"> | |||
var strobe_switch = props.globals.getNode("controls/switches/strobe", 2); | |||
var strobe = aircraft.light.new( "/sim/model/lights/strobe", [0, 3], "/controls/lighting/strobe" ); | |||
</source> | |||
=== Model === | === Model === | ||
<source lang="xml"> | |||
<animation> | <animation> | ||
<type>select</type> | <type>select</type> | ||
Line 28: | Line 35: | ||
</condition> | </condition> | ||
</animation> | </animation> | ||
</source> | |||
== Landing lights == | == Landing lights == | ||
=== Model === | === Model === | ||
<source lang="xml"> | |||
<animation> | <animation> | ||
<type>select</type> | <type>select</type> | ||
Line 38: | Line 47: | ||
</condition> | </condition> | ||
</animation> | </animation> | ||
</source> | |||
If the lights are located on the nosegear, use the one below instead. It will only show the lights when the landinggear is out. Change the value to make the light switch on when gear is out (vary from plane to plane, you can use the [[property browser]] to find the right value). | If the lights are located on the nosegear, use the one below instead. It will only show the lights when the landinggear is out. Change the value to make the light switch on when gear is out (vary from plane to plane, you can use the [[property browser]] to find the right value). | ||
<source lang="xml"> | |||
<animation> | <animation> | ||
<type>select</type> | <type>select</type> | ||
Line 54: | Line 64: | ||
</condition> | </condition> | ||
</animation> | </animation> | ||
</source> | |||
[[Category:Nasal howto|Aircraft lights add]] | [[Category:Nasal howto|Aircraft lights add]] |
Revision as of 18:48, 1 March 2014
In order to add (the right) lights to your aircraft, you need to know what kind of lights planes are equipped with. Therefore it is suggested to read aircraft lighting first.
Anti-Collision Beacon lights
Nasal
var beacon_switch = props.globals.getNode("controls/switches/beacon", 2);
var beacon = aircraft.light.new( "/sim/model/lights/beacon", [0, 3], "/controls/lighting/beacon" );
Model
<animation>
<type>select</type>
<object-name>Light</object-name>
<condition>
<property>/sim/model/lights/beacon/state</property>
</condition>
</animation>
Strobe lights
Nasal
var strobe_switch = props.globals.getNode("controls/switches/strobe", 2);
var strobe = aircraft.light.new( "/sim/model/lights/strobe", [0, 3], "/controls/lighting/strobe" );
Model
<animation>
<type>select</type>
<object-name>Light</object-name>
<condition>
<property>/sim/model/lights/strobe/state</property>
</condition>
</animation>
Landing lights
Model
<animation>
<type>select</type>
<object-name>Light</object-name>
<condition>
<property>controls/lighting/landing-light</property>
</condition>
</animation>
If the lights are located on the nosegear, use the one below instead. It will only show the lights when the landinggear is out. Change the value to make the light switch on when gear is out (vary from plane to plane, you can use the property browser to find the right value).
<animation>
<type>select</type>
<object-name>Light</object-name>
<condition>
<and>
<property>controls/lighting/landing-light</property>
<greater-than>
<property>gear/gear/position-norm</property>
<value>0.05</value>
</greater-than>
</and>
</condition>
</animation>