[Flightgear-devel] Re: Strobe Lights
* 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
RE: [Flightgear-devel] Re: Strobe Lights
Thanks Melchior My knowledge of Nasal is limited that is to say none.But I will have a look at what you have said below and see how things work out. Melchior FRANZ writes * 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. Cheers Innis ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] Re: Strobe Lights
* Innis Cunningham -- Tuesday 26 April 2005 19:00: My knowledge of Nasal is limited that is to say none.But I will have a look at what you have said below and see how things work out. You don't need to understand Nasal to copy the lines into A380-set.xml, and to replace foo by A380 and to adapt the property paths. :-) But learning a bit of Nasal is a good idea in any case. Maybe Fred can show us how that could be done with a timed animation alone. When I tried it I first had problems because there was no documentation about the personality feature[1], and then it crashed fgfs routinely. Back then I was only interested in strobes, not in fixing a segfault. ;-) m. [1] there *is* some documentation, though: it's in the cvs log of animation.cxx ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d