Jump to content

How to set up toggle switches (a tutorial)


Recommended Posts

It took a while for me to find it, so here's a link to save others the hassle...

Thanks for the tutorial LeCuvier !

Zip - VEAF :pilotfly:

 

If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum

If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze !

Link to comment
Share on other sites

Hi LeCuvier,

 

 

I read your tutorial for the coding. Thanks for your effort. I plan to build panels for black shark. On the last page of your tutorial you mentioned that process 5.7 will not be satisfactory for BS toggle switches, why do you think so? cause I tried the 5.7 process for the master arms toggle switch and it worked. i am just a layman, just want to know why do you think so.

[sIGPIC][/sIGPIC]



























Link to comment
Share on other sites

Hi LeCuvier,

... i am just a layman, just want to know why do you think so.

The approach per 5.7 seems to work and it may be good enough for you, but it can be fooled so that the switch in the cockpit will be in the opposite position.

The approach per 5.8 is more rugged. I have just tested that statement a few minutes ago. Using the HMD power switch example, the approach per 5.8 would use code like this:

{down = 3002, up = 3002, value_down = 1, value_up = 0, cockpit_device_id = 23, name = _('Helmet-mounted System true  2-Pos. On/Off'), category = _('Ins Targeting Mode Controls Panel PVR')},

The command per 5.7 could be "fooled", the one per 5.8 could not.

I learned approach 5.8 when I had this problem with 5.7, and after some trial and error found 5.8.

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Link to comment
Share on other sites

  • 1 month later...

i wonder, editing the original file for keybindings. example the su25t, adding night vision goggles.

when the game updates, then you are also a peer (uploading small parts of the game, contributing the torrent). will it also upload the edited (keyboard.lua)?

:pilotfly:

i7-920, 12 GB DDR3 1600, Gigabyte x58 ud3r, Gigabyte GTX 970 OC, 2x500GB SSD+1x250ssd, TrackIR 5 clip, screen 42 inches, and 21 inches, Thrustmaster Warthog throttle and stick,t500rs,th8 shifter, Saitek Pro throttle, x controller, G11 keys

Link to comment
Share on other sites

I would expect that there is integrity checking built into the process and that modified files are rejected.

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Link to comment
Share on other sites

LeCuvier,

 

I'm stuck trying to make a 3 position switch for the Mig 15 that has Gear Up/Neutral and then Down/Neutral.

 

This is what I've tried, but it's not being interpreted or even showing up in the in game keybind screen.

 

-- 2/3 Custom

{down = iCommandPlaneGearUp, up = gear_commands.Mig15_Command_LandingGearHandle, cockpit_device_id = devices.GEAR_INTERFACE, value_down = -1, value_up = 0, name = _('Gear Handle Up/Neutral'), category = {_('Left Cockpit Side')}},

{down = iCommandPlaneGearDown, up = gear_commands.Mig15_Command_LandingGearHandle, cockpit_device_id = devices.GEAR_INTERFACE, value_down = 1, value_up = 0, name = _('Gear Handle Dn/Neutral'), category = {_('Left Cockpit Side')}},

 

Any ideas?

thanks again!:pilotfly:

Link to comment
Share on other sites

I don't have the Mig-15, so I cannot do any research. If these 2 commands don't show in the Options/Controls screen there is something fundamentally wrong. The syntax looks ok though.

Have you put the added commands in the right block (key commands)?

The command "gear_commands.Mig15_Command_LandingGearHandle" makes me wonder. Where did you find it? What I'm suspecting is that this command belongs to the device "devices.GEAR_INTERFACE" and the two other commands (iCommandPlane...) don't, and that this combination may not be allowed.

 

Maybe if you post the files "default.lua" and "clickabledata.lua" I can figure it out, but that's not certain as I cannot test anything.

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Link to comment
Share on other sites

I don't have the Mig-15, so I cannot do any research. If these 2 commands don't show in the Options/Controls screen there is something fundamentally wrong. The syntax looks ok though.

Have you put the added commands in the right block (key commands)?

The command "gear_commands.Mig15_Command_LandingGearHandle" makes me wonder. Where did you find it? What I'm suspecting is that this command belongs to the device "devices.GEAR_INTERFACE" and the two other commands (iCommandPlane...) don't, and that this combination may not be allowed.

 

Maybe if you post the files "default.lua" and "clickabledata.lua" I can figure it out, but that's not certain as I cannot test anything.

 

sorry took so long:

File 1:

https://www.dropbox.com/s/g11rki1npyxcxsn/clickabledata.lua?dl=0

File 2:

https://www.dropbox.com/s/zd2dkbfq3kahkpl/default.lua?dl=0

Link to comment
Share on other sites

I have inserted 3 lines (starting at line 9) into "default.lua".

They should provide the following 2 commands under category "Systems":

Landing Gear Handle DOWN/NEUTRAL

Landing Gear Handle UP/NEUTRAL

Try this file please. I would expect that the commands should have at least some visible effect on the landing gear. You may have to experiment with the values for value_down and value_up.

