Board index FlightGear Development Nasal

How do I run tanker.nas?

Nasal is the scripting language of FlightGear.

How do I run tanker.nas?

Postby locknutbushing » Tue Jul 25, 2017 8:40 pm

Hi, I'm completely new to Nasal and I want to simulate an automated airplane, so I'm attempting to use tanker.nas as a starting point. I've specified the Nasal file in the airplane-set.xml file so far, using:

<nasal>
<tanker>
<file>Aircraft/777/Systems/tanker.nas</file>
</tanker>
</nasal>

But how do I actually get the nasal file to run? The simulation starts up normally, as though the setup is default.

I'm surprised that I can't seem to find any documentation on this.
locknutbushing
 
Posts: 6
Joined: Fri Jul 21, 2017 6:09 pm

Re: How do I run tanker.nas?

Postby Hooray » Tue Jul 25, 2017 8:48 pm

see the menubar, it's part of the AI traffic/scenario
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11375
Joined: Tue Mar 25, 2008 8:40 am

Re: How do I run tanker.nas?

Postby wlbragg » Tue Jul 25, 2017 8:55 pm

I've specified the Nasal file in the airplane-set.xml

All that does is load the file into the nasal space, you still have to have a function call either inside or outside the .nas file or no function.

IE:

var myfunction = func {
x = x+1;
}

myfunction();

Function myfunction will be executed as soon as the line myfunction(); is read;

or

simply no function

x = x+1;

will be executed as soon as the .nas file is loaded.

or

myfunction.nas =

var myfunction = func {
x = x+1;
}
and
aircraft.nas includes the following line

myfunction();

will execute myfunction as soon as myfunction(); is read in aircraft.nas.

This is a very simplistic explanation. There are other things like paths and name spaces you need to make sure are correct.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
wlbragg
 
Posts: 4988
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Re: How do I run tanker.nas?

Postby Hooray » Sat Aug 05, 2017 9:25 pm

it really is as simple as using the integrated UI to invoke the tanker
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11375
Joined: Tue Mar 25, 2008 8:40 am

Re: How do I run tanker.nas?

Postby Thorsten » Sun Aug 06, 2017 5:32 am

I'm completely new to Nasal and I want to simulate an automated airplane, so I'm attempting to use tanker.nas as a starting point.


I miss the connection between 'simulate automated airplane' and 'tanker.nas' - for the first an autopilot would seem suitable rather than an AI scenario.
Thorsten
 
Posts: 11191
Joined: Mon Nov 02, 2009 8:33 am

Re: How do I run tanker.nas?

Postby Hooray » Sun Aug 06, 2017 7:43 am

The background is probably this first posting: viewtopic.php?f=18&t=32584&p=314781#p314781
I also suggested other options ...
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11375
Joined: Tue Mar 25, 2008 8:40 am


Return to Nasal

Who is online

Users browsing this forum: Google [Bot] and 2 guests