SimConnect_AICreateSimulatedObject

The SimConnect_AICreateSimulatedObject function is used to create AI controlled objects other than aircraft.

 

Syntax
HRESULT SimConnect_AICreateSimulatedObject(
    HANDLE  hSimConnect,
    const char*  szContainerTitle,
    SIMCONNECT_DATA_INITPOSITION  InitPos,
    SIMCONNECT_DATA_REQUEST_ID  RequestID
    );

 

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

Null-terminated string containing the container title. The container title is case-sensitive and can be found in the sim.cfg file.

NOTE: Only Dynamic SimObjects can receive "AI Waypoint" data via SimConnect_SetDataOnSimObject.

String
InitPos Null-terminated string containing the tail number. This should have a maximum of 12 characters. 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

This function can be used to create a stationary aircraft (such as an unflyable aircraft on display outside a flight museum), but is typically intended to create simulation objects other than aircraft (such as ground vehicles, boats, and a number of special objects such as humpback whales and hot-air balloons).

 

The following exception can be created by this function (refer to the SIMCONNECT_EXCEPTION enum for more details):

  • SIMCONNECT_EXCEPTION_CREATE_OBJECT_FAILED

 

See Also