Also, I suppose you must open the lock cover before you can use the commands. Good luck!

default.lua

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Link to comment
Share on other sites

I have inserted 3 lines (starting at line 9) into "default.lua".

They should provide the following 2 commands under category "Systems":

Landing Gear Handle DOWN/NEUTRAL

Landing Gear Handle UP/NEUTRAL

Try this file please. I would expect that the commands should have at least some visible effect on the landing gear. You may have to experiment with the values for value_down and value_up.

Also, I suppose you must open the lock cover before you can use the commands. Good luck!

 

thanks!

I'll give it a try tonight!:pilotfly:

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for your hard work and documentation on this LeCuvier...it made making the desired modifications to my .lua files much easier to understand :pilotfly:

Windows 10 Pro 64Bit | i5-7600K CPU |32 GB RAM|SSD System Disk|SSD Gaming Disk| Gigabyte Aorus GTX-1080Ti Gaming 12 GB| 55" 4K | TM Warthog HOTAS | Virpil MongoosT-50 | BRD Pedals | TrackIR 5

Link to comment
Share on other sites

Thanks for your hard work and documentation on this LeCuvier...it made making the desired modifications to my .lua files much easier to understand :pilotfly:

:thumbup:

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Link to comment
Share on other sites

You seem to have a lot of knowledge about input and controls.

Could I change the lua files to make my devices available for binding?

i5 8400 | 32 Gb RAM | RTX 2080Ti | Virpil Mongoose T-50 base w/ Warthog & Hornet sticks | Warthog throttle | Cougar throttle USB | DIY Collective | Virpil desk mount | VKB T-Rudder Mk IV | Oculus Rift S | Buddy-Fox A-10 UFC | 3x TM MFDs | 2x bass shakers pedal plate| SIMple SIMpit chair | WinWing TakeOff panel | PointCTRL v2 | Andre JetSeat | Winwing Hornet UFC | Winwing Viper ICP

FC3 - Warthog - F-5E - Harrier - NTTR - Hornet - Tomcat - Huey - Viper - C-101 - PG - Hip - SuperCarrier - Syria - Warthog II - Hind - South Atlantic - Sinai - Strike Eagle

Link to comment
Share on other sites

You seem to have a lot of knowledge about input and controls.

Could I change the lua files to make my devices available for binding?

That's a very open question.

What kind of devices?

If these devices are game controllers you should be able to bind them mostly without changing the .lua files. .LUA editing is necessary onyl to create additional commands that for some reason the developers have omitted to create.

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Link to comment
Share on other sites

You seem to have a lot of knowledge about input and controls.

Could I change the lua files to make my devices available for binding?

 

 

What devices are you using that aren't mappable? I have a DIY device that DCS picks up just dandy.

Night Ops in the Harrier

IYAOYAS


 
Link to comment
Share on other sites

That's a very open question.

What kind of devices?

If these devices are game controllers you should be able to bind them mostly without changing the .lua files. .LUA editing is necessary onyl to create additional commands that for some reason the developers have omitted to create.

 

What devices are you using that aren't mappable? I have a DIY device that DCS picks up just dandy.

Issue solved.

It seems some F16 MFD lua files from my older configuration were messing my curreny setups, with two more USB devices.

 

Thank you guys.

i5 8400 | 32 Gb RAM | RTX 2080Ti | Virpil Mongoose T-50 base w/ Warthog & Hornet sticks | Warthog throttle | Cougar throttle USB | DIY Collective | Virpil desk mount | VKB T-Rudder Mk IV | Oculus Rift S | Buddy-Fox A-10 UFC | 3x TM MFDs | 2x bass shakers pedal plate| SIMple SIMpit chair | WinWing TakeOff panel | PointCTRL v2 | Andre JetSeat | Winwing Hornet UFC | Winwing Viper ICP

FC3 - Warthog - F-5E - Harrier - NTTR - Hornet - Tomcat - Huey - Viper - C-101 - PG - Hip - SuperCarrier - Syria - Warthog II - Hind - South Atlantic - Sinai - Strike Eagle

Link to comment
Share on other sites

I am stuck with Viggen. Formerly, I did something with Mirage - it was rather easy - I could find the buttons from clickabledata.lua and do my changes accordingly. I am, however stuck with Viggen.

 

 

 

The clickable data looks a bit different from Mirage. For example, I would like to have separate On and Off buttons, better to map that way to Warthog HOTAS.

 

 

One example would be like radar altimeter, Barometer vs. Radar Altimeter switch. It is an On/Off toggle.

 

 

In clickabledata we have:

elements["HojdSI-PTR"] = default_2_position_tumb(_("HÖJD CISI"), devices.FLIGHTDATAUNIT, 3200, 324)

 

 

In default.lua there is:

    {combos = {{key = "X", reformers = {"RShift","RCtrl"}}}, down = 3200, cockpit_device_id = devices.FLIGHTDATAUNIT, value_down = 1.0, name = _("HÖJD CISI"), category = _("Navigation")},

 

 

