dornier Posted June 23, 2016 Report Posted June 23, 2016 Hi, How to do I assign the APU start switch to a joystick switch? I can't find an APU switch option under IXEG custom commands or even x-plane. Thanks, George Quote
mmerelles Posted June 23, 2016 Report Posted June 23, 2016 there is no custom command to map. you have to use a plugin or script to assign your button to write/manipulate the apu dataref "ixeg/733/apu/apu_start_switch_act" all custom commands and datarefs are documented under the aircraft doc folder "2. interface guide.pdf" Quote
Andrey Novikov Posted April 23, 2017 Report Posted April 23, 2017 On 23/06/2016 at 5:32 AM, mmerelles said: there is no custom command to map. you have to use a plugin or script to assign your button to write/manipulate the apu dataref "ixeg/733/apu/apu_start_switch_act" all custom commands and datarefs are documented under the aircraft doc folder "2. interface guide.pdf" Can someone show an example of such script? (Lua) I have added some hardware switches but do not know how to read their state and how to manipulate datarefs. Quote
jfjoubert Posted April 23, 2017 Report Posted April 23, 2017 Here's a very simple LUA script which will create a custom command which can be mapped to a single hardware switch/button to toggle the APU switch from off to start and back to off.If you have a 3 position switch then you'll have to modify the script to have 3 commands instead of one... one command for each APU switch position. Have a look at the attached script... it's really easy once you know how to use it. I did add some comments in the script to explain what I'm doing. Ask if you need help. ixeg_apu.lua 1 Quote
Andrey Novikov Posted April 24, 2017 Report Posted April 24, 2017 Thanks a lot, Jean! Everything looks self explanatory except `create_command` function. Where can I find API reference? I'm curious about last two parameters and why function call is inside double-array (if it is double-array). Quote
jfjoubert Posted April 24, 2017 Report Posted April 24, 2017 Hi Andrey, As far as I know there is some documentation under the FlyWithLUA folder under Resources\plugins... not 100% sure as I'm not at my home pc right now. You can also get it from Github... https://github.com/X-Friese/FlyWithLua In short here are the paramaters required for create_command() function... create_command(string unique_command_name, string command_description, string lua_code_to_execute_once_when_command_starts, string lua_code_to_execute_when_button_key_is_held_down, string lua_code_to_execute_when_command_ends) So paramaters 3, 4 and 5 will execute LUA code when button pressed initially (3), then when button is held down(4), and lastly when button is released(5). Note that all paramaters must be text surrounded by quotes... I think this is the reason why the function call is inside double brackets... it must be a string but it's still a LUA function which needs to be called so in theory it's not just a plain string. This is just a way that LUA handles strings. PS: I'm no LUA expert by any stretch of the imagination. Hope this helps. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.