I brought some modifications to atc_tools.nas and voice.nas to prevent some errors.
Voice.nas :
Replaced stationg== "tower" by station== "tower"
- Code: Select all
} else if(relpos=="onground"){
if(station=="tower" and prev=="land clearance"){
msg = TWRvoice();
} else if(station=="ground" or (stationg=="tower" and freqs["GND"]==nil)) {
msg = GNDvoice();
}
When loading a plane, it can be the default runway which is loaded by Fg but the ATC code can choose another runway as « best » runway depending of the wind direction. It’s the case, for example, at LFPG which have two runways nearly parrallel (08L and 09L). If the plane is on the runway 08L, the ATC choose 09L as runway when the wind is 150 deg and 3 knots.
So, I modify the code, using the property sim/atc/runway
- Code: Select all
foreach(var rw; keys(rws)){
if (dest_rwy != nil and dest_rwy == rw) {
best = rw;
break;
} else {
if (rw == getprop("sim/atc/runway")) {
best = rw;
break;
}else {
var a = abs(info.runways[rw].heading - getprop("/environment/metar/base-wind-dir-deg"));
if(a<ang) {
ang = a;
best = rw;
}
}
}
}
To correct the problem which occurs at LFPG (and possibly in others airport) which is near of LFPB and where it’s LFPG Tower which manages LFPB, I introduced a library of exceptions like this :
- Code: Select all
# *** ICAO exceptions ****************************************
var ICAOexc = func(arg) {
var station_name = getprop("/instrumentation/comm/station-name");
if (arg == "LFPB" and left(station_name,9) == "DE GAULLE") icao = "LFPG";
return icao;
}
# *** Main ****************************************
# 1) Get properties
var cs = getprop("/sim/multiplay/callsign");
cs = string.replace(cs,"-","");
var icao = getprop("/instrumentation/comm/airport-id");
ICAOexc(icao);
var info = airportinfo(icao);
……
There is only LFPG and LFPB in this library but perhaps some others airports in the world have the same managment, So, it’s simple to complete the library.
It’s also possible to create this library outside voice.nas in another file named library.nas or exception.nas…
atc_tools.nas
Some airports like LSGG (Geneva) doesn’t have « TWR » or « APP »returned by
- Code: Select all
var f = getfreqs(arg.apt);
in phraseology.nas, but « Geneva Tower... » or «Geneva approach » and that gives a nasal error « no such member : TWR »
I modified the code in atc_tools.nas, line 54, like this :
- Code: Select all
if(hash["TWR"]==nil and (string.match(hash.ident,"*TWR") or string.match(hash.ident,"*ower"))) typ ="TWR";
if(hash["APP"]==nil and (string.match(hash.ident,"A/G") or string.match(hash.ident,"*pproach"))) typ ="APP";
freqs[typ] = sprintf("%.2f", hash.frequency);}
}
return freqs;
It’s all for the moment !...
If you prefer, you can download the modified files here :
http://www.mediafire.com/file/s7kftt62l ... _tools.nas
http://www.mediafire.com/file/cl1lxv9lfo5fwlo/voice.nas