FlyWithLua NG+ is the quickest way to add a feature to X-Plane 12. You write a text file, reload scripts, and it's running. No compiler.
We'll make a readout with your airspeed and height that also shows how hard you touched down.
Where scripts live
Install FlyWithLua into Resources/plugins/FlyWithLua. Scripts go in its Scripts folder. Create landing_readout.lua there.
The script
dataref("ha_ias", "sim/flightmodel/position/indicated_airspeed", "readonly")
dataref("ha_agl", "sim/flightmodel/position/y_agl", "readonly")
dataref("ha_vs", "sim/flightmodel/position/vh_ind_fpm", "readonly")
dataref("ha_ground", "sim/flightmodel/failures/onground_any", "readonly")
ha_show = true
ha_line = ""
ha_landing = ""
local was_airborne = false
local last_descent = 0
function ha_watch()
ha_line = string.format("IAS %.0f kt AGL %.0f ft", ha_ias, ha_agl * 3.28084)
if ha_ground == 0 then
was_airborne = true
last_descent = ha_vs
ha_landing = ""
elseif was_airborne then
was_airborne = false
ha_landing = string.format("Touchdown %.0f fpm", math.abs(last_descent))
end
end
function ha_draw()
if not ha_show then
return
end
draw_string(50, SCREEN_HIGHT - 100, ha_line, "white")
draw_string(50, SCREEN_HIGHT - 120, ha_landing, "yellow")
end
do_every_frame("ha_watch()")
do_every_draw("ha_draw()")
create_command("hangaraddons/readout/toggle", "Show or hide the landing readout", "ha_show = not ha_show", "", "")
add_macro("Landing readout", "ha_show = true", "ha_show = false", "activate")
