Jump to content
The simFlight Network Forums

AIR file offset


borgfan

Recommended Posts

Offset 0x3C00 is documented as providing the full path name to the current .air file and has worked fine except on MSFS where it gives a relative path from the simobjects folder, eg  "SimObjects\Airplanes\Asobo_C172sp_AS1000\aircraft.CFG".  Because of this I'm finding it difficult to locate and read the current aircraft.cfg.  I noticed in the FSUIPC logfile a line containing the full pathname of the aircraft.cfg, I'd be grateful for a hint as to how this was constructed.

I am reading the aircraft.cfg because at the moment the offsets for "ATC TYPE" and "ATC MODEL" (0x3160 and 0x3500) are not very useful.  For example ATC TYPE is returned as "TT:ATCCOM.ATC_NAME CESS", clearly more than 24 characters and hard to use in its current form. 

I also noticed that the aircraft.cfg contains some new entries "icao_type_designator", "icao_manufacturer" and icao_model".  These would be very useful if you could provide them as new offsets.

I appreciate that the MSFS sdk is far from complete and we are all working around the rough edges, thanks for your help.

Gerard

 

 

  • Upvote 1
Link to comment
Share on other sites

@borgfan The information is available after a little investigation.

0x3C00 - returns the \simobjects path as you state (simobjects\airplanes\{aircraft}\aircraft.cfg).

0x3E00 - returns the path to the \packages location (c:\users\{yourname}\appdata\local\packages\microsoft.FlightSimulator_{code}\ localcache\packages). The localcache is a shortcut that points, presumably, to the hidden MSFS install location.

If you strip off the last \packages directory (returned by 0x3E00) and add the \simobjects path (returned by 0x3C00) you will get the full path to the aircraft.cfg. eg. c:\users\{username}\appdata\local\packages\microsoft.FlightSimulator_{code}\localcache\simobjects\airplanes\{aircraft}\aircraft.cfg).

I hope this helps.

 

Link to comment
Share on other sites

Hi Gerard,

adding to what Andrew has said, there are no .air files in MSFS. And I don't see the full path name to the aircraft.cfg file in the log, only a relative path, e.g.
     8500 SimObjects\Airplanes\Asobo_FlightDesignCT\aircraft.CFG

1 hour ago, Scotfleiger said:

0x3D00 - returns the path to the /packages location (c:\users\{yourname}\appdata\local\packages\microsoft.FlightSimulator_{code}\ localcache\packages). The localcache is a shortcut that points, presumably, to the hidden MSFS install location.

But 0x3D00 is the name of the current aircraft....

0x3E00 currently contains the "installation path" or (FS UNC path), as determined from the UsrCfg.opt file. I'm not sure how useful this is.

Note also that locations are  different in a MS Store vs Steam install. I have a steam install (strings truncated to 32 chars unfortunately):
    90500 Monitor IPC:3C00 (AsciiZ) = [54]"SimObjects\Airplanes\Asobo_Fligh"
   996078 Monitor IPC:3D00 (AsciiZ) = [20]"FlightDesignCT Asobo"
  1336735 Monitor IPC:3E00 (AsciiZ) = [12]"D:\MSFS2020\"
  1575703 Monitor IPC:3F04 (AsciiZ) = [103]"C:\Users\jldow\AppData\Roaming\M"
  2649172 Monitor IPC:1000 (AsciiZ) = [58]"C:\Users\jldow\AppData\Roaming\M"
 

19 hours ago, borgfan said:

I am reading the aircraft.cfg because at the moment the offsets for "ATC TYPE" and "ATC MODEL" (0x3160 and 0x3500) are not very useful.  For example ATC TYPE is returned as "TT:ATCCOM.ATC_NAME CESS", clearly more than 24 characters and hard to use in its current form. 

Yes, they don't look very useful:
  1801953 Monitor IPC:3500 (AsciiZ) = [23]"TT:ATCCOM.AC_MODEL_FDCT"   - "TT:ATCCOM.AC_MODEL_FDCT.0.text" in aircraft.cfg
  1883547 Monitor IPC:3160 (AsciiZ) = [23]"TT:ATCCOM.ATC_NAME_FLIG" - "TT:ATCCOM.ATC_NAME_FLIGHTDESIGN.0.text" in aircraft.cfg

