While I have been in the Orbiter community since the M6 days, and Lua scripting has been a feature since at least Orbiter 2010 if not earlier, I've only recently started tinkering with it in Orbiter 2016 within the last year to make add-ons as it is easier to work than trying to setup C++ on a Linux machine. As Orbiter is now open source, I am wondering if any further development of Lua scripting is being done? Is Lua at a dead-end in Orbiter? Lua does seem to be an excellent way to lower the barrier to entry to add-on development and potentially prevent a lot of add-ons from dying when their C++ .dlls become obsolete in newer versions.
Lua seems to have quite a lot of the functionality of the C++ API. But in my scripting efforts I've been stymied by the following issues which really challenge the use of Lua scripting as a fully viable and robust means to make add-ons (FYI I am using Orbiter 2016 on Linux). I offer these as a running punch-list for anyone who may be working on Lua scripting development:
Lua seems to have quite a lot of the functionality of the C++ API. But in my scripting efforts I've been stymied by the following issues which really challenge the use of Lua scripting as a fully viable and robust means to make add-ons (FYI I am using Orbiter 2016 on Linux). I offer these as a running punch-list for anyone who may be working on Lua scripting development:
- No ability to save or retrieve MFD states in the scenario file. There are MFD callbacks readstatus(scn) and writestatus(scn) which are documented in the Orbiter Help documentation, but there are no examples of their use, and there apparently is no way to actually read or write anything to the scenario file within them. [Github Issue #404]
- No ability to save or retrieve vessel states in the scenario file. There don't seem to be any vessel callbacks to allow this at all in Lua. It is possible to read and write using standard Lua I/O, but that rather breaks the click-and-go functionality of the scenario files.[Github Issue #405]
- Need for absolute file paths for loading Lua modules, accessing Orbiter data files, etc. There is a vessel helper function add_mesh to load mesh files which can use relative paths from the main Orbiter Mesh folder, but for anything else an absolute path is needed. I understand that this is a general "feature" of Lua I/O, but it can complicate making a general add-on that would work for anyone. A helper function that would allow relative paths from the main Orbiter folder for general I/O would be very helpful.
- No analog of callback DrawHud is available in Lua. Text can be written to the HUD using the annotation method, but custom indicators like the DG landing gear status indicators are not possible.
- Keypress detection in vessel scripts (to activate landing gear, canopy openings, other vessel functions) requires the following additional module and procedure to be implemented in Lua. https://www.orbiter-forum.com/threads/trying-to-implement-keypress-detection-in-lua-solved.41000/ It works, but something more organic like the keypress callbacks in the C++ API would be helpful.
Last edited: