Jump to content

Input configuration mod


Recommended Posts

This is a mod which allows for the input files to configure up/down commands for DCS version 1.2.10. This can be used to configure a switch to toggle the lights on the Huey, which I'll use as an example.

 

When configuring a button in the options dialog, this will be saved into your Saved Games\DCS\Config\Input\UH-1H\joystick\<Throttle>.diff.lua:

 

		["d3002pnilunilcd7vd-1vpnilvunil"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN14",
			},
		},
		["name"] = "Nav Lights Flash",
	},

 

"d3002pnilunilcd7vd-1vpnilvunil" is what DCS considers to be the configured command to turn on the nav lights, it should be read like this:

 

d 3002 (down)

p nil (pressed)

u nil (up)

cd 7 (cockpit_device_id)

vd -1 (value_down)

vp nil (value_pressed)

vu nil (value_up)

 

These values map directly to the old input profiles, but to change them a modified Data.lua is required.

 

So to make this work as a switch, you add 3002 to the up-command and set value_up to 0

 

Which results in this command:

 

		["d3002pnilu3002cd7vd-1vpnilvu0"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN14",
			},
		},
		["name"] = "Nav Lights Flash (switch)",
	},

 

The attached file only works for version 1.2.10. It should be put in Scripts\Input\Data.lua for this to work.

 

 

I've made a tool for applying this mod and won't be maintaining the Data.lua-file for future DCS versions.

Data.lua


Edited by karls
new version
Link to comment
Share on other sites

  • 2 weeks later...

Thanks for this method Karlas .

you seem it know abit a the new input structure, i wonder if you could help with a question i have?

I used to use these lines

 

{combos = {{key = "TRACKIR_YAW", reformers = {"JOY_BTN4", "JOY_BTN3", }, filter = {saturationX = 1, saturationY = 0.05, deadzone = 0, invert = false, slider = false, curvature = {0}}}, }, action = iCommandPlaneViewHorizontal, name = "Camera Horizontal View"},
{combos = {{key = "TRACKIR_PITCH", reformers = {"JOY_BTN4", "JOY_BTN3", }, filter = {saturationX = 1, saturationY = 0.05, deadzone = 0, invert = false, slider = false, curvature = {0}}}, }, action = iCommandPlaneViewVertical, name = "Camera Vertical View"},

in my track IR input file so I could use trakir (with a modifier button) to look around in the extrenal views and Combined arms units without taking my hands of the stick.

 

I can no long get this to work in 1.2.8 any ideas how it might look in the new system?

Mods I use: KA-50 JTAC - Better Fire and Smoke - Unchain Rudder from trim KA50 - Sim FFB for G940 - Beczl Rocket Pods Updated!

Processor: Intel Q6600 @ 3.00GHz

GPU: GeForce MSI RTX 2060 6GB

RAM: Crucial 8GB DDR2

HDD: 1TBGB Crucial SSD

OS: Windows 10, 64-bit

Peripherals: Logitech G940 Hotas, TrackiR 5, Voice Activated commands , Sharkoon 5.1 headset. ,Touch Control for iPad, JoyToKey

Link to comment
Share on other sites

  • 2 months later...
Thanks for this method Karlas .

you seem it know abit a the new input structure, i wonder if you could help with a question i have?

I used to use these lines

 

{combos = {{key = "TRACKIR_YAW", reformers = {"JOY_BTN4", "JOY_BTN3", }, filter = {saturationX = 1, saturationY = 0.05, deadzone = 0, invert = false, slider = false, curvature = {0}}}, }, action = iCommandPlaneViewHorizontal, name = "Camera Horizontal View"},
{combos = {{key = "TRACKIR_PITCH", reformers = {"JOY_BTN4", "JOY_BTN3", }, filter = {saturationX = 1, saturationY = 0.05, deadzone = 0, invert = false, slider = false, curvature = {0}}}, }, action = iCommandPlaneViewVertical, name = "Camera Vertical View"},

in my track IR input file so I could use trakir (with a modifier button) to look around in the extrenal views and Combined arms units without taking my hands of the stick.

 

I can no long get this to work in 1.2.8 any ideas how it might look in the new system?

 

Sorry for the late reply. Maybe they changed something in 1.2.9 but when I tested this it seemed to work right away from the options dialog and saved this in the diff-file:

 

		["a2010cdnil"] = {
		["added"] = {
			[1] = {
				["key"] = "TRACKIR_YAW",
				["reformers"] = {
					[1] = "LCtrl",
				},
			},
		},
		["name"] = "Absolute Camera Horizontal View",
		["removed"] = {
			[1] = {
				["key"] = "TRACKIR_YAW",
			},
		},
	},

