Jump to content

How to set up toggle switches (a tutorial)


Recommended Posts

The slider does set a zoom value Independient from the initial zoom setting.

As soon as you move the slider it jumps to 50% on center position.

What I do to solve this problem, is to adjust the slider axis.

Thanks for the quick reply, I will try that :)

-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

You have to use 'user snapviews' so to change the view of the default cockpit view which is shown by Num5 for default angles and Enter for default zoom.

 

Snap views WIKI

http://en.wiki.eagle.ru/wiki/Snap_views

 

"In the DCS World, DCS A-10C or DCS Black Shark 2 installation folder, then folder config, then folder view, find file View.lua"

 

UseDefaultSnapViews = true

 

and change it to

 

UseDefaultSnapViews = false

 

"Customisation Procedure

 

The keystroke RAlt+Num0 (default binding) will save the current view position against the last-selected Snap View ... "

 

.. bla bla all of the NumKeys Snapviews ..

 

Then this:

"Customising the Default View"

 

1. Press Num5

to reset your view to the current default.

2. Adjust your view to what you want as the new default

but do not use any snap view keys in the process!. If you have TrackIR, you will probably need to shut it off while doing this, otherwise it won't save the view the way you want it!

 

My comment: for the new default cockpit view ONLY adjust Zoom so your zooms later in the game are not distorted by tilt or height change, where DCS expects zoom-in to go to expected positions

 

3. Press RALT+Num0 - your new default view should now be saved.

 

"Test it by changing your view, then pressing Num5 - your view should return to your customised default! "

 

You actually do Num5 then Enter to go from any position and zoom to Default cockpit view.

 

It's a bit awkward to set up at first, but when you know, you know.

| 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

You have to use 'user snapviews' so to change the view of the default cockpit view which is shown by Num5 for default angles and Enter for default zoom.

 

Snap views WIKI

http://en.wiki.eagle.ru/wiki/Snap_views

 

"In the DCS World, DCS A-10C or DCS Black Shark 2 installation folder, then folder config, then folder view, find file View.lua"

 

UseDefaultSnapViews = true

 

and change it to

 

UseDefaultSnapViews = false

 

"Customisation Procedure

 

The keystroke RAlt+Num0 (default binding) will save the current view position against the last-selected Snap View ... "

 

.. bla bla all of the NumKeys Snapviews ..

 

Then this:

"Customising the Default View"

 

1. Press Num5

to reset your view to the current default.

2. Adjust your view to what you want as the new default

but do not use any snap view keys in the process!. If you have TrackIR, you will probably need to shut it off while doing this, otherwise it won't save the view the way you want it!

 

My comment: for the new default cockpit view ONLY adjust Zoom so your zooms later in the game are not distorted by tilt or height change, where DCS expects zoom-in to go to expected positions

 

3. Press RALT+Num0 - your new default view should now be saved.

 

"Test it by changing your view, then pressing Num5 - your view should return to your customised default! "

 

You actually do Num5 then Enter to go from any position and zoom to Default cockpit view.

 

It's a bit awkward to set up at first, but when you know, you know.

That likely does not help with the slider... The slider value overrides the initial "snapview", as well, AFAIK.

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VPForce Rhino Base & VIRPIL T50 CM2 Stick on 200mm curved extension | VIRPIL T50 CM2 Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Link to comment
Share on other sites

Has anyone been able to get the APU switch to toggle in both directions on the 18?

No, it's modelled after the real thing. The switch latches in electromagnetically and automatically returns to OFF when the APU is no longer needed.

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

The slider does set a zoom value Independient from the initial zoom setting.

As soon as you move the slider it jumps to 50% on center position.

What I do to solve this problem, is to adjust the slider axis.

Go ingame and set the slider to a comfortable setting.

Now go to control setup/axis and open the axis adjustments, without(!) touching the slider.

Now set user curve and slider and then move the slider a tiny bit, so the mark jumps to the current position.

Remember the marks position on the vertical axis and adjust the axis, so that at 50% (the slider notch) the mark is in the position you memorized.

 

You can further adjust that with saturation, easily.

I have tried to fix the default view in cockpit using your method, but I don't understand this: ''Now set user curve and slider and then move the slider a tiny bit, so the mark jumps to the current position. Remember the marks position on the vertical axis and adjust the axis, so that at 50% (the slider notch) the mark is in the position you memorized''

