Jump to content

How to set up toggle switches (a tutorial)


Recommended Posts

That's fairly easy. First, add this line of code to the file "Throttle - HOTAS Warthog.lua", in the "axisCommands" section close to the end of the file:

{action = 3001, cockpit_device_id = 7, name = _('HUD Brightness Axis')},

Then bind the new command "HUD Brightness Axis" to the slider.
Finally open "Axis tune" and set
Saturation Y = 50% This is necessary because the command uses only 50% of the input signal range)
Slider = True (ticked)
Invert = True

  • Thanks 1

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

2021/12/11 AM6点11分,LeCuvier说:

That's fairly easy. First, add this line of code to the file "Throttle - HOTAS Warthog.lua", in the "axisCommands" section close to the end of the file:

{action = 3001, cockpit_device_id = 7, name = _('HUD Brightness Axis')},

Then bind the new command "HUD Brightness Axis" to the slider.
Finally open "Axis tune" and set
Saturation Y = 50% This is necessary because the command uses only 50% of the input signal range)
Slider = True (ticked)
Invert = True

it works, thank you very much!!

Link to comment
Share on other sites

  • 3 weeks later...

I'm trying to add the CICU and JTRS switches of the A-10C AHCP to my Virpil ShaK50 Panel.

At the bottom it has two ON/ON Switches. So I would need CICU ON an CICU OFF as separate actions. All I could find is iCommandPlaneAHCPCICUOnOff.

For JTRS I've got the same problem. I've already search in this topic, but didn't found anything.

Any ideas?

SYSTEM: Mainboard MSI MEG X570 | CPU Ryzen 7 5800X @ 4.5 GHz | RAM 64 GB @ 3200 MHz | GPU GIGABYTE RTX 4090 | 1 TB SSD | Win 10 x64

DEVICES: ASUS 27" LCD | TrackIR 5 | LukeClip | Quest 3 | PointCTRL | Virpil HOTAS | MFG Crosswind | TableMount MonsterTech

MODULES: To much to list. But I stopped buying more, because of too much bugs in e.g. A-10C(II). @ED: Fix the bugs and I spend money on modules again. Promised.

PROJECTS: OpenFlightSchool: DE / EN

Link to comment
Share on other sites

In wanted to add GUN PAC ARM / SAFE / GUN ARM to the START/CRANK switch on my Virpil ShaK50 Panel. It is a ON/OFF/ON switch.

With the pdf guide of LeCuvier I was able to find the right code for my default.lua. I share it here if someone needs it:

{down = 3002, up = 3002, value_down = 0.2, value_up = 0.1, cockpit_device_id = 7, name = _('Gun PacArm/Safe'), category = _('Armament HUD Control Panel')},
{down = 3002, up = 3002, value_down = 0.0, value_up = 0.1, cockpit_device_id = 7, name = _('Gun Arm/Safe'), category = _('Armament HUD Control Panel')},

 

SYSTEM: Mainboard MSI MEG X570 | CPU Ryzen 7 5800X @ 4.5 GHz | RAM 64 GB @ 3200 MHz | GPU GIGABYTE RTX 4090 | 1 TB SSD | Win 10 x64

DEVICES: ASUS 27" LCD | TrackIR 5 | LukeClip | Quest 3 | PointCTRL | Virpil HOTAS | MFG Crosswind | TableMount MonsterTech

MODULES: To much to list. But I stopped buying more, because of too much bugs in e.g. A-10C(II). @ED: Fix the bugs and I spend money on modules again. Promised.

PROJECTS: OpenFlightSchool: DE / EN

Link to comment
Share on other sites

2 hours ago, kaltokri said:

I'm trying to add the CICU and JTRS switches of the A-10C AHCP to my Virpil ShaK50 Panel.

At the bottom it has two ON/ON Switches. So I would need CICU ON an CICU OFF as separate actions. All I could find is iCommandPlaneAHCPCICUOnOff.

For JTRS I've got the same problem. I've already search in this topic, but didn't found anything.

Any ideas?

After 2 hours I understand the guide of LeCuvier. Thank you very much!

Here lua code for default.lua: JTRS & CICU as single button commands or ON/OFF toggle if someone needs it:

