On Thursday 29 April 2004 23:19, Andy Ross wrote:

> This is a perfectly legal script, for example:
>   <nasal>
>     <B52F>
>       <script><![CDATA[
>        myFunction = func { print("Executing myFunction()!"); }
>        print("Hello World!\n");
>       ]]></script>
>     </B52F>
>   </nasal>
> When you start up, it will print "Hello World!" on the console.  It
> will *not* print "Executing myFunction()!".  But later on some other
> piece of Nasal code could do:
>    B52F.myFunction();
> Which would then print "Executing myFunction()!".

I tried this inside an instrument config file, but it didn't work.
Would it be possible to implement the ability to include nasal code in 
instrument config files. I know that one can have nasal code for the action 
bindings. What I want is to define some nasal functions that are instrument 

I've done this with a global nasal script in the Nasal subdirectory, but as 
more instruments use nasal it seems wastefull to have a lot of global nasal 
code that never get used. Example: the KAP140 autopilot control panel uses 
the Nasal/kap140.nas script. AFAIK currently the only aircraft that uses the 
KAP140 is the C172, but still the kap140.nas is executet for every aircraft. 
One could put the kap140.nas in the *set.xml for the aircrafts that use the 
KAP140 instrument, but I believe it would be better to make it instrument 

Roy Vegard Ovesen

Flightgear-devel mailing list

Reply via email to