Jump to content
Sign in to follow this  
lancealotg

Landing Light toggle (NGX)

Recommended Posts

PMDG 737 NGXHaving some trouble editing the lua file to make the landing lights toggle with one button.Tried a few things but I cant seem to get it.It works great if I assign two buttons, one for on and one for off, but I would like to only use one button. Can anyone nudge me in the right direction?

Share this post


Link to post
Share on other sites

Add this function somewhere inside "Lights, external" section:

function NGX_LAND_ALL_toggle ()	if _t('LAND_ALL') then    	NGX_LAND_ALL_on ()	else    	NGX_LAND_ALL_off ()	endend

...and assign it.


Artem Crum, EASA PPL
•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
LINDA Lua Integrated Non-complex Device Assigning
•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

Share this post


Link to post
Share on other sites

Send the CTRL + L key presses via LINDA, this is the default key shortcut which toggles the landing lights on and off for the NGX. EDIT: you beat me to it Artem with a more elegant method.


Cheers, Andy.

Share this post


Link to post
Share on other sites

Forgot to check for the default shortcut blush.pngAdded Artem's code and it works great. Thanks Artem and Andy, much appreciated. Looking at Artem's code brings up another question though, what is the _t in the code signify?

Share this post


Link to post
Share on other sites
Looking at Artem's code brings up another question though, what is the _t in the code signify?
This is a part of LINDA framework. We call it "universal toggler". This is just an easy way to toggle two parts of code on each call. String in parentheses is a unique identifier for this particular toggling case.

Artem Crum, EASA PPL
•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
LINDA Lua Integrated Non-complex Device Assigning
•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

Share this post


Link to post
Share on other sites

Hi Artem,this sounds interesting, is it also possible to make a toggle with FSX_Control View_Camera_Panel_# (which is 66850 to 66859)so I could toggle between 2 VC-CamerasWould this funktion work?

function VC_Pedestal_toggle ()if _t("Pedestal") then 		ipc.control(66853)else      	ipc.control(66851)endend


With kind regards

Roland Pohl
Vice chairman FSC e.V.

Share this post


Link to post
Share on other sites

try it ;) use the LINDA LUA editor:left clicking on the first line of the function executes it immediatelly for testing (if FSX running of course and script saved)


Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites

Little corection: Right-click the function name in editor to get it instantly executed inside FSX.


Artem Crum, EASA PPL
•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
LINDA Lua Integrated Non-complex Device Assigning
•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

Share this post


Link to post
Share on other sites

Hallo Günter,one question about LUA Editor.I enabled developer-mode, and every time I click on Open, I receive an error And I don't believe it, that it could be so easy, my first function works :-)))


With kind regards

Roland Pohl
Vice chairman FSC e.V.

Share this post


Link to post
Share on other sites

1. You don't have to use 'Open' inside the editor. Choose module in LINDA as always, popup the menu and inside each library and module sub menu you will see the "Edit module" item. It will open corresponding Lua file for editing.2. The error you got tell's you, that you have to use Vista or Win7 to be able to open files from inside the editor.


Artem Crum, EASA PPL
•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
LINDA Lua Integrated Non-complex Device Assigning
•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

Share this post


Link to post
Share on other sites

Hi Artem, that is copied. And I have to click the right mouse button, to activate funktions in the LINDA-Editor, not the left Button.


With kind regards

Roland Pohl
Vice chairman FSC e.V.

Share this post


Link to post
Share on other sites
And I have to click the right mouse button, to activate funktions in the LINDA-Editor, not the left Button.
yes, I'm left hand, sorry Hypnotized.gif

Guenter Steiner
--------------------------------------------------------------------------------------

Betatester for: A2A, LORBY, FSR-Pillow Tester
--------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...