Jump to content

How to set up toggle switches (a tutorial)


Recommended Posts

F/A-18C Parking Brake, twist & Pull in one pulsed action

{down=gear_commands.EmergParkHandleSelectPark,pressed=gear_commands.EmergParkHandleOnOff,up=gear_commands.EmergParkHandleSelectPark,cockpit_device_id=devices.GEAR_INTERFACE,value_down=1.0,value_pressed=-1.0,value_up=0.0,name=_('Emergency/Parking Brake Handle [3 Action Special] - CCW+Pull'),category=_('[13] Front Left - Vertical Panel')},

How about FA-18C wings fold/unfold?

| 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

I made an interesting discovery while messing about with input default.lua files the other day...

 

 

Brick.

 

That's awesome. Thank!

hsb

HW Spec in Spoiler

---

 

i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1

 

Link to comment
Share on other sites

How about FA-18C wings fold/unfold?

I came up with this solution:

{down = ctrl_commands.WingFoldPull, pressed  = ctrl_commands.WingFoldSelect, cockpit_device_id = devices.CONTROL_INTERFACE, value_down = 1.0, value_pressed = -1.0, name = _('Wing Fold Control PULL-FOLD'), category = {_('Right Vertical Panel')}},
{down = ctrl_commands.WingFoldSelect, up  = ctrl_commands.WingFoldPull, cockpit_device_id = devices.CONTROL_INTERFACE, value_down = 1.0, value_up = 0.0, name = _('Wing Fold Control SPREAD-STOW'), category = {_('Right Vertical Panel')}},

The first command (PULL-FOLD) will pull the lever and turn it to the "FOLD" position. It requires only a short button press.

The second command will set the lever to the "SPREAD" position. You must hold the button down till the wing is completely unfolded. Then, when you release the button, the lever will be stowed.

Thus, two push buttons are required to produce the commands Pull, Fold, Spread and Stow.


Edited by LeCuvier

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 came up with this solution:

{down = ctrl_commands.WingFoldPull, pressed  = ctrl_commands.WingFoldSelect, cockpit_device_id = devices.CONTROL_INTERFACE, value_down = 1.0, value_pressed = -1.0, name = _('Wing Fold Control PULL-FOLD'), category = {_('Right Vertical Panel')}},
{down = ctrl_commands.WingFoldSelect, up  = ctrl_commands.WingFoldPull, cockpit_device_id = devices.CONTROL_INTERFACE, value_down = 1.0, value_up = 0.0, name = _('Wing Fold Control SPREAD-STOW'), category = {_('Right Vertical Panel')}},

The first command (PULL-FOLD) will pull the lever and turn it to the "FOLD" position. It equires only a short button press.

The second command will set the lever to the "SPREAD" position. You must hold the button down till the wing is completely unfolded. Then, when you release the button, the lever will be stowed.

Thus, two push buttons are required to produce the commands Pull, Fold, Spread and Stow.

That's really clever, thx.

| 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

Hi all. I'm trying to use a 2-Position ON/OFF switch for the A-10C Anti-Skid. Here is the current line in the joystick/default.lua:

{down = iCommandPlaneLGPAntiSkid, name = _('Anti-Skid ON/OFF'), category = _('Landing gear panel')},

 

And here is the line in the clickabledata.lua:

elements["PTR-ANTI-SKID"] = electrically_held_switch(_("Anti Skid"), devices.AUTOPILOT, device_commands.Button_28, device_commands.Button_29, 654)

 

So I tried using the following in the joystick/default.lua:

{down = device_commands.Button_28, up = device_commands.Button_28, value_down = 1.0, value_up = 0.0, cockpit_device_id = devices.AUTOPILOT, name = _('Anti-Skid ON/OFF SWITCH'), category = _('Landing gear panel')},

 

That didn't work. Anyone know how to get this to work? Thanks!