19 hours ago, borgfan said:

I also noticed that the aircraft.cfg contains some new entries "icao_type_designator", "icao_manufacturer" and icao_model".  These would be very useful if you could provide them as new offsets.

I can look into adding these. However, FSUIPC doesn't read the aircraft.cfg file, it gets the values via SimConnect, but these should be available I guess.

I'll look into this in more detail (but probably next week sometime).

John

 

Link to comment
Share on other sites

Hi John

I believe FSUIPC7 provides sufficient information to allow me to list the available MSFS aircraft programmatically (using 0x3C00 and 0x3E00) for LINDA. Add-on aircraft are accessible via the ..\localcache\packages\community and \official\onestore. I am assuming future add-ons will be required to be located in the \community directory like ORBX which uses a shortcut to the ORBX library. This is work in progress.

Link to comment
Share on other sites

Thanks for the help, unfortunately I don't see an easy way forward for what I want to do. It seems that there are so many installation varieties that contribute to a confusing mess.

As I have only a small SSD for my 😄 drive, I installed the MS version on 😧  This resulted in d:\MSFS2020 (my choice of name) containing the Community and Official folders.

Using the various offsets I get:

3c00 - Air file path
SimObjects\Airplanes\Asobo_C172sp_AS1000\aircraft.CFG

3e00 - FS Path
D:\MSFS2020\

3d00 - Aircraft title
Cessna Skyhawk G1000 Asobo

3500 aircraft model
TT:ATCCOM.AC_MODEL C172

3160 aircraft type
TT:ATCCOM.ATC_NAME CESS

When looking at the FSUIPC7 logfile I see for example:

8156 SimConnect_Open succeeded
8172 Running in "KittyHawk", Version: 11.0.282174.999 (SimConnect: 11.0.62651.3)
8172 MSFS version = 11.0.282174.999
8172 Initialising SimConnect data requests now
8172  C:\Users\Mars\AppData\Local\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalState\MISSIONS\Custom\CustomFlight\CustomFlight.FLT
8172 SimObjects\Airplanes\Asobo_C172sp_AS1000\aircraft.CFG
8187 User Aircraft ID 1 supplied, now being used
8234 Aircraft loaded: running normally now ...
8437 System time = 03/09/2020 11:18:30, Simulator time = 11:18:04 (10:18Z)
8437 Aircraft="Cessna Skyhawk G1000 Asobo"
65984 -------------------- Starting everything now ----------------------
1254031 Sim stopped: average frame rate for last 1246 secs = 29.4 fps
1254031    Max AI traffic was 23 aircraft
1254031 -------------------------------------------------------------------
1263703 D:\MSFS2020\Official\OneStore\asobo-aircraft-c172sp-s1000\SimObjects\Airplanes\Asobo_C172sp_AS1000\aircraft.CFG
1264093 flights\other\MainMenu.FLT
1288234 === QUIT notified! Saving "Previous Flight" ...
1293765 MSFS no longer running - exiting

Note that line 1263703 contains the full pathname of the aircraft.cfg.

When I first tried MSFS a week ago,  offset 3C00 did provide the full pathname to the .air file.  I suspect the results of 3C00 changed after the MSFS patch.

For me 0x3E00 - the path to the \packages location in "c:\users\...\packages" is an empty folder, probably because my packages are installed in d:\  I'd be wary then of using this location within LINDA to list aircraft as it wont work in a custom install. Hope this makes some kind of sense!

Link to comment
Share on other sites

3 hours ago, Scotfleiger said:

I believe FSUIPC7 provides sufficient information to allow me to list the available MSFS aircraft programmatically (using 0x3C00 and 0x3E00) for LINDA

Ok, that's good to know.

But I think I'll update 3C00 to contain the full path to the aircraft.cfg file, as it was previously. And maybe find some new offsets for those 3 new entries ("icao_type_designator", "icao_manufacturer" and "icao_model"). I'll post here again when this is done (next week sometime).

46 minutes ago, borgfan said:

When I first tried MSFS a week ago,  offset 3C00 did provide the full pathname to the .air file.  I suspect the results of 3C00 changed after the MSFS patch.

