Jump to content

huey toggle switch help needed


Recommended Posts

hi all,

 

i could use some help for the LUA file for my huey switches.

 

i'm using the leoboards BBI-32

and some on-off and on-off-on switches.

 

now i can make my on-off switches work by adding for example:

{combos = {{key = "JOY_BTN1"}, }, down = 3014, cockpit_device_id = 7, value_down = 0, name = "Anti Collision Light On/Off", category = "Ins Overhead panel"},

TO

{combos = {{key = "JOY_BTN1"}, }, down = 3014, up = 3014, cockpit_device_id = 7, value_down = 0, value_up = 1, name = "Anti Collision Light On/Off", category = "Ins Overhead panel"},

 

My problem is for the On-Off-On switches that i use for nav lights,...

when in up position i want i to be flash, when switch is in down pos i want it to be steady, this i s no problem,

but

when my switch is in OFF pos (middle switch pos) it's not doing it ingame :cry:

these are the lines:

 

{combos = {{key = "JOY_BTN2"}, }, down = 3002, cockpit_device_id = 7, value_down = -1, name = "Nav Lights Flash", category = "Ins Overhead panel"},

{down = 3002, cockpit_device_id = 7, value_down = 0, name = "Nav Lights Off", category = "Ins Overhead panel"},

{combos = {{key = "JOY_BTN4"}, }, down = 3002, cockpit_device_id = 7, value_down = 1, name = "Nav Lights Steady", category = "Ins Overhead panel"},

 

i have changed and tryed all kinds off things, non working for the moment.

anybody has a working solution for me?

Link to comment
Share on other sites

{combos = {{key = "JOY_BTN14"}, }, down = 3002, up = 3002, cockpit_device_id = 7, value_down = -1, value_up = 0, name = "Nav Lights Flash", category = "Ins Overhead panel"},

{down = 3002, cockpit_device_id = 7, value_down = 0, name = "Nav Lights Off", category = "Ins Overhead panel"},

{combos = {{key = "JOY_BTN13"}, }, down = 3002, up = 3002, cockpit_device_id = 7, value_down = 1, value_up = 0, name = "Nav Lights Steady", category = "Ins Overhead panel"},

 

 

This works for me. I think you treat an on/off/on switch like 2 separate on/off switches with the center being off for both.

  • Like 1
Link to comment
Share on other sites

{combos = {{key = "JOY_BTN14"}, }, down = 3002, up = 3002, cockpit_device_id = 7, value_down = -1, value_up = 0, name = "Nav Lights Flash", category = "Ins Overhead panel"},

{down = 3002, cockpit_device_id = 7, value_down = 0, name = "Nav Lights Off", category = "Ins Overhead panel"},

{combos = {{key = "JOY_BTN13"}, }, down = 3002, up = 3002, cockpit_device_id = 7, value_down = 1, value_up = 0, name = "Nav Lights Steady", category = "Ins Overhead panel"},

 

 

This works for me. I think you treat an on/off/on switch like 2 separate on/off switches with the center being off for both.

 

 

going to try this again tonight. but i think i tryed this already and when going to options it reseted all the buttons until i undo it again in my lua file.

 

 

thx Dave: it works, still strange i did the same thing before and that didn't work, must have forgoten something, still thx allot!! +1


Edited by Newspeedy
Link to comment
Share on other sites

Dave317 how did you do it with the armed off, save, armed button?

 

i tryed to add a line, but no joy :(

 

{combos = {{key = "JOY_BTN5"}, }, down = 3020, up = 3020, cockpit_device_id = 9, value_down = -1, value_up = 0, name = "Armament Off/Safe/Armed Down", category = "Armament System"},

{down = 3020, cockpit_device_id = 9, value_down = 0, name = "Armament Off/Safe/Armed Off", category = "Armament System"},

{combos = {{key = "JOY_BTN6"}, }, down = 3020, up = 3020, cockpit_device_id = 9, value_down = 1, value_up = 0, name = "Armament Off/Safe/Armed Up", category = "Armament System"},


Edited by Newspeedy
Link to comment
Share on other sites

{combos = {{key = "JOY_BTN23"}, }, down = 3020, up = 3020, cockpit_device_id = 9, value_down = -1, value_up = 1, name = "Armament Off/Safe/Armed Down", category = "Armament System"},

{combos = {{key = "JOY_BTN22"}, }, down = 3020, up = 3020, cockpit_device_id = 9, value_down = 1, value_up = -1, name = "Armament Off/Safe/Armed Up", category = "Armament System"},

Link to comment
Share on other sites

Guys

 

Is there somewhere that has a full tutorial on how to do the above. ]

 

Just about top start my panels, but when I was doing test wiring etc. I wasnt able to use on/off switches unless I wired both "live" terminals into the same port on the bbi card!

 

Does the above negate the need for what I had to do?

 

Thanks

“Any pilot should be flying the spitfire, at least once.” – John S. Blyth

Link to comment
Share on other sites

Guys

 

Is there somewhere that has a full tutorial on how to do the above. ]

 

Just about top start my panels, but when I was doing test wiring etc. I wasnt able to use on/off switches unless I wired both "live" terminals into the same port on the bbi card!

 