-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

  • 2 weeks later...

Hi, is it possible to make this AV-8B toggle command to a ON/OFF command?:)

{down = iCommandPlane_ABRIS_BT_4, up = iCommandPlane_ABRIS_BT_4, value_down = 0.0, value_up = 1.0, name = _('HUD Altimeter-Selector'), category = _('HUD Control')},

-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

I have tried to fix the default view in cockpit using your method, but I don't understand this: ''Now set user curve and slider and then move the slider a tiny bit, so the mark jumps to the current position. Remember the marks position on the vertical axis and adjust the axis, so that at 50% (the slider notch) the mark is in the position you memorized''
Sorry, missed your post.

When you set the slider to the zoom axis, it will have the 50% Position at the middle of the zoom-range which means it is slightly zoomed out.

 

So rather than adjusting the DCS zoom-range in the lua we simply adjust the slider axis to have the "normal" FOV position match the 50% (middle detent) of the physical slider.

 

EDIT: Screenshot of how it looks like in DCS

 

attachment.php?attachmentid=191493&stc=1&d=1533471001

 

Now, with the setup like this, you can now fine tune your "sweet spot" FOV by adjusting the Y-saturation. The flattened part (the 100% columns) limits the zoom out to a range where it doesn't unnaturally distort the view...

 

If you go in-game, adjust the physical slider to a position, where it matches your "sweet spot", leave it there. Then you can use the ESC menu to switch to the controls setup, call the slider and by moving it a tiny bit it jumps to the current "position". Now you know where you want the red dot toshow up roughly. If necessary you need to adjust the user curve.

For me the setup works pretty well with the values you see and with all planes.

Slider_Zoom.jpg.8b53e2f0156b01dde9530f349cad0b64.jpg


Edited by shagrat

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VPForce Rhino Base & VIRPIL T50 CM2 Stick on 200mm curved extension | VIRPIL T50 CM2 Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Link to comment
Share on other sites

Hi, is it possible to make this AV-8B toggle command to a ON/OFF command?:)

{down = iCommandPlane_ABRIS_BT_4, up = iCommandPlane_ABRIS_BT_4, value_down = 0.0, value_up = 1.0, name = _('HUD Altimeter-Selector'), category = _('HUD Control')},

Hi, I don't think that will work. I suggest you add this line of code in the file:

{down = 3293, up = 3293,cockpit_device_id = devices.HUDCONTROL, value_down = 0, value_up = 1, name = _('HUD Altitude Selector 2-Pos BARO/RADAR'), category = _('HUD Control')},

With this line, switch ON = BARO, OFF = RADAR.

If you want the reverse, change to "value_down = 1, value_up = 0".

Remember that ON/OFF switches synchronize when they transition to ON. Therefore that alternative version will work best if the default mode in the cockpit is BARO. 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

Sorry, missed your post.

When you set the slider to the zoom axis, it will have the 50% Position at the middle of the zoom-range which means it is slightly zoomed out.

 

So rather than adjusting the DCS zoom-range in the lua we simply adjust the slider axis to have the "normal" FOV position match the 50% (middle detent) of the physical slider.

Thanks it worked, you are smart!:)

-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

Hi, I don't think that will work. I suggest you add this line of code in the file:

{down = 3293, up = 3293,cockpit_device_id = devices.HUDCONTROL, value_down = 0, value_up = 1, name = _('HUD Altitude Selector 2-Pos BARO/RADAR'), category = _('HUD Control')},

With this line, switch ON = BARO, OFF = RADAR.

If you want the reverse, change to "value_down = 1, value_up = 0".

Remember that ON/OFF switches synchronize when they transition to ON. Therefore that alternative version will work best if the default mode in the cockpit is BARO. Good luck!

Thanks for the help, now it works as a ON/OFF button:thumbup:

-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

So here’s my question...without looking through 486 posts...is it possible to modify the code so a SPST On / Off toggle switch will work the Landing year in the A10 and F-18?

[sIGPIC][/sIGPIC]

Primary Computer

