Air Manager / LUA / X-Plane best practice in using commands vs dataref write

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Post Reply
Message
Author
SimPassion
Posts: 5338
Joined: Thu Jul 27, 2017 12:22 am

Air Manager / LUA / X-Plane best practice in using commands vs dataref write

#1 Post by SimPassion »

Better use Commands (xpl_commands) when they are available, as sometime and even often, it may occurs in weird behavior when using "xpl_dataref_write"

.../...

We Love Commands

As you may have noticed from this list and the ever-growing size of X-Plane’s built-in command list, we love commands – they have become our go-to mechanism for our aircraft. Commands have a few advantages over data-refs:

There is a clear design in the plugin system for changing a command’s behavior. So a third party aircraft can easily “take over” the existing engine start command. This is very, very difficult to accomplish via datarefs.
Commands can be mapped directly to joystick and keyboard hardware. There is no way to bind a joystick to a dataref.*
Commands can be mapped to sound to capture the act of the user “doing” the thing, regardless of whether it works. For example, if you want the click of the starter switch regardless of whether the starter motor engages (maybe the battery is dead), commands make this easy to do. Often there is no dataref for ‘the user is trying but it’s not working’.

.../...

general meaning extract, from an article rather dedicated to VR (which is not the goal of this topic), source here : https://developer.x-plane.com/2018/01/m ... mechanism/

Gilles

Post Reply