Link to comment
Share on other sites

Just wanted to say thank you for this mod -- absolutely fantastic piece of work. I remember about 2 years ago trying to figure out how this up/down stuff all worked, and it was frustrating to say the least. Your script and explanation has now automated 90% of the headache of getting switches like this working!

Link to comment
Share on other sites

So... I'm redownloading/installing the P-51. I managed to royally screw up my configs while attempting to force-feed old .lua files into the new system (as mentioned somewhere in another thread, placing it into mods/aircraft/p-51d/input/p-51d/joystick). Deleting the config file under user/saved games/dcs won't give me a "Default" .diff file anymore. Loading ".lua" does absolutely nothing. I'll likely be giving DCS a full on fresh install tomorrow but I'm hoping to get a jump on things so I can hit the ground running.

 

So while I wait I have a couple questions. First I want to verify, the data.lua goes into the main DCS directory?

C:\program files\windows\eagle dynamics\dcs world\scripts\input
This is my first attempt at altering anything within DCS beyond the options menu. I wanted to learn the aircraft before screwing things up :) I've got some experience with a form of Regex so I'm gradually understanding these...

 

What I'm attempting to do here is use the "Right Flow" switch as fuel shut-off valve.

 

I changed the first "up-nil" to "Up-3003". My "value down" was "1", where as yours was -1. I left mine as "1" because of that. Then I changed the final value-up from nil to 0. First is what I pulled after binding the switch under options. Second is my attempt at editing.

 

["d3003pnilunilcd9vd1vpnilvunil"] = {
   ["added"] = {
       [1] = {
           ["key"] = "JOY_BTN17",
       },
   },
   ["name"] = "Fuel shut-off valve",
},

["d3003pnilu3003cd9vd1vpnilvu0"] = {
   ["added"] = {
       [1] = {
           ["key"] = "JOY_BTN17",
       },
   },
   ["name"] = "Fuel shut-off valve",
},

Also, your final results was Nav Lights Flash (Switch). Do I need to add that to mine as well?

 

Edit: Testing.

After some testing, changing between value-down 1 or -1 didn't make a difference. If the switch was out of sync, it stayed out of sync. It never force-sync'd to my hardware. It did maintain a nice 1-1 ratio tho, instead of having to down-up to flip the switches back and forth.

 

Edit #2: More testing.

So I added (switch) into the name, then tested with 1 and -1. Neither case forced a sync. It simply moved when the switch was flipped. This is still better than only activating when switch is 'flipped on'. Not quite satisfied tho.


Edited by Siq6Six
Link to comment
Share on other sites

So while I wait I have a couple questions. First I want to verify, the data.lua goes into the main DCS directory?

 

That's correct, sounds like you figured it out already

 

Also, your final results was Nav Lights Flash (Switch). Do I need to add that to mine as well?

 

The names don't matter, I only change them so that I won't confuse them with the ordinary controls in the configuration window.

 

I changed the first "up-nil" to "Up-3003". My "value down" was "1", where as yours was -1. I left mine as "1" because of that. Then I changed the final value-up from nil to 0. First is what I pulled after binding the switch under options. Second is my attempt at editing.

 

You've got the process figured out. But the fuel shut-off valve is a little tricky because it doesn't appear to use the value given to the command. It's generally easier with commands that have a state, I don't believe it's possible to bind everything either because of such limitations without digging deeper into the files.

 

There is another command for the fuel shut-off valve as well, you can try this:

 

		["d3005pnilu3005cd9vd1vpnilvu0"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN16",
			},
		},
		["name"] = "Fuel shut-off valve (switch)",
	},

 

I found this command in the Macro_sequencies.lua , startup and shutdown sequencies don't always work with the ordinary commands either so you can find some goodies there. I haven't found a complete list of available commands yet, I assume they're hidden within binary files. I'd love to hear if anyone knows about such a list.

Link to comment
Share on other sites

There is another command for the fuel shut-off valve as well, you can try this:

 

        ["d3005pnilu3005cd9vd1vpnilvu0"] = {
           ["added"] = {
               [1] = {
                   ["key"] = "JOY_BTN16",
               },
           },
           ["name"] = "Fuel shut-off valve (switch)",
       },

I found this command in the Macro_sequencies.lua , startup and shutdown sequencies don't always work with the ordinary commands either so you can find some goodies there. I haven't found a complete list of available commands yet, I assume they're hidden within binary files. I'd love to hear if anyone knows about such a list.

 

