SimConnect_AICreateSimulatedObject_EX1
The SimConnect_AICreateSimulatedObject_EX1 function is used to create AI controlled objects other than aircraft. This function can be used with both legacy SimObjects, and modular SimObjects.
Syntax
HRESULT SimConnect_AICreateSimulatedObject_EX1(
HANDLE hSimConnect,
const char* szContainerTitle,
const char* szLivery,
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 found in the title parameter of the
|
String |
szLivery |
Null-terminated string containing the livery name. This field is only required when checking modular SimObjects, since their liveries are dynamically handled and do not have a unique title parameter like legacy aircraft. This parameter can be set to either the name of the livery as defined in the The function will check for the folder first, then the parameter name second, and if the given name is not found in either location, then the default livery will be used. |
String |
InitPos | This a SIMCONNECT_DATA_INITPOSITION struct containing the data referring to the spawn position of the SimObject. |
Struct |
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).
The following exception can be created by this function (refer to the SIMCONNECT_EXCEPTION enum for more details):
SIMCONNECT_EXCEPTION_CREATE_OBJECT_FAILED