Can anyone point to the documentation for AP related variables that I can SET? I see documentation on a whole host of variables starting with AUTOPILOT which are mostly not settable. I have been able to set a few using variables starting with AP for airspeed (AP_SPD_VAR_SET) and altitude (AP_ALT_VAR_SET_ENGLISH) but have not been able to find documentation on heading (AP_HDG_VAR_SET doesn’t work).
I’m using python/SimConnect to interface a simple set of controls to set the A320 heading, altitude and speed.
In a simulator, it would not be sensible to make things like “heading” writable, because “heading” is a result from simulator input, like aeleron and rudder. The result of “heading” is displacement of the aircraft. If you want to change heading, you could change aeleron, take a short idle, then inspect the new heading and correct accordingly… until the aircraft is on course. In RL, an autopilot works like this.
Maybe there’s another option for you. The lowest level, which is aircraft position and orientation CAN be manipulated. But in that case you’d have to provide a real movement path ! There’s an addin named FlightRecorder that allows playback. This playback completely controls the aircraft and makes use of “hardwired” airplane positioning, bank, pitch and yaw angle. It will bypass the simulator completely, but you are on your own… Have a look at it, this is a very well structured little program, it shows a lot of other writable variables as well, so it could answer some of your questions…
They are asking for the heading select value for the AP mode. Not the current heading of the aircraft.
I know that it’s writable, but I have to look up which variable that is.
The documentation in the SDK is a mess. “SimConnect_MapClientEventToSimEvent()” is not in the “Contents” tab but can be found using the “Search” tab. Also, the list of event names is under the heading “Legacy Event IDs”, without explaining why they are considered “legacy” since they do appear to work.
If you want a list that is a bit easier to read, try the Prepar3D documentation. The event list is under “Software Development Kit (SDK)” => “References” => “Variables” => “Event IDs”.
Legacy is the wording for features or data that is kept in software to keep supporting older interfaces etc. for backwards compatibility.
It usually means that it’s no longer extended with new features/data.
For anyone doing new development it means that you rather should use a new API/IDs instead to have a future development path with new stuff added along the way. It’s simply more future-proof.
At the same time it might mean that software developed with the new API will not work with other/older sims since they mainly serve the legacy API only.
Fine, but can you point me to the non-legacy list then? The SDK documentation I have only contains a legacy list. The explanation of the SimConnect_TransmitClientEvent() and SimConnect_MapClientEventToSimEvent() calls actually only refer to this list, without marking either function as legacy.
The text above the list actually does state “The EventIds listed here are purely for reference and legacy support,” so if you insist on language lawyering, one could read this as meaning that some are for reference, while others are for legacy support.
My gripe is that the list appears marked as legacy, but without any explanation, and surrounding documentation does refer to the list without warning you that it is legacy.
Yes, leaving out “KEY_” is necessary to get the SimConnect name. Note that this document belongs to “ESP”, which is the base of the FSX and Prepar3D product ranges. For MSFS 2020 this is not a definite list.
I once stumbled over the exact same question (and am still looking for a general answer myself ;)). May I suggest to continue the discussion - if there is ongoing interest about this topic, that is - in the following thread (in order not to “hijack” this thread about setting the AP - which to my understanding has already been answered, too):
Case in point: while I figured out a way to enable/disable lights via simulation variables (instead of events) there are still plenty of events which do not have an equivalent (writeable) simulation variable. And then there is functionality like “freeze altitude” etc. for which no simulation variable exists either.
And it is not even clear what the way going forward is supposed to be: provide more and more writeable simulation variables and drop events alttogether? Or replace events with something new?