June 8, 200817 yr Commercial Member I currently use a rather awkward system to determine roughly what part of the world the plane is located in.However, I'd like to adopt a cleaner and precise method to determine which country the aircraft is.So I'm looking at this GPS variable to get the job done: FacilityRegionTrouble is, it doesn't seem to return anything in my C gauge.Anyone ever get the same thing to work?This is it for the code:PCSTRINGZ country;execute_calculator_code("(C:fs9gps:FacilityRegion, string)", NULL, NULL, &country);Cheers,Bryan B. York FS2Crew Web Site / FS2Crew Facebook Page / FS2Crew Discord
June 8, 200817 yr Moderator The same request made in XML returns NULL as well.First, you have to tell the fs9gps.dll what your current ICAO code is, then it will return the FacilityRegion information.However, the FacilityRegion won't be much help, since it's usually a single letter or two, not the name of the country... Even then, the return is fairly meaningless. For example, whilst sitting at the ramp in Sion, Switzerland, the GPS returns a "Region Code" of "LS..."However, the ISO Region Code* of "LS" is the country of Lesotho, a considerable few nautical miles from Switzerland! :)* http://www.cue-dih.co.uk/aerospace/aeropdf...untry_codes.pdf Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
June 9, 200817 yr Moderator Bryan,I spent a few delightful -albeit ultimately fruitless- hours this afternoon trying various approaches using a simple XML gauge (because it's a darn sight quicker than using a C gauge!)...Using the list of GPS Variables available (not all of which actually work, BTW) that Susan Ashlock provided a couple of years ago on her blog and to which I promptly "borrowed" for a Wiki entry:http://forums.flightsim.com/fswiki/index.p...9_GPS_VariablesI checked out trying to obtain a "Country" return... nada, zip, zilch. :(In any event, as I said previously you first have to tell the fs9gps.dll where you currently are before it will return any information. Here is the XML gauge script:C:fs9gpsC:fs9gps (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 1 (>@c:NearestAirportMaximumItems) 200 (>@c:NearestAirportMaximumDistance, NMiles) 0 (>@c:NearestAirportCurrentLine) (@c:NearestAirportCurrentIcao) (>@c:FacilityIcao) %( (@c:NearestAirportItemsNumber, Number) 1 >= )%{if}%((@c:FacilityName) uc)%!s!%{else}Loading%{end} Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
June 9, 200817 yr Commercial Member Thank you Father Bill!Too bad about the country codes, but c'est la vie I guess.Ciao,Bryan B. York FS2Crew Web Site / FS2Crew Facebook Page / FS2Crew Discord
June 10, 200817 yr Author The little cracks and fissures in the SDK are always interesting as they are unearthed. Jeff Bea I am an avid globetrotter with my trusty Lufthansa B777F, Polar Air Cargo B744F, and Atlas Air B748F.
Create an account or sign in to comment