Board index FlightGear Development Nasal

Spoken ATC

Nasal is the scripting language of FlightGear.

Re: Spoken ATC

Postby clm76 » Sun Jul 09, 2017 8:35 am

Hi rleibner,

Thanks for your new version.
One comment :
It's not recommended to use "sim/fg-root" to set "spoken_atc" directory because if you change of flightgear version or update it, you will loss your files. It's better to set it in "sim/fg-aircraft".
So for the Citation X, I wrote in the CitationX-set.xml :
Code: Select all
<key n="60">
  <name>less-than</name>
  <desc>Spoken ATC</desc>
  <binding>
  <command>nasal</command>
  <script>
    atc.speak(15)
  </script>
</binding>
</key>
.........
<nasal>
  <atc>
   <file>Aircraft/CitationX/Nasal/spoken_atc/init.nas</file>
   <file>Aircraft/CitationX/Nasal/spoken_atc/atc_tools.nas</file>
   <file>Aircraft/CitationX/Nasal/spoken_atc/phraseology.nas</file>
   <file>Aircraft/CitationX/Nasal/spoken_atc/voice.nas</file>
 </atc>
........
</nasal>

and set the "spoken_atc" directory in "/home/chris/fg/My_Aircraft/CitationX/Nasal"
clm76
 
Posts: 149
Joined: Tue Oct 30, 2012 8:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2018.3.0
OS: Linux Mint 18.3

Re: Spoken ATC

Postby Hooray » Sun Jul 09, 2017 9:10 am

not so sure if I agree with that - ideally, this would be developed further so that it can remain/become an actual Nasal submodule that lives in $FG_ROOT/Nasal - in the meantime, $FG_HOME/Nasal would seem like a good compromise - but I don't quite see why this should be part of an aircraft directory structure, given that it's far from aircraft specific, right ?

Maybe I am misunderstanding something, but my impression was that this would be licensed under the GPL so that this could be committed to the base package once it has gone through a few more iterations to extend/improve a few things and generalize the script.

If it's not intended to be GPL'ed or put up for review to be committed as an optional feature, $FG_HOME/Nasal would be the safest location.

Regarding the installation procedure, you could also look at Torsten's way of integrating the resurrected chatter.nas module in the form of a "plugin" with a custom --config setup
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: 11340
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby clm76 » Sun Jul 09, 2017 9:59 am

not so sure if I agree with that - ideally, this would be developed further so that it can remain/become an actual Nasal submodule that lives in $FG_ROOT/Nasal - in the meantime, $FG_HOME/Nasal would seem like a good compromise - but I don't quite see why this should be part of an aircraft directory structure, given that it's far from aircraft specific, right ?

It's ok if it will be really integrated in a near future in FG but ... sometimes it takes a long time and updating frequently Fg may causes some loss files, no ?
clm76
 
Posts: 149
Joined: Tue Oct 30, 2012 8:18 pm
Location: France - LFOH
Callsign: F-GCLM
Version: 2018.3.0
OS: Linux Mint 18.3

Re: Spoken ATC

Postby Hooray » Sun Jul 09, 2017 10:06 am

even then, $FG_HOME/Nasal would seem like a much better place
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: 11340
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby AndersG » Sun Jul 09, 2017 10:07 am

If it is not integrated soon it'd be better, IMO, to design it to go into ~/.fgfs/Nasal/ a.k.a. $FG_HOME/Nasal/ than any other place.
It is a per-user space and separate from any installed files.
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2444
Joined: Wed Nov 29, 2006 9:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: Spoken ATC

Postby Hooray » Sun Jul 09, 2017 10:25 am

I agree with AndersG - my suggestion would be to keep the current directory structure, and simply change the installation instructions to move the whole directory to $FG_HOME/Nasal - you may then however need to add a simple spoken_atc.nas file to $FG_HOME/Nasal that loads the corresponding files from $FG_HOME/Nasal/spoken_atc - because I think that ThorstenB never fixed his sub-module implementation to be in line with Melchior's original implementation (haven't actually tested that, so may be wrong).

Anyway, dropping a simple one-liner into $FG_HOME/Nasal/spoken_atc.nas that merely calls io.load() in a foreach loop would be straightforward to do.

