* Innis Cunningham -- Tuesday 26 April 2005 14:30:
> I am looking to add strobe lights to the A380 model
> and would like to know if there is an animation for
> strobe lights like there is for the beacon on the Cessna.

The f16 uses a "timed" animation for a strobe, just like some others
use it for beacons. I couldn't get acceptable behavior for the bo105's
strobes with that, so I wrote a Nasal based signal generator that is
now available for everyone in aircraft.nas. You can put this into your
aircraft's nasal file or right into the *-set.xml file, like so:

    <nasal>
        <foo>
            <script>
                strobe_switch = 
props.globals.getNode("controls/lighting/strobe", 1);
                aircraft.light.new("sim/model/foo/strobe-top", 0.05, 1.00, 
strobe_switch);
                aircraft.light.new("sim/model/foo/strobe-bottom", 0.05, 1.03, 
strobe_switch);
            </script>
        </foo>
    </nasal>

whereby you best replace "foo" with your aircraft's name. This is the Nasal
module name and must not contain other characters than alphanumeric and 
underscore.
No minus!

This generates two "blinking" properties that listen to the strobe switch.
You can directly use the switch property path-string as 4th argument. You
can also assign the whole light class to a variable and access some internal
values. But don't if there's no need to!

Now you just use this property in a "select" animation to turn some
light object on and off. See $FG_ROOT/Nasal/aircraft.nas for documentation
and $FG_ROOT/Aircraft/bo105/Models/bo105.nas for real-life examples.

m.

_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to