-- JTRS On & Off for push buttons
{down = 3009, cockpit_device_id = 7, value_down = 1.0,    name = _('JTRS ON'), category = _('Armament HUD Control Panel')},
{down = 3009, cockpit_device_id = 7, value_down = 0.0,    name = _('JTRS OFF'), category = _('Armament HUD Control Panel')},
-- JTRS On/Off for a ON/OFF switch
{down = 3009, up = 3009, value_down = 1.0, value_up = 0.0, cockpit_device_id = 7, name = _('JTRS On/Off toggle'), category = _('Armament HUD Control Panel')},
-- CICU On & Off for push buttons
{down = 3008, cockpit_device_id = 7, value_down = 1.0,    name = _('CICU ON'), category = _('Armament HUD Control Panel')},
{down = 3008, cockpit_device_id = 7, value_down = 0.0,    name = _('CICU OFF'), category = _('Armament HUD Control Panel')},
-- CICU On/Off for a ON/OFF switch
{down = 3008, up = 3008, value_down = 1.0, value_up = 0.0, cockpit_device_id = 7, name = _('CICU On/Off toggle'), category = _('Armament HUD Control Panel')},

 

  • Like 2

SYSTEM: Mainboard MSI MEG X570 | CPU Ryzen 7 5800X @ 4.5 GHz | RAM 64 GB @ 3200 MHz | GPU GIGABYTE RTX 4090 | 1 TB SSD | Win 10 x64

DEVICES: ASUS 27" LCD | TrackIR 5 | LukeClip | Quest 3 | PointCTRL | Virpil HOTAS | MFG Crosswind | TableMount MonsterTech

MODULES: To much to list. But I stopped buying more, because of too much bugs in e.g. A-10C(II). @ED: Fix the bugs and I spend money on modules again. Promised.

PROJECTS: OpenFlightSchool: DE / EN

Link to comment
Share on other sites

I made a Button Box with a LeoBodnar. I can set it up without any problems in the DCS Setup Page.

But where do I find the specific lua file for this box? There is no lua file in the DCS/Mods/... (and so on) Input or Joystick folder.

I only found a button box lua.diff file in the DCS saved games folder

 

Windows 10 | i7-8700K@5GHz | 2080 Ti | Intel Z370 Chipset | 32GB RAM@1866 MHz | SSD: Samsung 850 EVO 1TB| Thrustmaster Warthog HOTAS w. FSSB R3 Mod | Saitek Switch Panel + Radio Panel + Multi Panel + FIP + Flightpanels Software | MFG_Crosswind | TrackIR5 | TM Cougar MFD Pack | Obutto R3volution | 1 x LG38 | GAMETRIX KW-908 JETSEAT

Link to comment
Share on other sites

You  don't need a dedicated .lua file for your button box under "...\DCS World OpenBeta\Mods\aircraft\FW-190D9\Input\aircraft\joystick".
The "default.lua" is good for all game controllers that don't have a dedicated file like "Throttle - HOTAS Warthog.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

2 hours ago, LeCuvier said:

You  don't need a dedicated .lua file for your button box under "...\DCS World OpenBeta\Mods\aircraft\FW-190D9\Input\aircraft\joystick".
The "default.lua" is good for all game controllers that don't have a dedicated file like "Throttle - HOTAS Warthog.lua".

Thank you! Everything is working now

Windows 10 | i7-8700K@5GHz | 2080 Ti | Intel Z370 Chipset | 32GB RAM@1866 MHz | SSD: Samsung 850 EVO 1TB| Thrustmaster Warthog HOTAS w. FSSB R3 Mod | Saitek Switch Panel + Radio Panel + Multi Panel + FIP + Flightpanels Software | MFG_Crosswind | TrackIR5 | TM Cougar MFD Pack | Obutto R3volution | 1 x LG38 | GAMETRIX KW-908 JETSEAT

Link to comment
Share on other sites

  • 2 weeks later...

I've figured out how to do the A-10C battery switch on a On/On Switch for the Virpil Throttle.
And the A-10C Canopy Open/Close on a On/Off/On Switch for the Virpil Panel.
Maybe it helps someone else, too.


