On Thursday 29 April 2004 20:50, Andy Ross wrote:
> Lee Elliott wrote:
> > Is there a way of starting a Nasal script automatically at start-up?
> > (this would help with zeroing the A-10 external tanks for the clean
> > configuration)
>
> Sure, you can put a <nasal> block at the top of a -set.xml file (next
> to, not inside, the <sim> block).  Something like this:
>
>  <nasal>
>   <a10> <!-- Module name.  The aircraft name is a good choice -->
>    <script>
>     # Whatever Nasal code you like ...
>    </script>
>   <a10>
>  </nasal>
>
> The bo105 uses slightly different syntax to load an external .nas
> file, and you can inspect
> http://www.plausible.org/nasal/flightgear.html for more detail.
>
> > I could do a script that monitors the tank levels and de-selects them
> > when they're empty but I don't know how to best invoke it.
>
> Actually, it wouldn't be hard to make this the default.  We could set
> a "kill engines if empty" flag on the tank for aircraft where we
> wanted stricter behavior.
>
> Andy

Thanks - a faint light is beginning to illuminate:)

So far I've been using this structure (which I copied from another a/c - don't 
remember which one though)  in the set files...

  <nasal>
    <B52F>
      <script><![CDATA[
        # Nasal script(s)
                            .
                            .
      ]]></script>
    </B52F>
  </nasal>

and the scripts then need to be explicitly invoked.

Presumably, omitting the '<![CDATA[' and ']]>' bits will then result in the 
scripts being executed at start-up.

I'll have a look at how the bo105 does it and see about moving all the scripts 
I've put in the set file out to external .nas files and use the set file 
scripts just for start-up stuff.

Having a default where the tanks are automatically de-selected when empty 
would probably be a good thing for beginners.

LeeE

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to