kaha Posted January 7 Author Report Posted January 7 Unfortunately this doesn't work out. It depends if the ATC Type in the aircraft.cfg file has been set correctly. Just 3 examples: AH's Cessna 170: "C170BT" Miltech's Chinook: "$$:Helicopter" Microsoft's Bell 47J: "Bell"
John Dowson Posted January 7 Report Posted January 7 Then you need to look into the SDK to see if this information is available anywhere. The aircraft type, as known by applications via the simconnect interface/API, is determined by the SIMCONNECT_SIMOBJECT_TYPE stricture when received, which has the following values: Quote SIMCONNECT_SIMOBJECT_TYPE_USER Specifies the user's aircraft. SIMCONNECT_SIMOBJECT_TYPE_ALL Specifies all AI controlled objects. SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT Specifies all aircraft. SIMCONNECT_SIMOBJECT_TYPE_HELICOPTER Specifies all helicopters. SIMCONNECT_SIMOBJECT_TYPE_BOAT Specifies all AI controlled boats. SIMCONNECT_SIMOBJECT_TYPE_GROUND Specifies all AI controlled ground vehicles. So for all other aircraft/objects (e.g. AI traffic) the type is known, but for the aircraft/object you are flying/controlling it is always SIMCONNECT_SIMOBJECT_TYPE_USER, and it is expected that the the user knows its type. This is obviously not optimal for third party software that need to determine the type, but I do not know how to determine the type by other means. I will take a look at the SDK in the next few days to see if this information is available via other means and let you know, otherwise I can raise a bug/request to see if this can be added. John
John Dowson Posted February 14 Report Posted February 14 Just an update - I haven't seen anything in the SDK that can reliably be used to determine if the user object is a helicopter. I also asked on the Asobo SDK forums a few weeks ago and have yet to receive a response. So it looks like this is not possible. Maybe you could check to see if one of the helicopter-specific simvars is being used (i.e. non-zero) - see https://docs.flightsimulator.com/flighting/html/Programming_Tools/SimVars/Helicopter_Variables.htm. Also not reliable though, for example they would all be 0 when cold and dark. I will let you know if I ever receive a response on this question in the Asobo forums. Cheers, John
John Dowson Posted June 2 Report Posted June 2 @kaha In MSFS2024, the SU2 release contained two new simvars that may be useful in determining the type of the user aircraft: Quote AIRCRAFT CATEGORY Returns the category of the aircraft as defined by the ui_typerole parameter. String AIRCRAFT OBJECT CLASS Returns the aircraft class. This will either be a string interpreted from the object_class parameter, or an inferred value based on the AIRCRAFT CATEGORY if the class parameter is missing. String: AIRPLANE HELICOPTER GLIDER LIGHTERTHANAIR ("Ballon" or "Airship" object_class) OTHER (all other object_class) Unfortunately these are only available in MSFS2024 though and not in MSFS2020.
kaha Posted June 8 Author Report Posted June 8 John, I'm not familiar with simvars, so I probably need your help here. From the FSUIPC manual I learned that I need to have a file named myOffsets.txt. This is my try: // offset, size, simvar, type, units [, w] 0x66C0, 4, object_class, S16, Number I don't know the max length of the simvar. Anyway, I get error messages in the console. I found a simvar CATEGORY https://docs.flightsimulator.com/html/Programming_Tools/SimVars/Miscellaneous_Variables.htm If I use that one there are no errors in the console but the string is empty. Could you please guide me how to use that? Thanks, Karl
John Dowson Posted June 8 Report Posted June 8 15 minutes ago, kaha said: From the FSUIPC manual I learned that I need to have a file named myOffsets.txt. This is my try: // offset, size, simvar, type, units [, w] 0x66C0, 4, object_class, S16, Number Two things wrong here: - there is no such type as S16 - use S32. And 4 bytes is too small - that should probably be 16 - the simvar name is AIRCRAFT OBJECT CLASS, not object_class 22 minutes ago, kaha said: I found a simvar CATEGORY https://docs.flightsimulator.com/html/Programming_Tools/SimVars/Miscellaneous_Variables.htm If I use that one there are no errors in the console but the string is empty. Ah, missed that one, and that one is better as it also exists in MSFS2020. Just tried this in both MSFS2020 and MSFS2024 with the following entry in the myOffsets.txt file: Quote // offset, size, simvar, type, units [, w] 0x66C0, 16, CATEGORY, S32, Number and this seems to work in both MSFS2020 and MSFS2024: Quote 15344 WAPI enabled 15344 Initialising SimConnect data requests now 15360 Adding simvar 'CATEGORY' to offset 66C0 (size 16, type 'S32') for read-only access ... 17657 Monitor IPC:66C0 (AsciiZ) = [8]"Airplane" 17657 SimRead: 66C0="CATEGORY" STR32: "Airplane" 19875 Aircraft="Cessna Skyhawk Asobo" ... Quote 47547 WAPI enabled 47562 Generating controls file list: 'C:\Users\jldow\OneDrive\Documents\FSUIPC7\Controls List for MSFS Build 121.txt' 47609 Initialising SimConnect data requests now ... 77484 Monitor IPC:66C0 (AsciiZ) = [10]"Helicopter" 77484 SimRead: 66C0="CATEGORY" STR32: "Helicopter" 79687 Aircraft="Bell 407" John
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now