That would also mean that there would be no work involved if/when the script gets committed as an actual Nasal submodule
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: 11340
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby rleibner » Sun Jul 09, 2017 2:00 pm

Hooray wrote in Sun Jul 09, 2017 10:25 am: ... Anyway, dropping a simple one-liner into $FG_HOME/Nasal/spoken_atc.nas that merely calls io.load() in a foreach loop would be straightforward to do.
That would also mean that there would be no work involved if/when the script gets committed as an actual Nasal submodule

I agree, seems to be the best option.
If we all agree, I include the new script inside the zip (but outside of the folder) and update the wiki.
Last edited by rleibner on Sun Jul 09, 2017 2:31 pm, edited 1 time in total.
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 246
Joined: Fri May 19, 2017 7:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: 2180.4.0
OS: Ubuntu 18.04

Re: Spoken ATC

Postby Hooray » Sun Jul 09, 2017 2:29 pm

I started adding a few lines of code demonstrating how to do this a few hours earlier.
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: 11340
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby rleibner » Sun Jul 09, 2017 2:45 pm

I saw it. I will test that on my computer and make the update.
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 246
Joined: Fri May 19, 2017 7:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: 2180.4.0
OS: Ubuntu 18.04

Re: Spoken ATC

Postby Hooray » Sun Jul 09, 2017 2:47 pm

Yeah, like I said, it's untested - I haven't actually had time to build/run FlightGear in months, but if you hit some roadblock, feel free to ask around here, I should still be able to make heads and tails of most Nasal code (except anything written by Philosopher)
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: 11340
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby rleibner » Sun Jul 09, 2017 3:33 pm

I've just moved the spoken_atc dir to fg-home/Nasal, (change init.nas, line 5) and created the new fg-home/Nasal/spoken_atc.nas (fixing misspelling on line 8 ).

Mmm... seems that there's a problem with the namespaces :roll:
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 246
Joined: Fri May 19, 2017 7:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: 2180.4.0
OS: Ubuntu 18.04

Re: Spoken ATC

Postby Hooray » Sun Jul 09, 2017 3:35 pm

check io.nas, there is an API to load everything into a configurable namespace (probably an optional arg)
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: 11340
Joined: Tue Mar 25, 2008 8:40 am

Re: Spoken ATC

Postby rleibner » Sun Jul 09, 2017 5:38 pm

Done. All is OK now. :)
I'm doing some minor changes (optimizing code) and update the wiki page.
Thanks, Hooray
Rodolfo
*************************
Non-shared knowledge is lost knowledge
User avatar
rleibner
 
Posts: 246
Joined: Fri May 19, 2017 7:17 pm
Location: Uruguay - SUMU
Callsign: CX-BEX
Version: 2180.4.0
OS: Ubuntu 18.04

Re: Spoken ATC

Postby wkitty42 » Sun Jul 09, 2017 9:30 pm

Hooray wrote in Sun Jul 09, 2017 9:10 am:not so sure if I agree with that - ideally, this would be developed further so that it can remain/become an actual Nasal submodule that lives in $FG_ROOT/Nasal - in the meantime, $FG_HOME/Nasal would seem like a good compromise - but I don't quite see why this should be part of an aircraft directory structure, given that it's far from aircraft specific, right ?

i was thinking that it could be temp added as an addon in the FGADDON/addons directory with random ATC chatter and detailed EarthView addons... when finalized, then moving it elsewhere into FG proper... i dunno, though :)
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 5695
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: Spoken ATC

Postby Hooray » Sun Jul 09, 2017 10:18 pm

I don't know if Torsten's plugin/addon approach ever got documented anywhere other than some of us pointing out on the forum how clever it was, but given that he has already provided feedback about the work in question, I guess we don't need to worry about that - Torsten is usually not shy when it comes to providing coding feedback, and as long as people comply with it, he is usually also quick to get things committed that he's previously commented on as long as he's seen his requests being followed up on.
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: 11340
Joined: Tue Mar 25, 2008 8:40 am

PreviousNext

Return to Nasal

Who is online

Users browsing this forum: No registered users and 2 guests