Yes, I believe something has changed - and different from the alpha/beta releases. I'll update for this (as I just said above).

47 minutes ago, borgfan said:

For me 0x3E00 - the path to the \packages location in "c:\users\...\packages" is an empty folder, probably because my packages are installed in d:\  I'd be wary then of using this location

I'm not sure about this one yet. As I said, this is the "installation path", the one you choose during the installation, and is taken from the UserCfg.opt file. I'm still not sure ho useful this is at the moment. Under a steam install, this contains a lot of data under .../'Official/Steam', and I guess the 'Community' folder would/may contain add-on info, but its difficult to know at the moment with the lack of info provided by MS/Asobo on how these folders are used. Currently, I am open to suggestions on what paths/folders would be useful to FSUIPC users for these offsets.

John

Link to comment
Share on other sites

16 minutes ago, John Dowson said:

But I think I'll update 3C00 to contain the full path to the aircraft.cfg file, as it was previously. And maybe find some new offsets for those 3 new entries ("icao_type_designator", "icao_manufacturer" and "icao_model"). I'll post here again when this is done (next week sometime).

Those would all be really helpful - thanks in advance if they're able to be provided 🙂

Link to comment
Share on other sites

On 9/4/2020 at 3:23 PM, borgfan said:

Note that line 1263703 contains the full pathname of the aircraft.cfg.

That's interesting, didn't notice that before, but that seems to be a later log entry logged when going back into the MSFS menus. The one that FSUIPC uses is the one logged when the aircraft is loaded:

On 9/4/2020 at 3:23 PM, borgfan said:

8172 SimObjects\Airplanes\Asobo_C172sp_AS1000\aircraft.CFG

It looks like this is the one that's changed. I don't think I have enough information to determine the full path to the aircraft.cfg file at the moment. I'll raise this with Asobo.

It also looks like there are no simvars for the "icao_type_designator", "icao_manufacturer" and "icao_model" at the moment either. I'll post about these as well.

Link to comment
Share on other sites

This is confusing me....

I've just taken another look, and now I am getting the full path name to the aircraft.cfg file in offset 0x3C00:

Quote

....    74297 User Aircraft ID not supplied -- trying default
   167031 AircraftLoaded Event
   167031 D:\MSFS2020\Official\Steam\asobo-aircraft-cap10c\SimObjects\Airplanes\Asobo_Cap10C\aircraft.CFG
   167313 flights\other\MainMenu.FLT
...
  180406 -------------------- Starting everything now ----------------------
   223266 AircraftLoaded Event
   223266 D:\MSFS2020\Official\Steam\asobo-aircraft-c172sp-classic\SimObjects\Airplanes\Asobo_C172sp_classic\aircraft.CFG
...
   261641 Monitor IPC:3C00 (AsciiZ) = [111]"D:\MSFS2020\Official\Steam\asobo"
...

@borgfan & @Dave March Could you see if you are now getting the full path or still getting the relative path please? Also, are you using a Steam install or an MS Store install?

Thanks,

John

Link to comment
Share on other sites

Yes, it would be great if those memory addresses can again point to useful plane type and model names.  My ACARS program currently displays TT:ATCCOM.ATC_NAME CESS , etc.

If there is a change or something I must do to alter programmatically to display simple type and model names again I'd appreciate the information.

 

Thanks,

John

Link to comment
Share on other sites

2 minutes ago, Jer029 said:

Yes, it would be great if those memory addresses can again point to useful plane type and model names.  My ACARS program currently displays TT:ATCCOM.ATC_NAME CESS , etc.

If there is a change or something I must do to alter programmatically to display simple type and model names again I'd appreciate the information.

I'll put a request in to see if I can get these added as simvars. For the time being, you could maybe use the aircraft title (offset 0x3D00).

John

Link to comment
Share on other sites

Triple confused ....  I'm running the MS Store version and just checked the value of 0x3c00 using FSInterrogate2std.  Result was the full path to aircraft.cfg.

