Jump to content
The simFlight Network Forums

How to assign multiple L:vars to one button.


Recommended Posts

*** Moved from FAQ sub-forum to main Support Forum ***

Hello,

Recently I've been trying to set up the PMDG MD11 with my Honeycomb Alpha Yoke. I'm trying to set up the landing lights, which there are 3 separate switches (left, right and nose), each having 3 positions (retracted, extended and on). I'm wondering how I could make all 3 switches go from retracted to on with the single landing lights switch included with the yoke. I have already made myself a little familiar with L:vars and custom macros, but I am stumped. Any help is appreciated.

Edited by John Dowson
Moved to main support forum
Link to comment
Share on other sites

  • John Dowson changed the title to How to assign multiple L:vars to one button.

To assign multiple actions to a button, whatever the action (e.g. controls, macro actions, lua scripts, etc) you have to comment out the currently assigned action by editing your FSUIPC .ini file. Find the assignment line in the .ini file (in an editor such as Notepad++), and place a semi-colon character after the index number of the assignment and save the file. Then, in the FSUIPC buttons assignment dialog, click the 'reload all buttons' button. This will reload the edited ini and remove the assignment, allowing you to add the second assignment. You can save (i.e. click Ok) and repeat as many times as you like to add multiple assignments. When done, edit the .ini file again and remove the semi-colons previously added and save the file. Then reload the update .ini once more from the button assignments panel, and you will now have multiple assignments to that button. You will only see the first assignment in the UI, and this will be grayed-out and un-editable. To make any further changes to multiple assignments, you have to manually edit the .ini file.

John

  • Like 1
Link to comment
Share on other sites

The description you gave is a little confusing. I'll try to work through it, but is there any way you could give a simpler or step-by-step explanation? I included the current status of my "buttons" section in the .ini. Thanks for your help!

4d673d180b38c176bf6262bc584cd9eb.png

Edited by Crashcast_E
added screenshot
Link to comment
Share on other sites

1 minute ago, Crashcast_E said:

I'll try to work through it, but is there any way you could give a simpler or step-by-step explanation?

Just work through it - its not that complicated. You are just assigning and then commenting out the assignment so that you can make a new assignment. And when all  assignments are done, remove the comments to re-activate. And check the Advanced User guide, P19.
 

Link to comment
Share on other sites

55 minutes ago, Crashcast_E said:

This is what I've got so far. Ran it, and so far it only changes the first landing light and keeps resetting the code to the lines above every time I change it. Originally, I had it as:

But they are both exactly the same - no point in changing the annotations (the bits between -{...}-)  as they are automatically generated.
So what you are currently doing with those assignments is setting the Lvar L:LIGHTS_LDG_lT_L_Switch_var to 0 3 times.
If you want the other assignments to work on a different lvar, you need to assign them to a different macro entry. If doing this manually (via editing the ini), then the macro line index number is the one after the colon - in your case, its 2 for all of them, so is activating the 2nd macro in your 3rd macro file (CM3), which is the one for lvar L:LIGHTS_LDG_lT_L_Switch_var, as indicated by the annotations.

Please read the documentation provided, and the instructions I have already given.

Link to comment
Share on other sites

So I got the landing lights switch to work by changing the value you suggested. Here's what it looks like now:

68b07f466b94601f7234f9b9b4d61b22.png

Now I've run into another issue: while the switch gets flipped, the action (landing lights extending and turning on) doesn't actually happen for some reason. I'll try to work this out, but any help would always be appreciated. Thanks!

Link to comment
Share on other sites

2 minutes ago, Crashcast_E said:

So I got the landing lights switch to work by changing the value you suggested. Here's what it looks like now:

68b07f466b94601f7234f9b9b4d61b22.png

Now I've run into another issue: while the switch gets flipped, the action (landing lights extending and turning on) doesn't actually happen for some reason. I'll try to work this out, but any help would always be appreciated. Thanks!

So now you have it set to both toggle the three lights (assignments 6,7,8), and then set them all to off (using the set control with a parameter of 0 on assignments 9,10,11).
Try removing the last 3 assignments (the set ones) and just use the toggle controls.
 

 

Link to comment
Share on other sites

Ah, sorry - they are assigned to different buttons - 22 and 23.
Try using two macro files (as really an lvar should only appear once in a macro file). Use the set control in both, but with a parameter of 1 to turn on, and 0 to turn off.
I'm not sure of the behaviour if using the same lvar multiple times, even if they have separate actions.
Alternatively, try logging the lvar values once you toggle or set - do they change?


 

Link to comment
Share on other sites

Just now, Crashcast_E said:

I'm using the PMDG MD11. I've logged the L:vars. The value for the switch changes, but the value for the actual light does not. This is happening with all lights as well, Nav, Beacon and Hi-Int.

If the value changes but the lights are not activating, I suspect that they are read-only (or non-active) lvars. Do the standard light controls not work (or the light offsets)?
Have you tried logging Evenbts and operating the lights from the UI, to see what, if any, events are logged? If any are logged, you can use/assign to those.

Many PMDG aircraft also come with there own SDK which include custom controls for such things, but I don't know if this is available for the MD11 - please check.

If not, you could try using Mouse Macros. May also be worth checking on the PMDG forums as well.

Btw, which FS and version of FSUIPC are you using?

Link to comment
Share on other sites

I'm using FSX Gold Edition with the Acceleration Pack (SP2) with FSUIPC 4.97. I've checked around for MD11 macros and FSUIPC kits, but no such think exists for the MD11; I believe they ended support for this aircraft years ago. I'll take a look into logging evenbts.

Link to comment
Share on other sites

1 minute ago, Crashcast_E said:

I've checked around for MD11 macros and FSUIPC kits

I meant FSUIPC Mouse-macros, i.e. macros that emulate mouse actions in the UI - see P40 of the Advanced User manual. If you cannot find any events/controls that work, and writing to the lvars doesn't work, then try mouse macros. Do the logging first, as it is also not guaranteed that mouse macros will work in FSUIPC4 as it depends on how the a/c is implemented. Or are you saying that they don't work for the MD11? 

Link to comment
Share on other sites

That was in reply to your comment about the PMDG forums- I can't find anyone who has made a dedicated control SDK for the MD11. I'll give a try at programming a few mouse macros for the lights. As far as I'm aware, the Mouse Macros tool built in to FSUIPC doesn't work anymore, does it?

Link to comment
Share on other sites

15 minutes ago, Crashcast_E said:

As far as I'm aware, the Mouse Macros tool built in to FSUIPC doesn't work anymore, does it?

I think they work for some aircraft in FSUIPC4 but not all. You will need to define the module as:
   Module="PMDG_MD11.DLL"

This post may help - in fact, this already includes mouse macros for the lights in the MD11, so you may want to use this: 

 

John

Link to comment
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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.