Does the above negate the need for what I had to do?

 

Thanks

 

well, your game can't detect the off signal from your switch, thats why we need to change some stuff into the LUA file, i used this tutorial http://forums.eagle.ru/showthread.php?t=89226

Link to comment
Share on other sites

{combos = {{key = "JOY_BTN23"}, }, down = 3020, up = 3020, cockpit_device_id = 9, value_down = -1, value_up = 1, name = "Armament Off/Safe/Armed Down", category = "Armament System"},

{combos = {{key = "JOY_BTN22"}, }, down = 3020, up = 3020, cockpit_device_id = 9, value_down = 1, value_up = -1, name = "Armament Off/Safe/Armed Up", category = "Armament System"},

 

 

thx again Dave!!! and i feel so sure i already tryed that :cry: now its working, thx

 

edit: seems like there was a bad connection for my button 5 and 6 = fixed


Edited by Newspeedy
Link to comment
Share on other sites

Hi everybody !

 

Sorry to highjack this thread, but as my problem is very similar, I did not want to open another one.

 

To the issue:

Did the way, the control settings .lua files are working change ?

I tried to create stateful commands just the way I did all for the Ka-50.

Example code for the starter generator:

{down = 3011, cockpit_device_id = 1, value_down = 2, name = "Starter-Generator STARTER", category = "Ins Overhead panel"},

 

For the value_down I tried all from -2 to 2, but all of those moved the switch both directions, instead of setting one switch state.

I tried this for several switches, like main fuel, governor, anti collision and so on.

No luck with any of these.

 

I absolutely know it is still in beta and thus hope all this gets "fixed" and all the missing buttons/switches get added to the controls too.

But if it works and I just did it wrong/it works in a different way to the Ka-50, please let me know!

 

 

Thanks in advance!

 

MadCat

Link to comment
Share on other sites

  • 2 months later...

*Bump*

 

Even after a complete reinstall for 1.2.6 and creating the controls from scratch, I still can't get this to work with any of the switches I tried.

No matter what value I set, the switch still toggles between on and off state or doesn't show up in the controls tab so I can't even assign them.

 

Example:

{down = 3016, cockpit_device_id = 3, value_down = 1, name = "Governor Auto", category = "Pedestal"},

{down = 3016, cockpit_device_id = 3, value_down = -1, name = "Governor Emer", category = "Pedestal"},

 

Keys then will be assigned in the options tab, hence that part of code "missing".

I also tried various "value_down" entries to no avail.

 

 

Anyone got an Idea or made it work the way I am trying to ?

Is the state recognition still on the to do list for final release ?

It worked so brilliantly for the Ka-50 (except for the cut-off levers) :cry:

 

Greetings

MadCat

Link to comment
Share on other sites

Your command line should look like this. Its easer if you take your switches and go inside the game and select what switches do what in the controller options first. then using notpad++ go into the lua document and edit the line of code

 

{combos = {{key = "JOY_BTN20"}, }, down = 3016, up = 3016, cockpit_device_id = 3, value_down = 0, value_up = 1, name = "Governor Auto/Emer", category = "Pedestal"},

 

 

hope this helps.

Jesse

Link to comment
Share on other sites

Thanks for the help, very much appreciated! :thumbup:

 

I just tried that edited line, but unfortunately it still doesn't work the way I'd like it to.

 

To further explain my idea, here is an example for the burst length switch I edited in my Ka-50 controls:

{combos = {{key = "Num0"}, }, down = 3004, cockpit_device_id = 12, value_down = 0, name = "Burst length - Short", category = "Ins Weapons Status and Control Panel PUI-800"},

{combos = {{key = "JOY_BTN32"}, }, down = 3004, cockpit_device_id = 12, value_down = 0.1, name = "Burst length - Medium", category = "Ins Weapons Status and Control Panel PUI-800"},

{combos = {{key = "JOY_BTN31"}, }, down = 3004, cockpit_device_id = 12, value_down = 0.2, name = "Burst length - Long", category = "Ins Weapons Status and Control Panel PUI-800"},

 

So for example if I press JOY_BTN32, the switch sets the burst length to medium, no matter in what position the switch was before.

If it already was at medium, nothing happens and it stays at medium.

Same applies to short and long positions.

 

This turned out to be the most convenient way (for me) to program my warthog's toggle switches.

And it alredy is implemented for things like dome light or position lights, so the UH-1 code is capable of doing it.

Else I always have to manually sync the cockpit switches with my hardware switches to not have the switch function reversed.sad_2.gif

 

Your suggested line had the same drawback (in my eyes) unfortunately, that the original command has.

It doesn't care in what position the switch is, it just switches it from its original position to the other one and back.

Plus I need to keep the key pressed in order to have the switch stay in the new position, what I'd like to avoid.

 

Maybe it just isn't possible yet (still beta), but will be in the final release (BST can you hear me ? ! :music_whistling:)

 

I'm still thankful for every help and idea! :helpsmilie:

 

Greetings

MadCat


Edited by -=MadCat=-
Link to comment
Share on other sites

  • Recently Browsing   0 members

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