Also confirmed in the FSUIPC7 logfile.

 110141 Aircraft loaded: running normally now ...
 115938 User Aircraft ID not supplied -- trying default
 188813 D:\MSFS2020\Official\OneStore\asobo-aircraft-c172sp-as1000\SimObjects\Airplanes\Asobo_C172sp_AS1000\aircraft.CFG

I'm not aware of any updates being applied and I haven't changed my system in any way. No magic involved so I can only assume that MS must be playing silly b....rs with invisible online changes.

Link to comment
Share on other sites

1 hour ago, John Dowson said:

This is confusing me....

I've just taken another look, and now I am getting the full path name to the aircraft.cfg file in offset 0x3C00:

@borgfan & @Dave March Could you see if you are now getting the full path or still getting the relative path please? Also, are you using a Steam install or an MS Store install?

Thanks,

John

Hi John,

I can confirm today I'm getting the full path!

Dave

Link to comment
Share on other sites

@borgfan & @IanAbel I have now added the ICAO designator, manufacturer and model (read directly from the aircraft.cfg file) to the following offsets:
    icao_type_designator: 0x0618, 16 bytes (including string terminator)
    icao_manufacturer: 0x09D2, 16 bytes (including string terminator)
    icao_model: 0x0B26, 32 bytes (including string terminator)

However, not that these will only be available if the full path name of the aircraft.cfg file is received AND if it exists! I say this as, during testing this, I noticed that when loading the C172 classic (without G1000), I receive the aircraft.cfg file as
    D:\MSFS2020\Official\Steam\asobo-aircraft-c172sp-classic\SimObjects\Airplanes\Asobo_C172sp_classic\aircraft.CFG

However, this file does not exist....! There does not seem to be an aircraft.cfg file for this aircraft model.

Also, it seems that the path to this file is relative if/when you start FSUIPC7 AFTER the plane has been loaded in MSFS, but the full path is given if you load or change the plane when FSUIPC7 is already running.

I will post to Asobo about these various issues.

I will release the build containing this update later this evening (or perhaps tomorrow morning).

John

 

  • Thanks 1
Link to comment
Share on other sites

Thanks for this John, its exactly what I need to update my acars application.  Hopefully Asobo will make path reporting more robust in the near future. 

In the interim, as an experiment I've written a function to traverse the package folder to locate all aircraft.cfg files and then extract the relevant icao entries based on the aircraft title provided by FSUIPC. Problem is that it takes an appreciable time doing this, ~18 secs on my PC and therefore not really suitable for a production system.

Appreciate the effort you've put into this

Gerard 

Link to comment
Share on other sites

5 hours ago, John Dowson said:

However, not that these will only be available if the full path name of the aircraft.cfg file is received AND if it exists! I say this as, during testing this, I noticed that when loading the C172 classic (without G1000), I receive the aircraft.cfg file as
    D:\MSFS2020\Official\Steam\asobo-aircraft-c172sp-classic\SimObjects\Airplanes\Asobo_C172sp_classic\aircraft.CFG

However, this file does not exist....! There does not seem to be an aircraft.cfg file for this aircraft model.

I wonder if that relates to/is an issue with the Steam version? I've got the gamepass version, installed in a custom folder and the path;

K:\MSFS\Official\OneStore\asobo-aircraft-c172sp-as1000\SimObjects\Airplanes\Asobo_C172sp_AS1000 contains an aircraft.cfg file!

Seems there's a lot that's not "standardized" in MSFS <sigh>

Link to comment
Share on other sites

12 minutes ago, IanAbel said:

I wonder if that relates to/is an issue with the Steam version? I've got the gamepass version, installed in a custom folder and the path;

K:\MSFS\Official\OneStore\asobo-aircraft-c172sp-as1000\SimObjects\Airplanes\Asobo_C172sp_AS1000 contains an aircraft.cfg file!

Well, there isn't one in the MS-Store install either. Could yours be left over from a previous install, i.e. not the release version? Were you testing the Alpha/Beta versions at all?

Pete

 

Link to comment
Share on other sites

3 hours ago, Pete Dowson said:

Well, there isn't one in the MS-Store install either. Could yours be left over from a previous install, i.e. not the release version? Were you testing the Alpha/Beta versions at all?

Pete,

 No, I wasn't involved at all pre-release, this is a "simple" gamepass new install once released!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.