ASUS Z390-P, i7-9700K CPU @ 5.0Ghz, 32GB Patriot Viper Steel DDR4 @ 3200Mhz, ZOTAC GeForce 1070 Ti AMP Extreme, Samsung 970 EVO M.2 NVMe drives (1Tb & 500 Gb), Windows 10 Professional, Thrustmaster Warthog HOTAS, Thrustmaster Warthog Stick, Thrustmaster Cougar Throttle, Cougar MFDs x3, Saitek Combat Rudder Pedals and TrackIR 5.

 

-={TAC}=-DCS Server

Gigabyte GA-Z68XP-UD3, i7-3770K CPU @ 3.90GHz, 32GB G.SKILL Ripjaws DDR3 @ 1600Mhz, ZOTAC GeForce® GTX 970.

Link to comment
Share on other sites

So here’s my question...without looking through 486 posts...is it possible to modify the code so a SPST On / Off toggle switch will work the Landing year in the A10 and F-18?

Yes, thta should be easy; but you won't be able then to set the flaps to the middle position. You will only have the positions EXTENDED/RETRACTED in the A-10C, and AUTO/FULL in the F-18C

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

Dont work to me!

 

Hello everyone, I try to do this, but I do not have the same file here, I want to change the helicopters Uh-h1 and Gazelle, when I open the file below it does not appear as the information that yours, if anyone can help me.

 

Example: Auto pilot - Altitude mod = using button if to keep press the switch stay up, if i stop hold button they come down, i want to press the switch go up and if a press again go down ...

 

 

C:\Users\<name>\Saved Games\DCS.openbeta\Config\Input\SA342\joystick

 

i see this archive 38661924_1861310620593623_8831746138437582848_n.jpg?_nc_cat=0&oh=a1f7bc92a7021e722b13f6e37706443e&oe=5C0E3D1B

 

 

:helpsmilie::helpsmilie:

Link to comment
Share on other sites

Hello everyone, I try to do this, but I do not have the same file here, I want to change the helicopters Uh-h1 and Gazelle, when I open the file below it does not appear as the information that yours, if anyone can help me.

 

Example: Auto pilot - Altitude mod = using button if to keep press the switch stay up, if i stop hold button they come down, i want to press the switch go up and if a press again go down ...

 

 

C:\Users\<name>\Saved Games\DCS.openbeta\Config\Input\SA342\joystick

 

i see this archive

 

 

:helpsmilie::helpsmilie:

You have opened the .diff.lua file under Saved Games.

 

You need to open the "default.lua" in the program files tree. I don't have these choppers, but for the Ka-50 it would be under "...\Eagle Dynamics\DCS World\Mods\aircraft\Ka-50\Input\ka-50\joystick"

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

LOL

 

You have opened the .diff.lua file under Saved Games.

 

You need to open the "default.lua" in the program files tree. I don't have these choppers, but for the Ka-50 it would be under "...\Eagle Dynamics\DCS World\Mods\aircraft\Ka-50\Input\ka-50\joystick"

 

Man, thank you soo much!! I open too much folders except "Mods", i find the file, now im gonna change some commands, one more question, example dont have one comand, i can simulate on another aircraft and copy the line do this file, with lucky the command work, right?

Link to comment
Share on other sites

Man, thank you soo much!! I open too much folders except "Mods", i find the file, now im gonna change some commands, one more question, example dont have one comand, i can simulate on another aircraft and copy the line do this file, with lucky the command work, right?

No, that's very unlikely to work.

What are you trying to do? On what aircraft?

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

Hi all,

 

Working on AHCP panel with a friend, have it working as a joystick nicely, just need to get DCS to default to centre positions when the 3 way switches are in neither the up nor down position.

 

Example...

A toggle switch with 3 positions

up = JOY_BTN1 = Master ARM

centre = no button

down = JOY_BTN2 = Master Train

 

I have come up with the following...

{combos = {{key = 'JOY_BTN1'}}    ,down = iCommandPlaneAHCPMasterArm,up = iCommandPlaneAHCPMasterSafe,name = ('Master switch ARM'), category = ('Armament HUD Control Panel')},
{combos = {{key = 'JOY_BTN2'}}    ,down =iCommandPlaneAHCPMasterTrain,up = iCommandPlaneAHCPMasterSafe,name = ('Master switch TRAIN'), category = ('Armament HUD Control Panel')},

 

