@BecOzIcan:
dude! we got it!! here's how to not pollute the /sim/model property tree... you should note that these properties all end in an 's' and there's no dashes in any of them... this to avoid confusion with other properties in controls/lighting that i think are misplaced in the ai/models/aircraft* tree... they are apparently for ai/models/multiplayer* craft... our AI Traffic craft don't need them and we can create our own like this when needed...
- Code: Select all
<!-- Enable Beacons and Strobes Pulse Behaviour -->
<nasal>
<load><![CDATA[
var self = cmdarg();
var selfPath = self.getPath();
var beaconsStatus = selfPath ~ "/controls/lighting/beacons";
var beaconsEnabled = beaconsStatus ~ "/enabled";
aircraft.light.new(beaconsStatus, [0.5, 1.5]);
self.setBoolValue(beaconsEnabled, 1);
var navlightsEnabled = selfPath ~ "/controls/lighting/navlights/enabled";
self.setBoolValue(navlightsEnabled, 1);
var strobesStatus = selfPath ~ "/controls/lighting/strobes";
var strobesEnabled = strobesStatus ~ "/enabled";
aircraft.light.new(strobesStatus, [0.02, 0.02, 0.02, 0.02, 0.02, 1.98]);
self.setBoolValue(strobesEnabled, 1);
]]></load>
<unload></unload>
</nasal>
that puts the control/lighting properties in the ai/models/aircraft* tree where they belong... then the effect files can just use eg: controls/lighting/beacon for the intensity_scale property... the following for beacon-top...
- Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<name>Effects/beacon-top</name>
<inherits-from>Effects/procedural-light</inherits-from>
<parameters>
<texture n="0">
<type>white</type>
</texture>
<light_color_base_r type="float">1.0</light_color_base_r>
<light_color_base_g type="float">0.0</light_color_base_g>
<light_color_base_b type="float">0.0</light_color_base_b>
<light_color_center_r type="float">1.0</light_color_center_r>
<light_color_center_g type="float">1.0</light_color_center_g>
<light_color_center_b type="float">1.0</light_color_center_b>
<intensity_scale type="float"><use>controls/lighting/beacons</use></intensity_scale>
<pointing_x type="float">1.0</pointing_x>
<pointing_y type="float">0.0</pointing_y>
<pointing_z type="float">0.0</pointing_z>
<is_directional type="bool">false</is_directional>
<is_strobe type="bool">false</is_strobe>
<inner_angle type="float">0.707106781187</inner_angle>
<outer_angle type="float">0.939692620786</outer_angle>
<zero_angle type="float">0.017452406437</zero_angle>
<outer_gain type="float">0.1</outer_gain>
<visibility><use>/environment/ground-visibility-m</use></visibility>
<avisibility><use>/environment/visibility-m</use></avisibility>
<lthickness><use>/environment/ground-haze-thickness-m</use></lthickness>
<terrain_alt><use>/environment/mean-terrain-elevation-m</use></terrain_alt>
<eye_alt><use>/sim/rendering/eye-altitude-m</use></eye_alt>
<terminator><use>/environment/terminator-relative-position-m</use></terminator>
</parameters>
</PropertyList>
i
think we can, if we ignore directionality, use the same few effects for each group of lights... i've not tested that yet but this would allow us to put the models as well as the effect files in AI/Lights and all models can use them... i'm not sure, but i think we can assign the effect to the model as soon as we load the model... that can all be done in the AI/Lights/NavLights.xml loader... then when we return from that to each individual craft's Lights/whatever-Lights.xml, we can do the scaling and positioning in there... i
think...
we might even be able to put the nasal code into /AI/Lights/NavLights.xml so that it gets loaded from there... that will move more code to the ""shared library""... the problem there would be the timing of the blinks of the strobes and beacons... but there could be a default and we could override it, couldn't we?
anyway, i needed to share this... Richard on the dev mailing list gave me the HUGE pointer to the nasal code changes... the main one there being the use of cmdarg() to figure out where our current "working directory" is in the property tree... that one hint is what we've been searching for all this time!
so there it is... i think i can work up a package for testing if you or gooneybird want to take a look... you'll also need my KRDU airline traffic and ground net files plus all of the current AI craft changes... these are only for the ga craft i've been working with... i do have four other test craft that fly into KRDU but i've only got parking places for them right now until i go back through my traffic file and give them some flights... i want to do that slowly and see if/when some anomalies reappear with the new code...
OH and before i forget, hopefully someone can take the aircraft.light.new code and convert it to C code so we can then drop the nasal loader and use that new routine with xml markup to define the timings... then we can drop the nasal code or actually convert it to the new xml form if it is created for us...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."