Is there something special going on the Lua scripting? When I try to bind commands or datarefs thru lua the switch freezes up. It can't be moved interactively in cockpit and does not respond to the controller input. It works fine if I try to manipulate it thru DataRef Tool.
Here's the quick example
-- define the joystick offsets (for button assignments)
if PLANE_ICAO == "CL60" and AIRCRAFT_FILENAME == "CL650.acf" then
-- Bind datrefs to working variables
Nav_On="sim/lights/nav_lights_on"
Nav_Off="sim/lights/nav_lights_off"
dataref("Nav","CL650/overhead/ext_lts/nav","writable")
function CL60_NavLogo_On()
command_once(Nav_On)
end
function CL60_NavLogo_Off()
command_once(Nav_Off)
end
create_command("FlyWithLua/CL60_macros/01", "Nav_On", "CL60_NavLogo_On())", "", "")
create_command("FlyWithLua/CL60_macros/02", "Nav_Off", "CL60_NavLogo_Off())", "", "")
end
It works just fine if I assign it directly but if it's in lua it freezes. switch up.