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 9: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 7:09 pm

Re: How do I run tanker.nas?

Postby Hooray » Tue Jul 25, 2017 9: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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: How do I run tanker.nas?

Postby wlbragg » Tue Jul 25, 2017 9: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 and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7588
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: How do I run tanker.nas?

Postby Hooray » Sat Aug 05, 2017 10: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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: How do I run tanker.nas?

Postby Thorsten » Sun Aug 06, 2017 6: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: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: How do I run tanker.nas?

Postby Hooray » Sun Aug 06, 2017 8: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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU


Return to Nasal

Who is online

Users browsing this forum: No registered users and 1 guest