Here lua code for default.lua:

{down = 3006, up = 3006, value_down = 1.0, value_up = 0.5, cockpit_device_id = 39, name = _('Canopy Open'), category = _('Systems')},
{down = 3007, up = 3007, value_down = 0.0, value_up = 0.5, cockpit_device_id = 39, name = _('Canopy Close'), category = _('Systems')},
{down = 3006, cockpit_device_id = 1, value_down = 1.0,    name = _('Battery ON'), category = _('Electrical power control panel')},
{down = 3006, cockpit_device_id = 1, value_down = 0.0,    name = _('Battery OFF'), category = _('Electrical power control panel')},

 

SYSTEM: Mainboard MSI MEG X570 | CPU Ryzen 7 5800X @ 4.5 GHz | RAM 64 GB @ 3200 MHz | GPU GIGABYTE RTX 4090 | 1 TB SSD | Win 10 x64

DEVICES: ASUS 27" LCD | TrackIR 5 | LukeClip | Quest 3 | PointCTRL | Virpil HOTAS | MFG Crosswind | TableMount MonsterTech

MODULES: To much to list. But I stopped buying more, because of too much bugs in e.g. A-10C(II). @ED: Fix the bugs and I spend money on modules again. Promised.

PROJECTS: OpenFlightSchool: DE / EN

Link to comment
Share on other sites

I started to create lua files to use the Virpil VPC SharKa-50 Panel in the Ka-50.

Here are the lines for the first 4 switches at the bottom of the VPC Panel, which are placed on the PUI-800 Weapons Control Panel and also the Master Arm Switch.
They are created as On/ON and On/On/On Switches. So they are also useable for simple button boxes. Hope it helps.

-- PUI-800 Weapons Control Panel
{down = 3001, cockpit_device_id = 12, value_down = 1.0,    name = _('Master ARM On'), category = _('Ins Weapons Status and Control Panel PUI-800')},
{down = 3001, cockpit_device_id = 12, value_down = 0.0,    name = _('Master ARM Off'), category = _('Ins Weapons Status and Control Panel PUI-800')},
{down = 3020, cockpit_device_id = 12, value_down = 1.0,    name = _('Cannon rate of fire LOW'), category = _('Ins Weapons Status and Control Panel PUI-800')},
{down = 3020, cockpit_device_id = 12, value_down = 0.0,    name = _('Cannon rate of fire HIGH'), category = _('Ins Weapons Status and Control Panel PUI-800')},
{down = 3006, cockpit_device_id = 12, value_down = 1.0,    name = _('Cannon round selector switch HE'), category = _('Ins Weapons Status and Control Panel PUI-800')},
{down = 3006, cockpit_device_id = 12, value_down = 0.0,    name = _('Cannon round selector switch AP'), category = _('Ins Weapons Status and Control Panel PUI-800')},
{down = 3004, cockpit_device_id = 12, value_down = 0.2,    name = _('Weapon Burst Length LNG'), category = _('Ins Weapons Status and Control Panel PUI-800')},
{down = 3004, cockpit_device_id = 12, value_down = 0.1,    name = _('Weapon Burst Length MD'), category = _('Ins Weapons Status and Control Panel PUI-800')},
{down = 3004, cockpit_device_id = 12, value_down = 0.0,    name = _('Weapon Burst Length SHORT'), category = _('Ins Weapons Status and Control Panel PUI-800')},
{down = 3005, cockpit_device_id = 12, value_down = 1.0,    name = _('Weapon Control MAN'), category = _('Ins Weapons Status and Control Panel PUI-800')},
{down = 3005, cockpit_device_id = 12, value_down = 0.0,    name = _('Weapon Control AUTO'), category = _('Ins Weapons Status and Control Panel PUI-800')},

 

SYSTEM: Mainboard MSI MEG X570 | CPU Ryzen 7 5800X @ 4.5 GHz | RAM 64 GB @ 3200 MHz | GPU GIGABYTE RTX 4090 | 1 TB SSD | Win 10 x64

DEVICES: ASUS 27" LCD | TrackIR 5 | LukeClip | Quest 3 | PointCTRL | Virpil HOTAS | MFG Crosswind | TableMount MonsterTech