I tried replacing some code in the file " A-10C_AHCP {3D04EBA0-A2F5-11e8-8002-444553540000}.diff.lua " from my save games dir with the above code, but broke DCS to the point where no key on the keyboard and no button on any joystick worked, mouse did work for all but pan/tilt/zoom.

 

Here is my file with the basic buttons configured, can anyone offer any suggestions???

 

local diff = {
["keyDiffs"] = {
	["d1374pnilunilcdnilvdnilvpnilvunil"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN1",
			},
		},
		["name"] = "Master switch ARM",
	},
	["d1376pnilunilcdnilvdnilvpnilvunil"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN2",
			},
		},
		["name"] = "Master switch TRAIN",
	},
	["d1377pnilunilcdnilvdnilvpnilvunil"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN3",
			},
		},
		["name"] = "GUN/PAC switch ARM",
	},
	["d1379pnilunilcdnilvdnilvpnilvunil"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN4",
			},
		},
		["name"] = "GUN/PAC switch GUNARM",
	},
	["d1380pnilunilcdnilvdnilvpnilvunil"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN5",
			},
		},
		["name"] = "LASER switch ARM",
	},
	["d1382pnilunilcdnilvdnilvpnilvunil"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN6",
			},
		},
		["name"] = "LASER switch TRAIN",
	},
	["d1383pnilunilcdnilvdnilvpnilvunil"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN7",
			},
		},
		["name"] = "TGP switch ON/OFF",
	},
	["d1384pnilunilcdnilvdnilvpnilvunil"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN8",
			},
		},
		["name"] = "ALT SCE switch BARO",
	},
	["d1386pnilunilcdnilvdnilvpnilvunil"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN9",
			},
		},
		["name"] = "ALT SCE switch RADAR",
	},
	["d1387pnilunilcdnilvdnilvpnilvunil"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN10",
			},
		},
		["name"] = "HUD Mode switch Day/Night",
	},
	["d1388pnilunilcdnilvdnilvpnilvunil"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN11",
			},
		},
		["name"] = "HUD Mode switch NORM/STBY",
	},
	["d1389pnilunilcdnilvdnilvpnilvunil"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN12",
			},
		},
		["name"] = "CICU switch ON/OFF",
	},
	["d1390pnilunilcdnilvdnilvpnilvunil"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN13",
			},
		},
		["name"] = "JTRS switch ON/OFF",
	},
	["d1391pnilunilcdnilvdnilvpnilvunil"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN14",
			},
		},
		["name"] = "IFFCC switch ON",
	},
	["d1393pnilunilcdnilvdnilvpnilvunil"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN15",
			},
		},
		["name"] = "IFFCC switch OFF",
	},
	["d350pnilu351cdnilvdnilvpnilvunil"] = {
		["name"] = "Weapon release",
		["removed"] = {
			[1] = {
				["key"] = "JOY_BTN2",
			},
		},
	},
	["d554pnilu638cdnilvdnilvpnilvunil"] = {
		["name"] = "Gun Trigger",
		["removed"] = {
			[1] = {
				["key"] = "JOY_BTN1",
			},
		},
	},
	["d562pnilu606cdnilvdnilvpnilvunil"] = {
		["name"] = "HOTAS Nosewheel Steering Button",
		["removed"] = {
			[1] = {
				["key"] = "JOY_BTN4",
			},
		},
	},
	["d957pnilu958cdnilvdnilvpnilvunil"] = {
		["name"] = "Stick to trimmer control mode",
		["removed"] = {
			[1] = {
				["key"] = "JOY_BTN3",
			},
		},
	},
	["dnilp210u214cdnilvdnilvpnilvunil"] = {
		["name"] = "View Up Right slow",
		["removed"] = {
			[1] = {
				["key"] = "JOY_BTN_POV1_UR",
			},
		},
	},
	["dnilp211u214cdnilvdnilvpnilvunil"] = {
		["name"] = "View Down Right slow",
		["removed"] = {
			[1] = {
				["key"] = "JOY_BTN_POV1_DR",
			},
		},
	},
	["dnilp212u214cdnilvdnilvpnilvunil"] = {
		["name"] = "View Down Left slow",
		["removed"] = {
			[1] = {
				["key"] = "JOY_BTN_POV1_DL",
			},
		},
	},
	["dnilp213u214cdnilvdnilvpnilvunil"] = {
		["name"] = "View Up Left slow",
		["removed"] = {
			[1] = {
				["key"] = "JOY_BTN_POV1_UL",
			},
		},
	},
	["dnilp32u214cdnilvdnilvpnilvunil"] = {
		["name"] = "View Left slow",
		["removed"] = {
			[1] = {
				["key"] = "JOY_BTN_POV1_L",
			},
		},
	},
	["dnilp33u214cdnilvdnilvpnilvunil"] = {
		["name"] = "View Right slow",
		["removed"] = {
			[1] = {
				["key"] = "JOY_BTN_POV1_R",
			},
		},
	},
	["dnilp34u214cdnilvdnilvpnilvunil"] = {
		["name"] = "View Up slow",
		["removed"] = {
			[1] = {
				["key"] = "JOY_BTN_POV1_U",
			},
		},
	},
	["dnilp35u214cdnilvdnilvpnilvunil"] = {
		["name"] = "View Down slow",
		["removed"] = {
			[1] = {
				["key"] = "JOY_BTN_POV1_D",
			},
		},
	},
	["dnilp36unilcdnilvdnilvpnilvunil"] = {
		["name"] = "View Center",
		["removed"] = {
			[1] = {
				["key"] = "JOY_BTN5",
			},
		},
	},
},
}
return diff


