Hi,
In P3D simconnect SDK, there is a WPF project - Managed Weapon Station Selection.
When reading the name of the aircraft, it uses
this.SimConnect.AddToDataDefinition(DataIdentifier.RecieveSimObjectGeneral,
"title", // Simulation Variable
null, // Units - for strings put 'null'
SIMCONNECT_DATATYPE.STRING256, // Datatype
0.0f,
SimConnect.SIMCONNECT_UNUSED);
Now I want to read the ICAO code of the departure airport in the current schedule, I make it
this.SimConnect.AddToDataDefinition(DataIdentifier.RecieveSimObjectGeneral,
"AI TRAFFIC FROMAIRPORT", // Simulation Variable
null, // Units - for strings put 'null'
SIMCONNECT_DATATYPE.STRING256, // Datatype
0.0f,
SimConnect.SIMCONNECT_UNUSED);
I confirm that I have set the the departure airport in the current schedule, but it shows nothing. Why? Thanks.
Kind regards,
Jeff
Read airport ID failed
- Rob McCarthy
- Lockheed Martin
- Posts: 3703
- Joined: Wed Aug 24, 2011 1:37 pm
Re: Read airport ID failed
Jeff,
Which vehicle are you attempting to read this data from. Is this an AI traffic aircraft?
Regards,
Rob McCarthy
Which vehicle are you attempting to read this data from. Is this an AI traffic aircraft?
Regards,
Rob McCarthy
Rob McCarthy
Prepar3D® Core Lead
Prepar3D® Core Lead
-
- Posts: 58
- Joined: Fri Aug 18, 2017 1:04 am
Re: Read airport ID failed
Hi Rob,
I was attempting to read the airport information of my own aircraft in the game, not an AI traffic aircraft.
Thanks,
Jeff
I was attempting to read the airport information of my own aircraft in the game, not an AI traffic aircraft.
Thanks,
Jeff
Re: Read airport ID failed
Hello Jeff,
not possible. You can only read the ICAO from an AI aircraft that is following a schedule.
Learning Center -> SDK -> References -> Variables -> Simulation variables -> AI TRAFFIC FROMAIRPORT
Note (2) says:
Oliver Binder
Lorby-SI
not possible. You can only read the ICAO from an AI aircraft that is following a schedule.
Learning Center -> SDK -> References -> Variables -> Simulation variables -> AI TRAFFIC FROMAIRPORT
Note (2) says:
Best regardsThese variables only make sense for aircraft generated by the traffic database, and so have schedules. If an aircraft does not have a schedule, the value returned will be 0 (or false), or an empty string, depending on the units.
Oliver Binder
Lorby-SI