I try adding the separate buttons, for example, with:

    {down = 3200, cockpit_device_id = devices.FLIGHTDATAUNIT, value_down = 1.0,   name = _('HÖJD CISI RHM - Radar Altimeter'),  category = _('Navigation')},
   {down = 3200, cockpit_device_id = devices.FLIGHTDATAUNIT, value_down = -1.0,   name = _('HÖJD CISI LD - Barometric'),  category = _('Navigation')},

 

 

I have been trying up and down putting them both to -1 or 1 respectively, the best I can achieve is two additional keybindings that just toggle the cockpit switch on and off.

 

 

 

Would it help to remove the original toggle mapping?

Link to comment
Share on other sites

@Jyge: I don't see a solution. Although the switch visible in the cockpit has 2 stable positions, it's not implemented as it should. A correctly mplemented switch would go to the UP position on Mouse Right-Click, and DOWN on Mouse Left-Click, or vice versa.

This switch however always goes to the respective opposite position (it toggles) irrespective of which mouse button you click. The Radar Altimeter switch has the same problem. And we can still not change control bindings via Options/Controls without getting the black screen.

 

I'm clearly not impressed with Heatblur's implementation quality. And now they will want to sell us the F-14.... good luck!

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Link to comment
Share on other sites

@Jyge: I don't see a solution. Although the switch visible in the cockpit has 2 stable positions, it's not implemented as it should. A correctly mplemented switch would go to the UP position on Mouse Right-Click, and DOWN on Mouse Left-Click, or vice versa.

This switch however always goes to the respective opposite position (it toggles) irrespective of which mouse button you click. The Radar Altimeter switch has the same problem. And we can still not change control bindings via Options/Controls without getting the black screen.

 

I'm clearly not impressed with Heatblur's implementation quality. And now they will want to sell us the F-14.... good luck!

 

 

Ah, ok so I am chasing ghosts here. Damn, that's irritating. Well it is understandable in some respects as Viggen is already a bit older I think and the logic with clickable cockpits is still evolving, but yes it would be nice if they patched it to left click - right click logic.

Link to comment
Share on other sites

Ah, ok so I am chasing ghosts here. Damn, that's irritating. Well it is understandable in some respects as Viggen is already a bit older I think and the logic with clickable cockpits is still evolving, but yes it would be nice if they patched it to left click - right click logic.

 

‘A bit older’? The Viggen is not even out of beta yet!

This left/right click issue is not unique to Viggen. Inconsistencies exist in all modules in this respect. Been discussed many times here.


Edited by imacken

Intel i7 12700K · MSI Gaming X Trio RTX 4090 · ASUS ROG STRIX Z690-A Wi-Fi · MSI 32" MPG321UR QD · Samsung 970 500Gb M.2 NVMe · 2 x Samsung 850 Evo 1Tb · 2Tb HDD · 32Gb Corsair Vengance 3000MHz DDR4 · Windows 11 · Thrustmaster TPR Pedals · Tobii Eye Tracker 5 · Thrustmaster F/A-18 Hornet Grip · Virpil MongoosT-50CM3 Base · Virpil Throttle MT-50 CM3 · Virpil Alpha Prime Grip · Virpil Control Panel 2 · Thrustmaster F-16 MFDs · HTC Vive Pro 2 · Total Controls Multifunction Button Box

Link to comment
Share on other sites

‘A bit older’? The Viggen is not even out of beta yet?

This left/right click issue is not unique to Viggen. Inconsistencies exist in all modules in this respect. Been discussed many times here.

FA-18c has that, "inconsistencies". To rearrange all these, which, mind you, categorically is not a bug but a - design - wish, a design clean-up, one has to go with a fine comb through all of the present coding of all of the interface, which probably is a hell of a job. If one had to choose, we want our lightning pod, don't we.

| VR goggles | Autopilot panel | Headtracker | TM HOTAS | G920 HOTAS | MS FFB 2 | Throttle Quadrants | 8600K | GTX 1080 | 64GB RAM| Win 10 x64 | Voicerecognition | 50" UHD TV monitor | 40" 1080p TV monitor | 2x 24" 1080p side monitors | 24" 1080p touchscreen |

Link to comment
Share on other sites

Yes, trying to fix all the past design inconsistencies would be hell for any software engineer. These guys want to write new code - not review and correct old code written by someone else.

But it would help going forward, if ED established design rules for this kind of thing. At least then new modules would cause less user rework ("mods") and frustration, and improve custome satisfaction.

LeCuvier

Windows 10 Pro 64Bit | i7-4790 CPU |16 GB RAM|SSD System Disk|SSD Gaming Disk| MSI GTX-1080 Gaming 8 GB| Acer XB270HU | TM Warthog HOTAS | VKB Gladiator Pro | MongoosT-50 | MFG Crosswind Pedals | TrackIR 5

Link to comment
Share on other sites

  • Recently Browsing   0 members

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