Edited by v81

R7 3800X - 32Gig RAM -- All SSD -- GTX1070 -- TM Warthog, MFG Crosswinds & TiR

Link to comment
Share on other sites

@v81:

Apparently you have added your two lines of code to the .diff.lua file and that's fundamentally wrong. They must go into the file "default.lua" under "...\Eagle Dynamics\DCS World\Mods\aircraft\A-10C\Input\A-10C\joystick. You need to remove these lines from the .diff.lua as they certainly break your bindings.

Still, the code has a basic problem: the two commands you have defined have the same name as the original lines of code in "default.lua". Names must be unique.

Further, it's not practical in my opinion to include the "combo" statement as it makes the command binding default to JOY_BTN1 and JOY_BTN2. This approach makes sense for controls on the Warthog HOTAS that are used exactly as in the A-10C. But in your case I believe you will use switches on a sim pit and they are are unlikely to be connected to JOY_BTN1 and JOY_BTN2 on your Bodnar board.

I recommend you use these two lines of code instead:

{down = iCommandPlaneAHCPMasterArm, up = iCommandPlaneAHCPMasterSafe,name = _('Master switch ARM/SAFE'), category = _('Armament HUD Control Panel')}, 

{down = iCommandPlaneAHCPMasterTrain, up = iCommandPlaneAHCPMasterSafe, name = _('Master switch TRAIN/SAFE'), category = _('Armament HUD Control Panel')},

This will create two new command options under Options/Controls that you can bind to any button you want.


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

This will create two new command options under Options/Controls that you can bind to any button you want.

 

This is awesome info, and even better than i'd hoped for.

I thought i'd have to write a line & assign a button number for each button (switch).

Being able to create new command options is brilliant and just what we need.

 

I'll get started and let you know how it works out.

 

Much appreciated.:thumbup:

 

 

::edit::

Works perfectly, and now we have a better understanding.

Again much appreciated.


Edited by v81

R7 3800X - 32Gig RAM -- All SSD -- GTX1070 -- TM Warthog, MFG Crosswinds & TiR

Link to comment
Share on other sites

I've hit my next roadblock.

{down = iCommandPlaneAHCPHUDModeDayNight, 								name = _('HUD Mode switch Day/Night'), category = _('Armament HUD Control Panel')},

Is there a way to have the mode as 'day' with button 'down' and 'night' with button up?

 

for example..

{down = iCommandPlaneAHCPHUDModeDay, up = iCommandPlaneAHCPHUDModeNight,name = _('HUD Mode switch Day/Night ON/OFF sw'), category = _('Armament HUD Control Panel')},

I made up the commands Day and Night separately, not sure this will work... is there a list of valid commands somewhere?


Edited by v81

R7 3800X - 32Gig RAM -- All SSD -- GTX1070 -- TM Warthog, MFG Crosswinds & TiR

Link to comment
Share on other sites

If there is only a toggle, you could do something like this:

 

