Jump to content
The simFlight Network Forums

Recommended Posts

Posted

I am not at home so I will try it later. Essentially I have to bind the two controls "landing lights" and "taxi lights" to release 12 instead of ctr+L and tab+T, correct?

And I can assign multiple controls to the same button action in the INI just like with key presses?

Posted
3 minutes ago, Blindside said:

Essentially I have to bind the two controls "landing lights" and "taxi lights" to release 12 instead of ctr+L and tab+T, correct?

Yes, and in that order.

3 minutes ago, Blindside said:

And I can assign multiple controls to the same button action in the INI just like with key presses?

Yes, and you can mix and match  controls & keypresses.

Posted

@John Dowson I only had time today to test it and it does not work either.

The INI now looks like this:

45=PA,12,C65751,0 	-{LANDING_LIGHTS_TOGGLE}-
46=UA,12,C65751,0 	-{LANDING_LIGHTS_TOGGLE}-
47=UA,12,C66240,0 	-{TOGGLE_TAXI_LIGHTS}-

PA12 works fine, the landing lights toggle. Releasing 12 does 1 of 2 things:

  • 50% it does nothing, ie the game does not register the command
  • 50% it registers the landing lights toggle, but never the taxi toggle

So it appears it is impossible to have this sequence on the 3 way stick.

I have also attached the log file.

 

Can you maybe point me in the direction how I could write a small LUA script with a delay between both commands to try it out? I have never tried it and I am a bit overwhlemed by the manual...?

 

EDIT additional info:

It appears to be related to this specific 3 way switch in the TBM (it might be reproducible on other aircraft with similar in game 3-way switches).

I have tried a similar set up with different functions and it works flawlessly without issues:

down -> middle: Toggle AP HDG

middle -> top: Toggle AP Heading, Toggle hold NAV1

top -> middle: toggle hold NAV 1, toggle AP HDG

middle -> down: toggle AP HDG

So essentially, in the middle position the switch engages HDG mode, in the top positon NAV1 hold and in the down position none of these AP modes. And it works great, I can switch between those modes as fast as I want.

The lights will not work that way.

FSUIPC7.log

Posted

You could try looking at macros instead, but it looks like the second command is being ignored - maybe it doesn't accept the input/control while the animation (i.e. switch moving down) is in progress, in which case a delay would be needed. If that's the case, then I think you would need to do this in lua at the moment.

I am planning to implement a delay feature for controls and key presses (already exists for axes) so I may look into this pretty soon (and can use this example to test).
I'll look into this in more detail later today (time permitting, if not on Sunday) and put together a lua example for you.

Posted
3 hours ago, John Dowson said:

You could try looking at macros instead, but it looks like the second command is being ignored - maybe it doesn't accept the input/control while the animation (i.e. switch moving down) is in progress, in which case a delay would be needed. If that's the case, then I think you would need to do this in lua at the moment.

I am planning to implement a delay feature for controls and key presses (already exists for axes) so I may look into this pretty soon (and can use this example to test).
I'll look into this in more detail later today (time permitting, if not on Sunday) and put together a lua example for you.

That would be great!

Posted (edited)

Please try the attached simple lua script. Save it in your FSUIPC7 installation folder, then open your FSUIPC7.ini and add the following to the [Auto] section:
     1=Lua tbmLights

(change the '1' to the next free number if you have other lua's auto started).

This only controls the TBM 3-way lights toggle. You can add further controls and/or keypresses for your other actions as you wish, or set those up via the UI assignments panel.

Let me know how it goes.

tbmLights.lua

This just adds a 600ms delay between sending the landing lights toggle and sending the taxi lights toggle (on your button 12 release), which seems to do the trick.
I'll look into allowing you to specify a delay for button and key assignments made via the UI.

Edited by John Dowson
Further info added
  • Thanks 1
Posted

Btw, I've noticed that when you go from Taxi -> LDG, MSFS sends a landing lights toggle followed by a taxi lights toggle. To duplicate this behavior, use the following lua instead (I've just added the extra taxi lights toggle control on your 12 button press (no delay needed):

tbmLights.lua

Posted

@John DowsonThank you very much, in now works exactly as I intended (I use your 2nd lua file). I have bound an additional keypress (tab+O) to PA12 und UA12 via the UI assignments panel and the lights now behave as I planned them to do!

 

Edit:

Since the Lua is now listed under auto in the INI: What do I need to do to assign this toggle differently in different planes? Should I create a specific profile associated with this lua?

 

Posted
1 hour ago, Blindside said:

Since the Lua is now listed under auto in the INI: What do I need to do to assign this toggle differently in different planes? Should I create a specific profile associated with this lua?

I just added it to the general [Auto] section to test. If you only want it in a profile, add it to the profile specific auto section (e.g. [Auto.xxxx] where xxxx is the profile name) instead. If the profile-specific Auto section doesn't exist (it won't unless already added), then add it.

Posted

I have added a pause control now, so you can add the pause in the assignments if you like rather than using the lua. These assignments would do the same as the lua (update index numbers accordingly):

Quote

34=PA,12,C65751,0     -{LANDING_LIGHTS_TOGGLE}-
35=PA,12,C66240,0     -{TOGGLE_TAXI_LIGHTS}-
36=UA,12,C65751,0     -{LANDING_LIGHTS_TOGGLE}-
37=UA,12,C1152,600     -{}-
38=UA,12,C66240,0     -{TOGGLE_TAXI_LIGHTS}-
39=PA,13,C66240,0     -{TOGGLE_TAXI_LIGHTS}-
40=UA,13,C66240,0     -{TOGGLE_TAXI_LIGHTS}-

Of course, you can continue using the lua, but the pause control will be available if you need it for anything similar in the future.
Its in the following version, and will be released officially when I release 7.0.2:

FSUIPC7.exe

Posted

John

Would this lua work with a three way switch?  I've made some boards with toggle switches, buttons and three way switches.  I have some planes in P3D v4.5 that I use lua files to turn on/off taxi lts, and landing lights when on one switch.  But I don't know about MSFS.  I just want one of my switches to be down: off, middle: taxi lights, up: landing lights, then middle; landing lights off, taxi lights on, then down: all off.  Or is there an easier way. 

Posted

@johnk515 Yes, that is what that lua script does. Try it - you will need to adjust the button numbers first.

14 hours ago, johnk515 said:

Or is there an easier way. 

The alternative way (not sure if its any easier!) is to add the assignments via the ui and then overload the assignments by editing the ini file, to add the extra press/release controls as indicated in my last comment. To use this method, you will need to use the updated FSUIPC7.exe provided (still not officially released) as this has the necessary additional pause control added.
 

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.