Windows 10 x64 | i5-9600K | ASUS RTX 2080 8GB | 32GB DDR4 3200 | 256GB & 1TB SSD | GIGABYTE Z390 | TM Warthog HOTAS | Virpil WarBRD | Slaw RX Viper v2 | TrackIR 5 | Buddy-Fox A-10C UFC

Link to comment
Share on other sites

@ZBoT: your solution has several issues:

1. The command format is wrong. Where you used "down = device_commands.Button_28" it should be "down = 3028". You use just the numerical command code. In the A-10C like in most other modules, you need to add 3000 to the button number.

2. In the A-10C you have to use the numerical device ID which you find in "devices.lua". For the device "Autopilot", the ID is 38.

3. The Anti-Skid switch is a rather strange control. In "clickabledata" its function name is "electrically_held_switch" and it requires two commands: 3029 for ON and 3028 for OFF. So in the cockpit it's not a simple electro-mechanical switch. That has implications in how you have to define it in the "default.lua" because it requires an ON/OFF sequence for the ON command, and an ON/OFF sequence for the off COMMAND.

I almost gave up; but finally I tried something I really didn't expect to work:

{down = 3029, pressed = 3029,up = 3028, up = 3028, cockpit_device_id = 38, value_down = 1.0, value_pressed = 0.0, value_up = 1.0, value_up = 0.0, name = _('Anti-Skid 2-Pos ON/OFF'), category = _('Landing gear panel')}, -- heureka, this works!

With this line, the cockpit switch moves as expected. I did not test the actual anti-skid functionality during a take-off or landing run, I leave that to you.

One word of caution: The switch should be in the right position at mission start. For a cold start it should be OFF, and for a running start it should be ON. If it's in the wrong starting position, you will have to do an ON/OFF cycle before it behaves correctly.

PS: This was a nice challenge and it made me discover an option that may be useful again in the future.


Edited by LeCuvier

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: That works perfect!!! THANK YOU!!! I learned a lot too so now I should be able to create my other switches on my own. I'm working on building a button box for the first time and this is quite a learning experience. Thanks again for taking the time to not only help me but all the others on this thread in the past.

Windows 10 x64 | i5-9600K | ASUS RTX 2080 8GB | 32GB DDR4 3200 | 256GB & 1TB SSD | GIGABYTE Z390 | TM Warthog HOTAS | Virpil WarBRD | Slaw RX Viper v2 | TrackIR 5 | Buddy-Fox A-10C UFC

Link to comment
Share on other sites

@LeCuvier: That works perfect!!! THANK YOU!!! I learned a lot too so now I should be able to create my other switches on my own. I'm working on building a button box for the first time and this is quite a learning experience. Thanks again for taking the time to not only help me but all the others on this thread in the past.

Glad to hear that. If you come up with something interesting, please share it on this thread!

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

In September 2017, VORTEXRINGSTATE asked for a solution that would allow operation of the Dora's landing gear retract cover and landing gear retract/extend with a single maintained ON/OFF switch:

https://forums.eagle.ru/showpost.php?p=3262951&postcount=359

At that time I had to state that it could not be done. I have revisited the question based on recent findings. My plan was:

Switch to ON:

raise the cover

retract gear

Switch to OFF

extend gear

cover down

The code for this was:

{down = device_commands.Button_6, pressed = device_commands.Button_5, up = device_commands.Button_7, up = device_commands.Button_6, cockpit_device_id = devices.CONTROL_SYSTEM, value_down = 1.0, value_pressed = 1.0, value_up = 1.0, value_up = 0.0, name = _('Landing Gear Retraction Cover + Gear 2-Pos UP/DOWN V1'), category = _('Systems')},

Test result: I could raise the gear after take-off, but I could not extend it for landing.

So I tried a simplified version that omits the last step in the sequence (cover down). The code is:

{down = device_commands.Button_6, pressed = device_commands.Button_5, up = device_commands.Button_7, cockpit_device_id = devices.CONTROL_SYSTEM, value_down = 1.0, value_pressed = 1.0, value_up = 1.0, name = _('Landing Gear Retraction Cover + Gear 2-Pos UP/DOWN V2'), category = _('Systems')},