{down = iCommandPlaneAHCPHUDModeDayNight, up = iCommandPlaneAHCPHUDModeDayNight,name = _('HUD Mode switch Day/Night ON/OFF sw'), category = _('Armament HUD Control Panel')},

 

This will toggle between day and night when you flick the switch.

Only drawback is that the state can be reversed based on the position of the switch when you enter your plane.

Dutch Flanker Display Team | LLTM 2010 Tiger Spirit Award
Link to comment
Share on other sites

@Joe Kurr: your statement "Only drawback is that the state can be reversed based on the position of the switch when you enter your plane." is very true. That's why I don't use that method any more.

In some cases ED provides two separate commands for pushbuttons and then it's very simple to combine the two commands into one. Example:

{down = iCommandPlaneLGPLandLight, up = iCommandPlaneLGPLightsOff, name = _('Landing Lights 2-Pos ON/OFF'), category = _('Landing gear panel')},

Similarly, 3 commands can be combined into 2 commands for use with a maintained 3-position switch, like the Weapon Master switch.

 

Where that's not the case, I try to find the corresponding clickable cockpit command in the file "clickabledata.lua and use that information to create a new command in "default.lua".

@v81:

Here are two commands I created this way for the AHCP. The 2nd one is what you asked for on AUG-18 (HUD DAY/NIGHT Mode):

{down = 3004, up = 3004, cockpit_device_id = 7 , value_down = 1.0, value_up = -1.0, name = _('TGP switch 2-Pos ON/OFF'), category = _('Armament HUD Control Panel')},
{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')},

This method has a limitation I just dicovered on the A-10C. Let me describe:

I have already bound all ON/OFF switches on my DSD button box. Switch 1 is bound to "AHCP Master Arm". So I bound the new command "AHCP HUD Mode Day/Night" to Shift & Switch 1. Now when both cockpit switches are ON (up position in the cockpit) and I switch HUD Mode from Day to NIGHT, Master ARM will go SAFE at the same time. When I use Ctrl instead of Shift, the same thing happens.In my opinion that looks like a bug, but I won't even bother to ask for a fix since it only affects my hack.


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

  • 3 weeks later...

Can anyone help me with some sample code to get me started? I've read a lot of tutorials and watched a few videos, but I keep striking out with tweaking the LUA code.

 

I'd like to add additional switches from the clickable cockpit lua for these functions that are missing in the default A-10C keybinds:

 

Add Emergency Flood Off

Add APU Gen Power Off/Reset

Add AC Gen Power off Left

Add AC Gen Power off Right

Add Battery power off

 

These switches only exist as On switches right now, but I'd like to be able to discreetly map them to an Off state as well.

 

thanks for helping!

Link to comment
Share on other sites

@epolta:

The original commands are ON/OFF toggles for use with push buttons. Eachtime you push the button the command toggles from ON to OFF or OFF to ON.

The following additions to "default.lua" provide 2-position ON/OFF commands for maintained ON/OFF switches:

{down = 3007, up = 3007, cockpit_device_id = 49 , value_down = 1.0, value_up = 0.0, name = _('Emergency Flood Light 2-Pos DAY/NIGHT'), category = _('Electrical power control panel')},
{down = 3001, up = 3001, cockpit_device_id = 1 , value_down = 1.0, value_up = 0.0, name = _('APU Gen Power 2-Pos ON/OFF'), category = _('Electrical power control panel')},
{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')},
{down = 3006, up = 3006, cockpit_device_id = 1 , value_down = 1.0, value_up = 0.0, name = _('Battery Power 2-Pos ON/OFF'), category = _('Electrical power control panel')},

If you want to use a pair of push buttons for each of these commands then you have to split the command lines. Example for emergency flood light:

{down = 3007, cockpit_device_id = 49 , value_down = 1.0, name = _('Emergency Flood Light DAY'), category = _('Electrical power control panel')},
{down = 3007, cockpit_device_id = 49 , value_down = 0.0, name = _('Emergency Flood Light NIGHT'), category = _('Electrical power control panel')},

In the A-10C we need to use the numerical ID's for device and command. The cockpit_device_id number is found in the file "devices.lua".

The command ID is the button number from "clickabledata.lua plus 3000 (as found in "command_defs.lua")

Good luck!


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

  • Recently Browsing   1 member

×
×
  • Create New...