Thank you for your response. I was figuring things out last night. Got my multi-switch/rotaries to work as intended with one exception. The gun/camera on switch cycles thru instead of going between the off/both on states I wrote into the file.

 

Your suggestion worked. I changed the 3003 to 3005 for the fuel-shutoff valve. It doesn't force sync the cockpit, but it doesn't move the lever unless it is in sync. Basically I have been testing by toggle switch-on, hopping into a cold start mission and checking. Now I can toggle-off, then back to on to activate the ingame lever. It stays in sync after that which is beautiful.

 

I also changed the fuel booster switch (I believe it was 3008 ) to 3005. Its working in sync now as well

 

So next I tried that with gun gyro motor On/Off, which I bound to RDR ALTM switch. That was 3008, and i changed it to 3005. It actually changed the cockpit switch. When flipping the toggle it turned the brightness from full on-full off. I found that odd...

 

I thought the 3000-numbers was the games way to defining what button was pressed on our joystick, but after this it seems its the type of press/activation. So where 3003 is a simple 'toggle', 3005 is 'toggle-state'. If that's true, then maybe the gun-gyro motor and the brightness knobs are tied to the same device-id, changing the 'press type' is how they define on off/level of brightness...

 

Edit: Just adding in that I deleted the gun-gyro setting in the .lua file, went into options and bound it to AutoPilot engage button. Good enough.


Edited by Siq6Six
Link to comment
Share on other sites

Fixed the Gun /Camera switch. Must had been tired last night when setting the bindings.

 

It was:

        
["d3016pnilu3016cd13vd1vpnilvu0"] = {
           ["added"] = {
               [1] = {
                   ["key"] = "JOY_BTN24",
               },
           },
           ["name"] = "Gun safety switch (rotary)",
       },

I tried different goto states... 0.1 0.2. Didn't work. Once I revisited the options menu and saw I bound to Rotary (as if the code wasn't clue enough) and not the actual function, I deleted the above from the script and re-bound. Did necessary edits and got this:

 

                
["d3007pnilu3007cd13vd1vpnilvu0"] = {
["added"] = {
[1] = {
["key"] = "JOY_BTN24",
},
},
["name"] = "Gun safety switch GUN CAMERA SIGHT",
},[/Code]

Now comparing the differences, I'm coming to a stronger conclusion that the 30xx numbers are the 'button press type', or function. The Cockpit ID is 13 in both situations (interestingly, the CD inside the clickabledata.lua is 12 while 13 is the chemical release/left|right bomb arm switches). 3007 'toggle up' position. 3016 rotate/cycle

Link to comment
Share on other sites

I'm not sure if there's a specific pattern for the 30xx numbers, I think it's just id's to bind to specific functions on the device.

 

elements["pnt_69_1"] = default_1_position_tumb(_("Left Chemical Release"),devices.FRONT_SWITCH_BOX, device_commands.Button_13, 69, 1, {1,1})

 

That line for example would bind left chemical release to device FRONT_SWITCH_BOX (cd 13, according to devices.lua) and Button_13 which has an id of 3013 (buttons are always 3000 + button number). I tend to think of "Button_X" more like "Function_X" though, makes more sense to me.

 

I didn't bind much but here are flaps and lights in case you find something interesting:

 

		["d3001pnilu3001cd12vd0vpnilvu0.5"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN23",
			},
		},
		["name"] = "Flaps down",
	},
	["d3001pnilu3001cd12vd1vpnilvu0.5"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN22",
			},
		},
		["name"] = "Flaps up",
	},
	["d3007pnilu3007cd10vd1vpnilvu0"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN24",
			},
		},
		["name"] = "Landing light (switch)",
	},
	["d3015pnilu3015cd14vd-1vpnilvu0"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN13",
			},
		},
		["name"] = "Wing position lights dim",
	},
	["d3015pnilu3015cd14vd1vpnilvu0"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN14",
			},
		},
		["name"] = "Wing position lights bright",
	},
	["d3016pnilu3016cd14vd-1vpnilvu0"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN25",
			},
		},
		["name"] = "Tail position lights bright",
	},

Link to comment
Share on other sites

  • 3 months later...
Hello Karls thank you very much for your work in this area. I've downloaded the DCS modding tool you made but it keeps crashing for me on win7.

 

Also what does it do? Does it alter my Data.lua to allow for up/down events.

 

Any help would be much appreciated :)

 

It's correct that it alters Data.lua to allow for up/down events, it replaces a few lines from the original file.

 