MODULES: To much to list. But I stopped buying more, because of too much bugs in e.g. A-10C(II). @ED: Fix the bugs and I spend money on modules again. Promised.

PROJECTS: OpenFlightSchool: DE / EN

Link to comment
Share on other sites

Here is the lua code for On/On-Switches for the 3 Virpil VPC SharKa-50 Switches (HMS, AUTO/TS & LASER) to use it for the same switches in the KA-50:

{down = 3002, cockpit_device_id = 23, value_down = 1.0,    name = _('Helmet-mounted sight ON'), category = _('Ins Targeting Mode Controls Panel PVR')},
{down = 3002, cockpit_device_id = 23, value_down = 0.0,    name = _('Helmet-mounted sight OFF'), category = _('Ins Targeting Mode Controls Panel PVR')},
{down = 3017, cockpit_device_id = 12, value_down = 1.0,    name = _('Automatic tracking/gun sight AUTO'), category = _('Ins Targeting Mode Controls Panel PVR')},
{down = 3017, cockpit_device_id = 12, value_down = 0.0,    name = _('Automatic tracking/gun sight TS'), category = _('Ins Targeting Mode Controls Panel PVR')},
{down = 3001, cockpit_device_id = 11, value_down = 1.0,    name = _('Laser standby switch ON'), category = _('Ins Targeting Mode Controls Panel PVR')},
{down = 3001, cockpit_device_id = 11, value_down = 0.0,    name = _('Laser standby switch OFF'), category = _('Ins Targeting Mode Controls Panel PVR')},

 

SYSTEM: Mainboard MSI MEG X570 | CPU Ryzen 7 5800X @ 4.5 GHz | RAM 64 GB @ 3200 MHz | GPU GIGABYTE RTX 4090 | 1 TB SSD | Win 10 x64

DEVICES: ASUS 27" LCD | TrackIR 5 | LukeClip | Quest 3 | PointCTRL | Virpil HOTAS | MFG Crosswind | TableMount MonsterTech

MODULES: To much to list. But I stopped buying more, because of too much bugs in e.g. A-10C(II). @ED: Fix the bugs and I spend money on modules again. Promised.

PROJECTS: OpenFlightSchool: DE / EN

Link to comment
Share on other sites

Some more lua code for Ka-50 and the Virpil VPC SharKa-50:

{down = 3014, cockpit_device_id = 12, value_down = 0.0,    name = _('Weapon system mode MOV'), category = _('Ins Targeting Mode Controls Panel PVR')},
{down = 3014, cockpit_device_id = 12, value_down = 0.1,    name = _('Weapon system mode FIX'), category = _('Ins Targeting Mode Controls Panel PVR')},
{down = 3014, cockpit_device_id = 12, value_down = 0.2,    name = _('Weapon system mode MAN'), category = _('Ins Targeting Mode Controls Panel PVR')},
{down = 3014, cockpit_device_id = 12, value_down = 0.3,    name = _('Weapon system mode FAIL'), category = _('Ins Targeting Mode Controls Panel PVR')},
{down = 3014, cockpit_device_id = 12, value_down = 0.4,    name = _('Weapon system mode NAV'), category = _('Ins Targeting Mode Controls Panel PVR')},
-- Engines Start-Up Control Panel
{down = 3012, cockpit_device_id = 4, value_down = 0.0,    name = _('Engine Startup selector START'), category = _('Ins Engines start-up control panel and levers')},
{down = 3012, cockpit_device_id = 4, value_down = 0.1,    name = _('Engine Startup selector CRANK'), category = _('Ins Engines start-up control panel and levers')},
{down = 3012, cockpit_device_id = 4, value_down = 0.2,    name = _('Engine Startup selector FALSE'), category = _('Ins Engines start-up control panel and levers')},
{down = 3012, up = 3012, value_down = 0.0, value_up = 0.1, cockpit_device_id = 4, name = _('Engine Startup selector START/CRANK'),  category = _('Ins Engines start-up control panel and levers')},
{down = 3012, up = 3012, value_down = 0.2, value_up = 0.1, cockpit_device_id = 4, name = _('Engine Startup selector CRANK/FALSE'),  category = _('Ins Engines start-up control panel and levers')},
{down = 3008, cockpit_device_id = 4, value_down = 0.15,    name = _('Engine selector LEFT'), category = _('Ins Engines start-up control panel and levers')},
{down = 3008, cockpit_device_id = 4, value_down = 0.2,    name = _('Engine selector RIGHT'), category = _('Ins Engines start-up control panel and levers')},
{down = 3008, cockpit_device_id = 4, value_down = 0.0,    name = _('Engine selector MIDDLE'), category = _('Ins Engines start-up control panel and levers')},
{down = 3008, cockpit_device_id = 4, value_down = 0.1,    name = _('Engine selector APU'), category = _('Ins Engines start-up control panel and levers')},
{down = 3008, up = 3008, value_down = 0.15, value_up = 0.0, cockpit_device_id = 4, name = _('Engine selector LEFT/MIDDLE'),  category = _('Ins Engines start-up control panel and levers')},
{down = 3008, up = 3008, value_down = 0.2, value_up = 0.0,  cockpit_device_id = 4, name = _('Engine selector RIGHT/MIDDLE'), category = _('Ins Engines start-up control panel and levers')},

 

