SimConnect_AISetAircraftFlightPlan

The SimConnect_AISetAircraftFlightPlan function is used to set or change the flight plan of an AI controlled aircraft.

 

Syntax
HRESULT SimConnect_AISetAircraftFlightPlan(
        HANDLE  hSimConnect,
        SIMCONNECT_OBJECT_ID  ObjectID,
        const char*  szFlightPlanPath,
        SIMCONNECT_DATA_REQUEST_ID  RequestID
      );

 

Parameters
Parameter Description Type
hSimConnect Handle to a SimConnect object. Integer
ObjectID

Specifies the server defined object ID.

Integer
szFlightPlanPath Null-terminated string containing the path to the flight plan file. Flight plans have the extension .pln, but no need to enter an extension here. The easiest way to create flight plans is to create them from within the simulation, and then save them off for use with the AI controlled aircraft. String
RequestID Specifies the client defined request ID. Integer

 

Return Values

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return value Description
S_OK The function succeeded.
E_FAIL The function failed.

 

Remarks

The following errors may apply to AI objects (refer to the SIMCONNECT_EXCEPTION enum for more details):

  • SIMCONNECT_EXCEPTION_LOAD_FLIGHTPLAN_FAILED
  • SIMCONNECT_EXCEPTION_OPERATION_INVALID_FOR_OBJECT_TYPE
  • SIMCONNECT_EXCEPTION_ERROR

 

Typically this function would be used some time after the aircraft was created using the SimConnect_AICreateParkedATCAircraft call.

 

See Also