I have dug through all I could find about Nasal docu in FG wiki and still have not found a clear answer about when a Nasal script embedded in an XML <Propertylist><nasal>..</nasal></Propertylist> file is executed.
I put the following into a XML file I include from the aircraft-set.xml file and it seems it is not executed.
The Head part of the aircraft-set.xml file
- Code: Select all
<PropertyList include="Models/SearchLight/searchlight_config.xml">
and the searchlight_config.xml file
- Code: Select all
<PropertyList>
<nasal>
<slight>
<file>Models/SearchLight/searchlight.nas</file>
</slight>
<script>
<!-- init searchlight props with delay
otherwise Nasal error is raised -->
setlistener("/sim/signals/fdm-initialized", func {
settimer(func {
slight.slight_init();
print("searchlights initialized ...");
}, 1);
});
</script>
</nasal>
What is wrong with this approach ?
I used it in an almost identical way, but it doesn't seem to work here ...
Any other way to run a script from the included file ?
Thanks
Mike-DE