The problem might be that the .NET framework isn't installed, sorry just realized I should have specified it was made for .NET 4.5. It can be downloaded here if that's the case: http://www.microsoft.com/en-us/download/details.aspx?id=42643

 

If it's something else, you can send me a crash log from the event viewer in windows and I'll have a look at what the trouble might be.

  • Like 1
Link to comment
Share on other sites

Hello, back again, I've got a problem with this mod and the Mig21bis module.

 

When I use the tool to mod my data.lua the throttle axis in the Mig21 ends up bugged.

I go into the options GUI and setup the Mig21 thrust axis to the Z axis on my WH throttle and clear all the other devices for that axis but then when I enter the game all my devices have their Z axis bound to thrust.

 

In game I can clear the axes that are incorrectly assigned and that stays until I restart the mission.

 

When I repair DCS assigning thrust in the Mig21 works as expected and after I mod data.lua it goes bugged again.

 

Any help would be appreciated:)

Link to comment
Share on other sites

Hello, back again, I've got a problem with this mod and the Mig21bis module.

 

When I use the tool to mod my data.lua the throttle axis in the Mig21 ends up bugged.

I go into the options GUI and setup the Mig21 thrust axis to the Z axis on my WH throttle and clear all the other devices for that axis but then when I enter the game all my devices have their Z axis bound to thrust.

 

In game I can clear the axes that are incorrectly assigned and that stays until I restart the mission.

 

When I repair DCS assigning thrust in the Mig21 works as expected and after I mod data.lua it goes bugged again.

 

Any help would be appreciated:)

 

I didn't notice this issue until now, thanks for the notification. It appears the Mig21 has bound thrust by default to both JOY_SLIDER1 and JOY_Z, unfortunately causing diffs to be applied to JOY_SLIDER1 and the game using JOY_Z as the command of choice.

 

I've updated the mod to handle this now, might've overlooked something else as well though. Gonna test some more in the weekend.

 

Download link here (unpatch old mod before putting this in)

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
Default Data.lua functions was changed so the mod has been updated for that now.

 

Hi Karls,

 

I'm struggling to make my 2 and 3 ways switches to work again since v1214 broke everything up.

Even, applying the new syntax to the Default.lua file doesn't seem to do the trick anymore. I was used to use a modified version of this file but since 1212, it's no longer possible.

 

I would like to use your mod and I tried it but without success.

I only have two panels (Elec. Power & AHCP) for the A-10C interfaced to DCSW through a GP-WIZ.

Before, I tried to understand the new structure found for the GP-WiZ.diff.lua stored in C:\users\user name\saved game\input\A-10C real\GP-WIZ... I tried to mess around with it for a 2- way switch with no avail again. That's why I'd like to give a try to your mod.

 

Could you please clarify where to install your mod and how to do so with JSGME and if it shall be unzipped ?

 

Many thanks in advance

 

Laurius

 

EDIT : I forgot to ask where I could find the cockpit device ID ?


Edited by Laurius
forgot to ask something

Asus P8Z68 Deluxe, Intel Core i7-2600K (3.4 GHz), Corsair Vengeance 2x4096 Mo DDR3 1866 MHz, SSD 120 Go Vertex 2, EVGA GeForce GTX 970 FTW ACX 2.0 4Go (04G-P4-2978-KR), TM HOTAS Warthog #03797 (MB replaced), Saitek Combat Pro Rudder, TrackIR 5, TM Cougar MFDs with Lilliput 8" UM 80

Link to comment
Share on other sites

Hi Karls,

 

I'm struggling to make my 2 and 3 ways switches to work again since v1214 broke everything up.

Even, applying the new syntax to the Default.lua file doesn't seem to do the trick anymore. I was used to use a modified version of this file but since 1212, it's no longer possible.

 

I would like to use your mod and I tried it but without success.

I only have two panels (Elec. Power & AHCP) for the A-10C interfaced to DCSW through a GP-WIZ.

Before, I tried to understand the new structure found for the GP-WiZ.diff.lua stored in C:\users\user name\saved game\input\A-10C real\GP-WIZ... I tried to mess around with it for a 2- way switch with no avail again. That's why I'd like to give a try to your mod.

 

Could you please clarify where to install your mod and how to do so with JSGME and if it shall be unzipped ?

 

Many thanks in advance

 

Laurius

 

EDIT : I forgot to ask where I could find the cockpit device ID ?

 

Hi,