This works. I can, with a single ON/OFF switch, raise the cover + retract the landing gear, and extend the landing gear. However I cannot put the cover back down after extending. So the solution is not perfect but I can now extend and retract the gear with a single ON/OFF switch.

Obviously, if my mission starts on the ground the switch should be in the OFF (extended) position at mission start, and in the ON (retract) position for missions starting in the air.

PS: If somebody can make the perfect solution work please share!

Edit: You can use exactly the same code for the FW-190A8!


Edited by LeCuvier

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

Really glad that recent discovery is finding some legs and helping people! :thumbup:

 

I'm also revisiting problem modules that were previously thought unsolvable...

 

Here's a bunch of stuff for the KA-50 (I've left out the 'category' bits but the important code is there):

Nothing too fancy here, basically any switch with a cover is now a non-issue! Plus a few others.

 

-- CUSTOM SPECIALS --
{down=3006,pressed=3005,up=3006,cockpit_device_id=2,value_down=0,value_pressed=1,value_up=1,			name=_('Battery 1 Switch & Cover - OPEN>ON>CLOSE'), 						
{down=3006,pressed=3005,up=3006,cockpit_device_id=2,value_down=0,value_pressed=0,value_up=1,			name=_('Battery 1 Switch & Cover - OPEN>OFF>CLOSE'), 						
{down=3004,pressed=3003,up=3004,cockpit_device_id=2,value_down=0,value_pressed=1,value_up=1,			name=_('Battery 2 Switch & Cover - OPEN>ON>CLOSE'), 						
{down=3004,pressed=3003,up=3004,cockpit_device_id=2,value_down=0,value_pressed=0,value_up=1,			name=_('Battery 2 Switch & Cover - OPEN>OFF>CLOSE'), 						
{down=3008,pressed=3009,cockpit_device_id=2,value_down=1.0,value_pressed=1.0,							name=_('Generator Left & Right Switch - ON'), 								
{down=3008,pressed=3009,cockpit_device_id=2,value_down=0.0,value_pressed=0.0,							name=_('Generator Left & Right Switch - OFF'), 								
{down=3001,pressed=3002,cockpit_device_id=3,value_down=1.0,value_pressed=1.0,							name=_('Forward & Aft Tank Pump Switch - ON'), 								
{down=3001,pressed=3002,cockpit_device_id=3,value_down=0.0,value_pressed=0.0,							name=_('Forward & Aft Tank Pump Switch - OFF'), 							
{down=3001,pressed=3002,up=3005,cockpit_device_id=3,value_down=1.0,value_pressed=1.0,value_up=1.0,		name=_('Forward Tank Pump/Aft Tank Pump/Fuel Qty. Meter Switches - ON'), 	
{down=3001,pressed=3002,up=3005,cockpit_device_id=3,value_down=0.0,value_pressed=0.0,value_up=0.0,		name=_('Forward Tank Pump/Aft Tank Pump/Fuel Qty. Meter Switches - OFF'), 	
{down=3007,pressed=3006,up=3007,cockpit_device_id=3,value_down=1.0,value_pressed=1.0,value_up=0.0,		name=_('Engine Shutoff Valve Left Switch & Cover - OPEN>OPEN>SAFE'), 		
{down=3007,pressed=3006,up=3007,cockpit_device_id=3,value_down=1.0,value_pressed=0.0,value_up=0.0,		name=_('Engine Shutoff Valve Left Switch & Cover - OPEN>CLOSED>SAFE'), 		
{down=3009,pressed=3008,up=3009,cockpit_device_id=3,value_down=1.0,value_pressed=1.0,value_up=0.0,		name=_('Engine Shutoff Valve Right Switch & Cover - OPEN>OPEN>SAFE'), 		
{down=3009,pressed=3008,up=3009,cockpit_device_id=3,value_down=1.0,value_pressed=0.0,value_up=0.0,		name=_('Engine Shutoff Valve Right Switch & Cover - OPEN>CLOSED>SAFE'), 	
{down=3011,pressed=3010,up=3011,cockpit_device_id=3,value_down=1.0,value_pressed=1.0,value_up=0.0, 		name=_('Shutoff Valve APU Switch & Cover - OPEN>OPEN>SAFE'), 				
{down=3011,pressed=3010,up=3011,cockpit_device_id=3,value_down=1.0,value_pressed=0.0,value_up=0.0, 		name=_('Shutoff Valve APU Switch & Cover - OPEN>CLOSED>SAFE'), 				
{down=3013,pressed=3012,up=3013,cockpit_device_id=3,value_down=1.0,value_pressed=1.0,value_up=0.0,		name=_('X-FEED Valve Switch & Cover - OPEN>OPEN>SAFE'), 					
{down=3013,pressed=3012,up=3013,cockpit_device_id=3,value_down=1.0,value_pressed=0.0,value_up=0.0,		name=_('X-FEED Valve Switch & Cover - OPEN>CLOSED>SAFE'), 					
{down=3002,pressed=3001,up=3002,cockpit_device_id=4,value_down=1.0,value_pressed=1.0,value_up=0.0, 		name=_('Engine EEG Left Switch & Cover - OPEN>ON>SAFE'), 					
{down=3002,pressed=3001,up=3002,cockpit_device_id=4,value_down=1.0,value_pressed=0.0,value_up=0.0, 		name=_('Engine EEG Left Switch & Cover - OPEN>OFF>SAFE'), 					
{down=3004,pressed=3003,up=3004,cockpit_device_id=4,value_down=1.0,value_pressed=1.0,value_up=0.0, 		name=_('Engine EEG Right Switch & Cover - OPEN>ON>SAFE'), 					
{down=3004,pressed=3003,up=3004,cockpit_device_id=4,value_down=1.0,value_pressed=0.0,value_up=0.0, 		name=_('Engine EEG Right Switch & Cover - OPEN>OFF>SAFE'), 					
{down=3002,pressed=3001,up=3002,cockpit_device_id=5,value_down=1.0,value_pressed=0.0,value_up=0.0,		name=_('Main Hydraulics Power Switch & Cover - OPEN>ON>CLOSE'), 			
{down=3002,pressed=3001,up=3002,cockpit_device_id=5,value_down=1.0,value_pressed=1.0,value_up=0.0,		name=_('Main Hydraulics Power Switch & Cover - OPEN>OFF>CLOSE'), 			
{down=3004,pressed=3001,up=3004,cockpit_device_id=6,value_down=1.0,value_pressed=0.0,value_up=0.0,	 	name=_('Ejection Sys. Power Switch 1 & Cover - OPEN>ON>CLOSE'), 			
{down=3004,pressed=3001,up=3004,cockpit_device_id=6,value_down=1.0,value_pressed=1.0,value_up=0.0,	 	name=_('Ejection Sys. Power Switch 1 & Cover - OPEN>OFF>CLOSE'), 			
{down=3004,pressed=3002,up=3004,cockpit_device_id=6,value_down=1.0,value_pressed=0.0,value_up=0.0,	 	name=_('Ejection Sys. Power Switch 2 & Cover - OPEN>ON>CLOSE'), 			
{down=3004,pressed=3002,up=3004,cockpit_device_id=6,value_down=1.0,value_pressed=1.0,value_up=0.0,	 	name=_('Ejection Sys. Power Switch 2 & Cover - OPEN>OFF>CLOSE'), 			
{down=3004,pressed=3003,up=3004,cockpit_device_id=6,value_down=1.0,value_pressed=0.0,value_up=0.0,	 	name=_('Ejection Sys. Power Switch 3 & Cover - OPEN>ON>CLOSE'), 			
{down=3004,pressed=3003,up=3004,cockpit_device_id=6,value_down=1.0,value_pressed=1.0,value_up=0.0,	 	name=_('Ejection Sys. Power Switch 3 & Cover - OPEN>OFF>CLOSE'), 			
{down=3007,pressed=3006,up=3007,cockpit_device_id=40,value_down=1.0,value_pressed=0.2,value_up=0.0,		name=_('Extinguisher WORK/OFF/TEST Switch & Cover - OPEN>WORK>CLOSE'), 		
{down=3007,pressed=3006,up=3007,cockpit_device_id=40,value_down=1.0,value_pressed=0.1,value_up=0.0,		name=_('Extinguisher WORK/OFF/TEST Switch & Cover - OPEN>OFF>CLOSE'), 		
{down=3019,pressed=3018,up=3019,cockpit_device_id=12,value_down=1.0,value_pressed=1.0,value_up=0.0,		name=_('Weapon System Power Switch & Cover - OPEN>ON>CLOSE'), 				
{down=3019,pressed=3018,up=3019,cockpit_device_id=12,value_down=1.0,value_pressed=0.0,value_up=0.0,		name=_('Weapon System Power Switch & Cover - OPEN>OFF>CLOSE'), 				
{down=3002,pressed=3001,up=3002,cockpit_device_id=42,value_down=1.0,value_pressed=1.0,value_up=0.0,		name=_('IFF Power Switch & Cover - OPEN>ON>CLOSE'), 						
{down=3002,pressed=3001,up=3002,cockpit_device_id=42,value_down=1.0,value_pressed=0.0,value_up=0.0,		name=_('IFF Power Switch & Cover - OPEN>OFF>CLOSE'), 						
{down=3012,pressed=3010,up=3012,cockpit_device_id=22,value_down=1.0,value_pressed=1.0,value_up=0.0,		name=_('UV-26 Power Switch & Cover - OPEN>ON>CLOSE'), 						
{down=3012,pressed=3010,up=3012,cockpit_device_id=22,value_down=1.0,value_pressed=0.0,value_up=0.0,		name=_('UV-26 Power Switch & Cover - OPEN>OFFCLOSE'), 						
{down=3003,pressed=3002,up=3003,cockpit_device_id=34,value_down=1.0,value_pressed=1.0,value_up=0.0,		name=_('EKRAN/HYD/TRANS/PWR Systems Switch & Cover - OPEN>ON>CLOSE'), 		
{down=3003,pressed=3002,up=3003,cockpit_device_id=34,value_down=1.0,value_pressed=0.0,value_up=0.0,		name=_('EKRAN/HYD/TRANS/PWR Systems Switch & Cover - OPEN>OFF>CLOSE'), 		


Edited by Fubarbrickdust
  • Thanks 1

9700k@5.2Ghz | GTX 1080ti | 32gb Ram@3200Mhz | 512gb M.2 NVME SSD

Oculus Rift S | VKB GF Pro Mk.II+MCG Pro (rotary wing) | BRD DS-Raven (fixed wing) | MFG Crosswind V2 | Jetseat+SSA/SSM | SimLab GT1 80/20 Rig | NLR Motion Platform V3 | Quad Bass Shaker Setup

DIY Control Panels: 'White Rhino' Throttle | UFC | MFBB Left | MFBB Right | MFBB Centre | WEP-TECH ACP | HYD-MECH LDG | SYS-ELEC | AN/ARC Radio

Link to comment
Share on other sites

  • 2 weeks later...

Hi Guys, Just starting to read all the posts here starting at page 1 of 59 and noticed that when I opened my LUA file in Notepad, Win10 64x, that there are a lot of tabs in between stuff and wondering how to remove those to make the file easier to read and navigate? I have copied all of the actual files in that joystick folder and moved them to a folder on my desktop so I don't corrupt or mess up while figuring this button 'ON' and 'OFF' state. I have the TM Warthog and using it only with the F/A-18C currently, but have pre-purchased the F-16C and want to use this knowledge to get that working when it gets released. I learn quick, but need good references to see and figure stuff out. Please help and be patient with me.

Wayne Wilson

AKA: hrnet940

Alienware Aurora R3, i7 3820 3.5GHz(4.2GHz setting) processor, EVGA Nvidia RTX 2070 8GB Graphics, 16GB Ram, 1TB SSD.

Link to comment
Share on other sites

How-to document

 

Have you downloaded the How-To document from this post?

https://forums.eagle.ru/showpost.php?p=2862001&postcount=214

For any editing, use the free program Notepad++

If you want to get rid of the extra spaces in every line you will have to to use your "Delete" key very extensively (unless you want to write a script or program that does it for you which is risky). I remove the spaces only in those lines that I copy and modify.

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

Thanks LeCuvier, I have downloaded and installed the latest Notepad++ (7.7.1) and also downloaded your above mentioned How-To document. I am starting to get my head wrapped around what it needs to look like and might start getting into this next week as I have the week off of work for a little vacation. Thanks and I'll let you, and everyone here, know how it goes. Flying is not that fun when I have to remember to cycle switches a few times to get something to work. I do like FSX for using the FSUIPC program from Pete Dowson; worth every penny I paid for the paid version. Wish we had that style of program for us here in DCS world. Thanks Again!

Wayne Wilson

AKA: hrnet940

Alienware Aurora R3, i7 3820 3.5GHz(4.2GHz setting) processor, EVGA Nvidia RTX 2070 8GB Graphics, 16GB Ram, 1TB SSD.

Link to comment
Share on other sites

Hi Guys, I am starting to get things working, like the Speed Brakes, Fuel Probe and a few others, as I want them. I am trying to get the EAC switch on my TM Warthog to act as my Gear up/down, but having a problem figuring it out. When I modified the speed brake control in the default.lua file it changed it to amber in the game settings page. How do I get the EAC switch (Button #24) to behave as I want it to with "OFF" as Gear Down and "ARM" as GEAR UP? Still not that clear to me and there are 59 pages to go through. When I open the settings and control tab and set Landing Gear Control Up/Down to JOY_BTN_24 it needs to by cycled up and down to make a change to the gear. I used the -1.0 and 1.0 to get the Speed Brake switch to work, but can't seem to find what line to modify to get the gear to do the same.

 

 

This is what I have for operating the Speed brake switch to pull back to open when being held in the 'ON' state and closes when I release the switch ('OFF"). Am I doing this correctly?

 

{ down = hotas_commands.THROTTLE_SPEED_BRAKE, up = hotas_commands.THROTTLE_SPEED_BRAKE, cockpit_device_id = devices.HOTAS, value_down = -1.0, value_up = 1.0, name = _('Speed Brake Switch - EXTEND'), category = {_('Throttle Grip'), _('HOTAS')}},

 

This is in the FA-18C aircraft. This is the one I am currently playing with to get working and enjoying before the F-16 gets released. Thanks


Edited by hrnet940
Missed the aircraft type being modified.

Wayne Wilson

AKA: hrnet940

Alienware Aurora R3, i7 3820 3.5GHz(4.2GHz setting) processor, EVGA Nvidia RTX 2070 8GB Graphics, 16GB Ram, 1TB SSD.

Link to comment
Share on other sites

@hrnet940: This is what I have in the my default.lua for the A-10C landing gear:

{down = iCommandPlaneGearUp, up = iCommandPlaneGearDown, name = _('Landing Gear 2-Pos ON/OFF'), category = _('Landing gear panel')},

 

Hopefully it's similar for the F18 (I don't have that to test). Once that is in the default.lua, you should be able to assign it to any 2-position switch (ie: EAC switch).

Windows 10 x64 | i5-9600K | ASUS RTX 2080 8GB | 32GB DDR4 3200 | 256GB & 1TB SSD | GIGABYTE Z390 | TM Warthog HOTAS | Virpil WarBRD | Slaw RX Viper v2 | TrackIR 5 | Buddy-Fox A-10C UFC

Link to comment
Share on other sites

The code presented by ZBot should work. In the name I would probably use "...UP/DOWN" instead of "...ON/OFF", but that's only a detail.

 

For the speedbrake, the command you created will work with an ON/OFF switch if you give it a distinct name. You gave your command the same name as an existing command and that's a fundamental mistake. Names must always be unique. From a practical point of view, I don't see why you want to create this command as an ON/OFF. The existing code supports use of the speed brake switch of the TM WH throttle and it gives perfect operation, including ability to hold the brake in a partially extended state.


Edited by LeCuvier

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

Thanks to both of you. How would that look and how do I get the line/statement from ZBot into the default.lua and where does it need to be placed? I found what was there and changed it. I am not a programmer, but willing to learn what I need to get going towards my eventual cockpit completed and fully functioning. Thanks Again!


Edited by hrnet940
Left vital information out.

Wayne Wilson

AKA: hrnet940

Alienware Aurora R3, i7 3820 3.5GHz(4.2GHz setting) processor, EVGA Nvidia RTX 2070 8GB Graphics, 16GB Ram, 1TB SSD.

Link to comment
Share on other sites

Thanks to both of you. How would that look and how do I get the line/statement from ZBot into the default.lua and where does it need to be placed? I found what was there and changed it. I am not a programmer, but willing to learn what I need to get going towards my eventual cockpit completed and fully functioning. Thanks Again!

 

For the A-10 the file is located here on my machine:

C:\Program Files\Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\A-10C\Input\A-10C\joystick\default.lua

 

I do suggest you download and read LeCuvier's how-to pdf. It is excellent. It will answer many of your questions and summarizes the 60 pages of this forum nicely.

Windows 10 x64 | i5-9600K | ASUS RTX 2080 8GB | 32GB DDR4 3200 | 256GB & 1TB SSD | GIGABYTE Z390 | TM Warthog HOTAS | Virpil WarBRD | Slaw RX Viper v2 | TrackIR 5 | Buddy-Fox A-10C UFC

Link to comment
Share on other sites

Thanks to both of you. How would that look and how do I get the line/statement from ZBot into the default.lua and where does it need to be placed? I found what was there and changed it. I am not a programmer, but willing to learn what I need to get going towards my eventual cockpit completed and fully functioning. Thanks Again!

You don't need to be a programmer. Just read the how-to guide. It's only 14 pages. If you don't take the time to read you will probably waste more time figuring out what you did wrong.

And don't forget that any update will overwrite your modified file. Recommendation: install and set up OvGME to back out and restore your modified files.

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

Recommendation: install and set up OvGME to back out and restore your modified files.

 

Thanks @LeCuvier!! I wasn't aware of the OvGME tool. That works out nicely for managing these modified files.

Windows 10 x64 | i5-9600K | ASUS RTX 2080 8GB | 32GB DDR4 3200 | 256GB & 1TB SSD | GIGABYTE Z390 | TM Warthog HOTAS | Virpil WarBRD | Slaw RX Viper v2 | TrackIR 5 | Buddy-Fox A-10C UFC

Link to comment
Share on other sites

  • 2 weeks later...

Hi all, is it possible to make a 3 possition command for the Bf-109 flaps like up-half-down? It works with the F-14 flaps who also use axis command for the flaps.

And one more thing, is it possible to make the same command for the P-51 and Mig-15 flaps, up-take off-landing possition?:)

-royphsle

 

F-16C:thumbup:

i7-4790 CPU 3.60GHz | 16 GB RAM | MSI GTX-960 Gaming 4GB | TM Warthog HOTAS | MFG Crosswind Pedals | TrackIR 5

Link to comment
Share on other sites

3 or 4-Position Command for Bf-109 Flaps

 

Hi all, is it possible to make a 3 possition command for the Bf-109 flaps like up-half-down? It works with the F-14 flaps who also use axis command for the flaps.

And one more thing, is it possible to make the same command for the P-51 and Mig-15 flaps, up-take off-landing possition?:)

The Bf-109 flaps are an axis and it's generally easy to implement switch commands for an axis. You asked for 3-position and I ive you the option for a 4-positio command with these lines:

{down = device_commands.Button_94, up = device_commands.Button_94, cockpit_device_id = devices.CONTROLS, value_down = 1.0, value_up = 0.5, name = _('Flaps Flight/25% Out'), category = _('Flight Control')},
{down = device_commands.Button_94, up = device_commands.Button_94, cockpit_device_id = devices.CONTROLS, value_down = -1.0, value_up = -0.0, name = _('Flaps Land/50% Out'), category = _('Flight Control')},

With the 109 I usually take off with flaps fully retracted, except if I carry a bomb. However I tried, and take-off with flaps 50% out even without bomb load works well. The command lines above will extend the flaps to 25 % when you switch from UP to MIDDLE, and to 50% if you switch from DOWN to MIDDLE. If you only want 3 positions, simply change the "value_up" values so they are the same in both lines.

I'm actually glad you asked this question for I now use the 4-position command and that frees up my left throttle axis for the Bf-109.

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

3 or 4-Position Command for P-51D Flaps

 

... And one more thing, is it possible to make the same command for the P-51 and Mig-15 flaps, up-take off-landing possition?:)

For the P-51 there is a solution using the command ID of the flaps lever in the cockpit:

{down = device_commands.Button_1, up = device_commands.Button_1, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 1.0, value_up = 0.8, name = _('Flaps FLIGHT/10° OUT'), category = _('Flight Control')},
{down = device_commands.Button_1, up = device_commands.Button_1, cockpit_device_id  = devices.CONTROL_SYSTEM, value_down = 0.0, value_up = 0.6, name = _('Flaps LAND/20° OUT'), category = _('Flight Control')},

Again, the P-51 normally takes off with flaps in the UP position, but can take off with flaps extended to 15 - 20°. The flaps can be set from UP to 50° in ratcheted steps of 10".

The lines above provide the positions UP, 10° out, 20° out and DOWN (50°).

You can play with the "value_up" values just like for the Bf-109.

 

As to the Mig-15. I don't have that plane and therefore don't know what's possible. If you provide me with the "default.lua" and "clickabledata.lua" per PM, I can try to figure it out.

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

For the P-51 there is a solution using the command ID of the flaps lever in the cockpit...

 

Thanks, it works perfectly:) When I pasted the Bf-109 command at the top of the lua file, in the correct block, many commands turned yellow in the game?! But when I changed it to the bottom of the block, the yellow commands disappeared fortunately. I have experienced yellow commands in the game control options before, just a few commands, with some aircraft. Do you know why that happens?

 

Do you need the whole file or just the flaps commands? The Mig-15 have a up-neutral-20 degrees-55 degrees possitions. Nothing happens when you move the flaps from 55 to 20, then you have to use up possition. So from down to half possition is not possible but thats ok. I need a command for up-20 degrees-55 degrees if its possible:)

-royphsle

 

F-16C:thumbup:

i7-4790 CPU 3.60GHz | 16 GB RAM | MSI GTX-960 Gaming 4GB | TM Warthog HOTAS | MFG Crosswind Pedals | TrackIR 5

Link to comment
Share on other sites

... When I pasted the Bf-109 command at the top of the lua file, in the correct block, many commands turned yellow in the game?!.

You must have pasted in the wrong place and thereby caused a syntax violation. You must paste within the block for key commands.

For the Kurfürst, that block is delimited by this line at the top:

keyCommands = {

and this line at the bottom:

},

at about line 625 (depending on how many lines you have added).

Any additions to axis commands must be inserted into the related block just below that.

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