SYSTEM: Mainboard MSI MEG X570 | CPU Ryzen 7 5800X @ 4.5 GHz | RAM 64 GB @ 3200 MHz | GPU GIGABYTE RTX 4090 | 1 TB SSD | Win 10 x64

DEVICES: ASUS 27" LCD | TrackIR 5 | LukeClip | Quest 3 | PointCTRL | Virpil HOTAS | MFG Crosswind | TableMount MonsterTech

MODULES: To much to list. But I stopped buying more, because of too much bugs in e.g. A-10C(II). @ED: Fix the bugs and I spend money on modules again. Promised.

PROJECTS: OpenFlightSchool: DE / EN

Link to comment
Share on other sites

  • 4 weeks later...

I'm trying to create some commands for my toggle switchs. I searched at clickalbedata.lua and devices.lua to find button number and device number.

Sucessfully added some commands, and they worked correctly. But when I add more, DCS loses my config.

What I'm doing wrong here? All that are marked with -- when I remove -- makes my file not work.

 

This is for A-10CII

 

--AHCP
{down = iCommandPlaneAHCPMasterArm, 									name = _('Master switch ARM'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPMasterSafe, 									name = _('Master switch SAFE'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPMasterTrain, 									name = _('Master switch TRAIN'), category = _('Armament HUD Control Panel')},
{down = 3001, up = 3001, value_down = 0.2, value_up = 0.1, cockpit_device_id = 7, name = _('Master switch Arm/Safe'), category = _('Armament HUD Control Panel')},
{down = 3001, up = 3001, value_down = 0.0, value_up = 0.1, cockpit_device_id = 7, name = _('Master switch Train/Safe'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPGUNPACArm, 									name = _('GUN/PAC switch ARM'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPGUNSafe, 										name = _('GUN/PAC switch SAFE'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPGUNArm, 										name = _('GUN/PAC switch GUNARM'), category = _('Armament HUD Control Panel')},
{down = 3002, up = 3002, value_down = 0.2, value_up = 0.1, cockpit_device_id = 7, name = _('Gun PacArm/Safe'), category = _('Armament HUD Control Panel')},
{down = 3002, up = 3002, value_down = 0.0, value_up = 0.1, cockpit_device_id = 7, name = _('Gun Arm/Safe'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPLaserArm, 										name = _('LASER switch ARM'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPLaserSafe, 									name = _('LASER switch SAFE'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPLaserTrain, 									name = _('LASER switch TRAIN'), category = _('Armament HUD Control Panel')},
{down = 3003, up = 3003, value_down = 0.2, value_up = 0.1, cockpit_device_id = 7, name = _('Laser Switch Arm/Safe'), category = _('Armament HUD Control Panel')},
{down = 3003, up = 3003, value_down = 0.0, value_up = 0.1, cockpit_device_id = 7, name = _('Laser Switch Train/Safe'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPTGPOnOff, 										name = _('TGP switch ON/OFF'), category = _('Armament HUD Control Panel')},
{down = 3004, up = 3004, value_down = 1.0, value_up = -1.0, cockpit_device_id = 7, name = _('TGP ON/off'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPAltSCEBaro, 									name = _('ALT SCE switch BARO'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPAltSCEDelta, 									name = _('ALT SCE switch DELTA'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPAltSCERadar, 									name = _('ALT SCE switch RADAR'), category = _('Armament HUD Control Panel')},
--{down = 3005, up = 3005, value_down = 0.2, value_up = 0.1, cockpit_device_id = 7, name = _('ALT SCE BARO/DELTA'), category = _('Armament HUD Control Panel')},
--{down = 3005, up = 3005, value_down = 0.0, value_up = 0.1, cockpit_device_id = 7, name = _('ALT SCE RADAR/DELTA'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPHUDModeDayNight, 								name = _('HUD Mode switch Day/Night'), category = _('Armament HUD Control Panel')},
--{down = 3006, up = 3006, value_down = 1.0, value_up = -1.0, cockpit_device_id = 7, name = _('HUD MODE DAY/NIGHT'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPHUDModeNormSTBY, 								name = _('HUD Mode switch NORM/STBY'), category = _('Armament HUD Control Panel')},
--{down = 3007, up = 3007, value_down = 1.0, value_up = -1.0, cockpit_device_id = 7, name = _('HUD MODE NORM/STBY'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPCICUOnOff, 									name = _('CICU switch ON/OFF'), category = _('Armament HUD Control Panel')},
--{down = 3008, up = 3008, value_down = 1.0, value_up = -1.0, cockpit_device_id = 7, name = _('CICU ON/off'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPJTRSOnOff, 									name = _('JTRS switch ON/OFF'), category = _('Armament HUD Control Panel')},
--{down = 3009, up = 3009, value_down = 1.0, value_up = -1.0, cockpit_device_id = 7, name = _('JTRS ON/off'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPIFFCCOn, 										name = _('IFFCC switch ON'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPIFFCCTest, 									name = _('IFFCC switch TEST'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPIFFCCOff, 										name = _('IFFCC switch OFF'), category = _('Armament HUD Control Panel')},
--{down = 3010, up = 3010, value_down = 0.2, value_up = 0.1, cockpit_device_id = 7, name = _('IFFCC ON/TEST'), category = _('Armament HUD Control Panel')},
--{down = 3010, up = 3010, value_down = 0.0, value_up = 0.1, cockpit_device_id = 7, name = _('IFFCC OFF/TEST'), category = _('Armament HUD Control Panel')}

 


Edited by Orsi
Link to comment
Share on other sites

I have added a lot of commands to this file, but generally the value_down and value_up statements have values like 1.0, -1.0 or 0.0. I do not believe that your values like 0.1 and 0.2 will work. Further, you can handle most of your desired additions without going into "clickabledata.lua". For example the IFFCC 3-position switch:

{down = iCommandPlaneAHCPIFFCCOn, up = iCommandPlaneAHCPIFFCCTest, name = _('IFFCC switch ON/TEST'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPIFFCCOff, up = iCommandPlaneAHCPIFFCCTest, name = _('IFFCC switch Off/TEST'), category = _('Armament HUD Control Panel')},

You can handle the ALT SCE switch in the same way. So you don't need to experiment to find the right command values.

For HUD Mode Day/Night I use this line:

{down = 3006, up = 3006, cockpit_device_id = 7 , value_down = 1.0, value_up = 0.0, name = _('AHCP HUD Mode 2-Pos DAY/NIGHT'), category = _('Armament HUD Control Panel')},

The last line in your post cannot work, because you omitted the "," at the end of the line.
I will call it a day, it's nearing midnight here.

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 use Joy2Key. It provides a quick setup for toggle switches (I can bind specific toggle switch to release and press of a key) and much more.

However, I don't understand why ED cannot add such simple yet important option to their input setup ("toggle switch" - that will make it respond both on pressing and releasing of the key), without us having to use 3rd party software or getting PhD in .lua editing.

Make it happen ED, please.

Link to comment
Share on other sites

On 2/16/2022 at 7:27 PM, LeCuvier said:

I have added a lot of commands to this file, but generally the value_down and value_up statements have values like 1.0, -1.0 or 0.0. I do not believe that your values like 0.1 and 0.2 will work. Further, you can handle most of your desired additions without going into "clickabledata.lua". For example the IFFCC 3-position switch:

{down = iCommandPlaneAHCPIFFCCOn, up = iCommandPlaneAHCPIFFCCTest, name = _('IFFCC switch ON/TEST'), category = _('Armament HUD Control Panel')},
{down = iCommandPlaneAHCPIFFCCOff, up = iCommandPlaneAHCPIFFCCTest, name = _('IFFCC switch Off/TEST'), category = _('Armament HUD Control Panel')},

You can handle the ALT SCE switch in the same way. So you don't need to experiment to find the right command values.

For HUD Mode Day/Night I use this line:

{down = 3006, up = 3006, cockpit_device_id = 7 , value_down = 1.0, value_up = 0.0, name = _('AHCP HUD Mode 2-Pos DAY/NIGHT'), category = _('Armament HUD Control Panel')},

The last line in your post cannot work, because you omitted the "," at the end of the line.
I will call it a day, it's nearing midnight here.

thanks a lot, your tips helped me. Now is working properly.

Link to comment
Share on other sites

  • 1 month later...
2021/12/11 AM6点11分,LeCuvier说:

That's fairly easy. First, add this line of code to the file "Throttle - HOTAS Warthog.lua", in the "axisCommands" section close to the end of the file:

{action = 3001, cockpit_device_id = 7, name = _('HUD Brightness Axis')},

Then bind the new command "HUD Brightness Axis" to the slider.
Finally open "Axis tune" and set
Saturation Y = 50% This is necessary because the command uses only 50% of the input signal range)
Slider = True (ticked)
Invert = True

 

Hello, with your help last time, I bind the ka-50 HUD brightness control to throttle slide key successfully, thank you. Now I meet a new problem. I want to bind the A-10C right MFCD brightness control to throttle slide key, base on your method in "How to Edit Control Binding Files.pdf", first I should find the "cockpit_device_id" in A-10C's "clickabledata.lua", in this lua line 549-550:

elements["PNT-MFD-R-BRT-UP"] = action_button(_("Increase Brightness"),  devices.MFCD_RIGHT, MFCD_BRT_Increase, MFCD_BRT_Stop, 348)                
elements["PNT-MFD-R-BRT-DN"] = action_button(_("Decrease Brightness"),  devices.MFCD_RIGHT, MFCD_BRT_Decrease, MFCD_BRT_Stop, 348, -1, {-1.0, 0.0})

Second, I search the "MFCD_RIGHT" in "devices.lua", line 10:    devices["MFCD_RIGHT"] = counter()--3

so the cockpit_device_id = 3   (Am I right ?)

Third step, I should find the "numerical command ID" in "command_defs.lua", but here is the problem, I can't find anything about  MFCD_RIGHT Brightness in  "command_defs.lua", i search "348", nothing.

I open the "MFCD_commands.lua" and still nothing.

I look forward to your reply! 

Link to comment
Share on other sites

On 3/31/2022 at 6:59 PM, hjd1985 said:

...I look forward to your reply! 

For the sake of good order: This was answered in a PM exchange. The answer is: you cannot create an axis binding for MFCD Brightness.

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

  • 2 months later...

Thank you @LeCuvierfor the guidance here, it is very useful.

AMD 5800X3D · MSI 4080 · Asus ROG Strix B550 Gaming  · HP Reverb Pro · 1Tb M.2 NVMe, 32Gb Corsair Vengence 3600MHz DDR4 · Windows 11 · Thrustmaster TPR Pedals · VIRPIL T-50CM3 Base, Alpha Prime R. VIRPIL VPC Rotor TCS Base. JetSeat

Link to comment
Share on other sites

On 2/17/2022 at 2:28 PM, Jascha said:

I use Joy2Key. It provides a quick setup for toggle switches (I can bind specific toggle switch to release and press of a key) and much more.

However, I don't understand why ED cannot add such simple yet important option to their input setup ("toggle switch" - that will make it respond both on pressing and releasing of the key), without us having to use 3rd party software or getting PhD in .lua editing.

Make it happen ED, please.

I have used Joy2key and also Joystick Gremlin for handling latched switches. My biggest frustration is the inconsistency of controls, not just between modules but also within modules.

The A10C II for instance has on & off options for the latched APU switch and just a toggle for the latched battery and AC gen switches. So on a cold start up the AC gen switches are on in the aircraft and off in my button box. I don't think I can fix that using Joy2Key or Gremlin, I need to edit lua files to add the on and off options to work properly with latched (maintained) switches as DCS only provides an option for a momentary switch. For an ED flagship aircraft like the A10C II I think this is an oversight that should be addressed.

 

AMD 5800X3D · MSI 4080 · Asus ROG Strix B550 Gaming  · HP Reverb Pro · 1Tb M.2 NVMe, 32Gb Corsair Vengence 3600MHz DDR4 · Windows 11 · Thrustmaster TPR Pedals · VIRPIL T-50CM3 Base, Alpha Prime R. VIRPIL VPC Rotor TCS Base. JetSeat

Link to comment
Share on other sites

I created these a long time ago:

{down = 3004, up = 3004, cockpit_device_id = 1 , value_down = 1.0, value_up = 0.0, name = _('AC Gen Left Power 2-Pos ON/OFF'), category = _('Electrical power control panel')},
{down = 3005, up = 3005, cockpit_device_id = 1 , value_down = 1.0, value_up = 0.0, name = _('AC Gen Right Power 2-Pos ON/OFF'), category = _('Electrical power control panel')},

 

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 hour ago, LeCuvier said:

I created these a long time ago:

{down = 3004, up = 3004, cockpit_device_id = 1 , value_down = 1.0, value_up = 0.0, name = _('AC Gen Left Power 2-Pos ON/OFF'), category = _('Electrical power control panel')},
{down = 3005, up = 3005, cockpit_device_id = 1 , value_down = 1.0, value_up = 0.0, name = _('AC Gen Right Power 2-Pos ON/OFF'), category = _('Electrical power control panel')},

 

Thanks, I managed to work it out thanks to your guide. I just think it would be better if these were standard to match the other switches but we are where we are and thanks to the community can resolve most controller needs.

Overall I find the controller options in DCS very flexible, we can do most things with some effort and threads like these. Ideally I would like to see a bit more consistency and common standards but I know it has evolved and is a big project to consolidate across modules.

AMD 5800X3D · MSI 4080 · Asus ROG Strix B550 Gaming  · HP Reverb Pro · 1Tb M.2 NVMe, 32Gb Corsair Vengence 3600MHz DDR4 · Windows 11 · Thrustmaster TPR Pedals · VIRPIL T-50CM3 Base, Alpha Prime R. VIRPIL VPC Rotor TCS Base. JetSeat

Link to comment
Share on other sites

It would be a huge job to achieve consistency now with so many modules, almost each implemented in an individual "style".
The majority could be fixed if ED agreed to accept input from a community project into the standard files. I would be happy to contribute and so would many others I'm sure.
In some cases however even "clickabledata.lua" doesn't give us any handle and these would require code changes/additions in the .DLL's.

  • Like 3

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...

Does any part of the code refer to the length of time the physical button input has to last for before triggering the action?   
 

Trying to stop multiple button presses on the F18 UFC.  If I could some how lengthen the time required I think it would stop it happening.  

i9 12900KS  |  3090ti 24GB  |  64GB 5200Mhz DDR5 Corsair Dominator Platinum

GS-4 Seat  |  NLM V3  |  VPC MongoosT-50M2 Base  |  Warthog Throttle + stick  |  MFG Crosswind  |  Reverb G1

 

Link to comment
Share on other sites

15 hours ago, pierscockey said:

Does any part of the code refer to the length of time the physical button input has to last for before triggering the action?   
 

Trying to stop multiple button presses on the F18 UFC.  If I could some how lengthen the time required I think it would stop it happening.  

No, key commands have no delay option. I wonder how you can get multiple key presses though. Sounds like you might have a contact bouncing problem?

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...