Global Aircraft Access

These APIs let you control the AI aircraft and take over multiplayer/aI aircraft control.


XPLM_USER_AIRCRAFT

define

The user's aircraft is always index 0.

#define XPLM_USER_AIRCRAFT 0


XPLMPlaneDrawState_t

struct XPLM_DEPRECATED

This structure contains additional plane parameter info to be passed to draw plane. Make sure to fill in the size of the structure field with sizeof(XPLMDrawPlaneState_t) so that the XPLM can tell how many fields you knew about when compiling your plugin (since more fields may be added later).

Most of these fields are ratios from 0 to 1 for control input. X-Plane calculates what the actual controls look like based on the .acf file for that airplane. Note for the yoke inputs, this is what the pilot of the plane has commanded (post artificial stability system if there were one) and affects ailerons, rudder, etc. It is not necessarily related to the actual position of the plane's surfaces!

typedef struct {
     int                       structSize;
     float                     gearPosition;
     float                     flapRatio;
     float                     spoilerRatio;
     float                     speedBrakeRatio;
     float                     slatRatio;
     float                     wingSweep;
     float                     thrust;
     float                     yokePitch;
     float                     yokeHeading;
     float                     yokeRoll;
} XPLMPlaneDrawState_t;

XPLMCountAircraft

function

This function returns the number of aircraft X-Plane is capable of having, as well as the number of aircraft that are currently active. These numbers count the user's aircraft. It can also return the plugin that is currently controlling aircraft. In X-Plane 7, this routine reflects the number of aircraft the user has enabled in the rendering options window.

XPLM_API void       XPLMCountAircraft(
                         int *                outTotalAircraft,    /* Can be NULL */
                         int *                outActiveAircraft,    /* Can be NULL */
                         XPLMPluginID *       outController    /* Can be NULL */
                    );

XPLMGetNthAircraftModel

function

This function returns the aircraft model for the Nth aircraft. Indices are zero based, with zero being the user's aircraft. The file name should be at least 256 chars in length; the path should be at least 512 chars in length.

XPLM_API void       XPLMGetNthAircraftModel(
                         int                  inIndex,
                         char *               outFileName,    /* Can be NULL */
                         char *               outPath    /* Can be NULL */
                    );