To install the mod you run the program inside the zip after unpacking the whole zip file into a folder (unfortunately it doesn't work with JSGME). It'll ask you where the DCS folder is and then you then you can hit the "Patch All" button to apply the mod.

 

For device id's you can look inside DCS folder \Mods\aircraft\A-10C\Cockpit\Scripts\devices.lua and you'll find id 1 and 7. Generally it's easy enough to just set a standard binding from within the game to the button you like and then open the diff-file to add an up-value for it, no need to look up id's then.

 

devices["ELEC_INTERFACE"] = counter()--1

devices["AHCP"] = counter()--7

Link to comment
Share on other sites

Hi Karls,

 

Thanks a lot for your answer. I still have some questions before using your mod.

 

Hi,

To install the mod you run the program inside the zip after unpacking the whole zip file into a folder (unfortunately it doesn't work with JSGME). It'll ask you where the DCS folder is and then you then you can hit the "Patch All" button to apply the mod.

 

Should I run the app and "patch all" all buttons before or after configuring the switches in the Control options ?

 

... Generally it's easy enough to just set a standard binding from within the game to the button you like and then open the diff-file to add an up-value for it, no need to look up id's then.

...

 

That's what I tried for the Battery Power switch. What would be the up value for this switch ? I tried vu0, vu1, but with no luck. I suppose it's due to the new Data.lua but I'm probably wrong.

 

Anyway, thanks again.

 

Laurius

Asus P8Z68 Deluxe, Intel Core i7-2600K (3.4 GHz), Corsair Vengeance 2x4096 Mo DDR3 1866 MHz, SSD 120 Go Vertex 2, EVGA GeForce GTX 970 FTW ACX 2.0 4Go (04G-P4-2978-KR), TM HOTAS Warthog #03797 (MB replaced), Saitek Combat Pro Rudder, TrackIR 5, TM Cougar MFDs with Lilliput 8" UM 80

Link to comment
Share on other sites

Should I run the app and "patch all" all buttons before or after configuring the switches in the Control options ?

 

It's only required when there are diff-entries that don't have a predefined command, so once you start editing the files manually.

 

That's what I tried for the Battery Power switch. What would be the up value for this switch ? I tried vu0, vu1, but with no luck. I suppose it's due to the new Data.lua but I'm probably wrong.

 

The battery didn't use a switchable command from the GUI so that one is trickier. Macro_sequencies.lua and clickabledata.lua are good for figuring out those.

 

To make a switch for the battery you can try this:

 

		["d3006pnilu3006cd1vd1vpnilvu0"] = {
		["added"] = {
			[1] = {
				["key"] = "JOY_BTN1",
			},
		},
		["name"] = "Battery power (switch)",
	},

Link to comment
Share on other sites

Wooohoooo !!

 

Hi Karls and everyone !

 

I could manage to get my 2 and 3 positions switches working again thanks to Karls's mod !

This was far from being obvious but after some "tries and fails", I did it !

Apparently, you have to FIRST configure your switches in order to create the diff.lua file associated with the device interfacing your panels (in my case Elec. Power and AHC panels).

Then run the App. contained in Karls's mod after unzipping it.

After that, you'll still have to tweak the corresponding diff.lua.

What's weird is that after doing so, the corresponding functions associated to the said panels are no longer seen in the controls/options menu !!

There are some differences compared to Karls advices, especially, no need to assign a number to "cd" or "vd".

For those who are still struggling with the issue of using 2-3 positions switches, I want to share the diff.lua file associated to my GP-WIZ controller for the Electrical power and AHC panels, hopping this might help.

 

Many thanks Karls for your mod !!

 

Cheers

 

Laurius

GP-Wiz40 {0C52A6E0-5447-11e1-8001-444553540000}.diff.lua

Asus P8Z68 Deluxe, Intel Core i7-2600K (3.4 GHz), Corsair Vengeance 2x4096 Mo DDR3 1866 MHz, SSD 120 Go Vertex 2, EVGA GeForce GTX 970 FTW ACX 2.0 4Go (04G-P4-2978-KR), TM HOTAS Warthog #03797 (MB replaced), Saitek Combat Pro Rudder, TrackIR 5, TM Cougar MFDs with Lilliput 8" UM 80

Link to comment
Share on other sites

  • 8 months later...
I've made an update for 1.5 here, and a reminder: It's not for beta testing, remove before testing bugs in DCS World Open Beta since the mod itself isn't expected to be bug free. But if you find any issues with the mod itself, please post here and I'll have a look at it.

It's good to see you are still involved in this old friend, maybe we will fly a mission again sometime.

Cheers

Link to comment
Share on other sites

  • Recently Browsing   0 members

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