1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to get aircraft.cfg for current aircraft

Discussion in 'SimConnect' started by DocMoriarty, 8/4/07.

  1. DocMoriarty

    DocMoriarty

    Joined:
    20/12/06
    Messages:
    64
    Country:
    germany
    Maybe i have missed something but if a simconnect client is loaded after the user loaded an airplane (thus missing the load aircraft event) then there is no really safe way to determine which aircraft the user is flying. All string data returned contains just stuff from aircraft.cfg's (Title, Model etc.) but nothing reliable to determine the directory of the aircraft.

    I wish there would be a simulation variable that points to the SimObjects directory in which the current users airplane resides.

    Currently i'm implementing heuristics to determine the aircraft using title, model etc. but that also means i have to scan the simobjects directory for installed stuff.
  2. jcboliveira

    jcboliveira

    Joined:
    8/6/04
    Messages:
    150
    Country:
    portugal
    I also need the aircraft.cfg location in a program. In FSX the task proved dificult since you can add new simobjects locations. This why still have the program in FSUIPC.

    José
  3. DocMoriarty

    DocMoriarty

    Joined:
    20/12/06
    Messages:
    64
    Country:
    germany
    Glad i'm not alone :)

    Since we are at it, how would it be if FS/SimConnect would provide information on the following files/directories via Simulation Variables:

    - current loaded flight file
    - current aircraft folder
    - current flightplan file if one active
    - current mission file if player is playing a mission

    Currently for missions there is no way to determine whats active.

    I consider this information vital and it's useful for a lot of possible applications that can't just live with the information provided by SimConnect.

    Also the file loading events are great and should stay but if you missed the event since user was loading addon after the event took place there is no way to get the info.

    For example i want to save the aircraft folder of the aircraft used in my flight log. If it's within FS root directory i save a relative path, if it's outside (if thats possible at all) i will save an absolute path (not great but better than nothing).

    Currently i determine the aircraft used by searching the aircraft title returned by SimConnect in all aircraft.cfg's. Not the most performant and effective way to do it.
    Last edited: 8/4/07
  4. lc0277

    lc0277

    Joined:
    25/9/06
    Messages:
    156
    Country:
    france
    Hi,

    RequestSystemState with "AircraftLoaded" state.
    You will get the full pathname of the currently used .air file. Works in most cases, where the .air file is in the same dir as main ac directory. Not 100% reliable though, but I've not seen many aircraft.cfg with aliased or foreign sim= directive. :confused:

    You can also get notifications of aircraft changes (SubscribeToSystemEvent with the same state string)
  5. DocMoriarty

    DocMoriarty

    Joined:
    20/12/06
    Messages:
    64
    Country:
    germany
    Ah thanks, RequestSystemState was what i have been missing. Though as you mentioned it's also not perfect, so think some reliable basic file and folder info about files that make up the current situation in SimConnect wouldn't hurt.

Share This Page