Jump to content

[SOLVED] Fly with Lua scripting.


matrosov
 Share

Recommended Posts

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.  

Edited by Pils
Link to comment
Share on other sites

  • Pils changed the title to [SOLVED] Fly with Lua scripting.
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...