ExtPlane-Panel icon indicating copy to clipboard operation
ExtPlane-Panel copied to clipboard

Add support for custom commands

Open vranki opened this issue 12 years ago • 1 comments

X-Plane has support for custom commands. Study what kind of protocol is needed to support them and implement it in the code. Should be pretty straightforward.

Example code with custom command:

http://www.xsquawkbox.net/xpsdk/mediawiki/Custom_Command_with_Custom_DataRef

vranki avatar Nov 25 '13 13:11 vranki

I've made a kludgy workaround: a plugin which interfaces datarefs to commands. When set up (hardcoded at the moment) you can write to, for instance, the dataref cmd/baro_up and it will trigger the X-Plane command sim/instruments/barometer_up.

Here's a demo video, using mildly modified versions of the instruments in vranki/ExtPlane-Panel, showing an ExtPlane-Panel interface for Philipp Muenzel's XCIVA inertial nav simulation.

http://www.youtube.com/watch?v=RtuIz3nypJY

(This was a quick hack when I had problems persuading ExtPlane to compile to a working plugin, uploaded here. Native support for commands would be much better!)

Acting on existing X-Plane commands is dead simple. XPLMCommandRef foo = XPLMFindCommandRef( char[] identifier ) to search for the command by name, XPLMCommandBegin( foo ), XPLMCommandEnd( foo ), and/or XPLMCommandOnce( foo ) to operate the command. That's about it! Three functions and an identifier.

JDeeth avatar Nov 28 '13 17:11 JDeeth