Jump to content

Quaggles - DCS Input Command Injector Mod - Store custom input commands safely in Saved Games instead of merging them with developer changes each update


Quaggles

Recommended Posts

  • 2 weeks later...
On 11/7/2021 at 11:08 AM, Munkwolf said:

Thanks @jonsky7!

When checking into the ones you did, I noticed a few more. Also I used IT-23 in place of SHKVAL for the brightness and contrast knobs. Those are now added to github.

Also, sometimes adding an axis can be a bit funky depending on how the module is setup for it. Many times, the module command accepts a range of 0 - 1 values, but our input devices provide -1 to 1 values on an axis, thus them only working for half the range by default. That can usually be fixed up with axis tuning and curves in DCS.

https://github.com/Munkwolf/dcs-community-keybinds/blob/main/InputCommands/Ka-50/Input/ka-50/joystick/default.lua

{cockpit_device_id = 9, action = 3008, name = _('ABRIS Brightness')},
{cockpit_device_id = 7, action = 3001, name = _('HUD Brightness')},
{cockpit_device_id = 7, action = 3002, name = _('HUD Modes Reticle/Night/Day')},
{cockpit_device_id = 20, action = 3029, name = _('PVI Lighting')},

{cockpit_device_id = 8, action = 3002, name = _('IT-23 display brightness')},
{cockpit_device_id = 8, action = 3003, name = _('IT-23 display contrast')},
{cockpit_device_id = 23, action = 3001, name = _('Helmet device brightness')},

{cockpit_device_id = 31, action = 3001, name = _('ADI Zero pitch trim')},
{cockpit_device_id = 51, action = 3006, name = _('Lighting auxiliary panel brightness knob')},
{cockpit_device_id = 51, action = 3008, name = _('Lighting night vision cockpit brightness knob')},
{cockpit_device_id = 51, action = 3002, name = _('Lighting cockpit panel brightness knob')},
{cockpit_device_id = 51, action = 3004, name = _('Lighting HSI and ADI brightness knob')},
{cockpit_device_id = 46, action = 3006, name = _('ADF Volume')},
{cockpit_device_id = 49, action = 3002, name = _('R-828 (VHF-1) Radio Volume')},

{cockpit_device_id = 20, action = 3026, name = _('NAV Master modes')},
{cockpit_device_id = 25, action = 3014, name = _('Datalink self ID')},
{cockpit_device_id = 25, action = 3015, name = _('Datalink Master mode')},

{cockpit_device_id = 12, action = 3007, name = _('Laser code selector')},
{cockpit_device_id = 8, action = 3005, name = _('SHKVAL Optics adjustment')},

{cockpit_device_id = 32, action = 3001, name = _('ATGM Temperature selector')},
{cockpit_device_id = 12, action = 3023, name = _('Unguided rocket and gun pods ballistics data settings selector')},
{cockpit_device_id = 32, action = 3003, name = _('Systems BIT selector')},

{cockpit_device_id = 12, action = 3014, name = _('Weapon system mode selector')},
{cockpit_device_id = 8, action = 3006, name = _('Shkval auto scan rate')},
{cockpit_device_id = 4, action = 3011, name = _('Rotor Brake')},

{cockpit_device_id = 50, action = 3002, name = _('SPU-9 Radio communicator selector')},
{cockpit_device_id = 49, action = 3001, name = _('R-828 (VHF-1) Radio channel selector')},

 

can you point me in direction on how to make an custom joystick axis? trying to understand this mod, and apply it to the Mi24 Kord door gunner.. appreciate any suggestions!

find me on steam! username: Hannibal_A101A

http://steamcommunity.com/profiles/76561197969447179

Link to comment
Share on other sites

11 hours ago, hannibal said:

can you point me in direction on how to make an custom joystick axis? trying to understand this mod, and apply it to the Mi24 Kord door gunner.. appreciate any suggestions!

I've gone in and attempted to get it working but it seems like even creating a custom joystick axis input command it won't show up in any of the joystick categories, I assume there is something that blocks gun up/down left/right so that it can only be bound to mouse even if you include it in joystick/default.lua. It might be possible to workaround with further modding of "DCS World\Scripts\Input\Data.lua" but I try to keep the mod so it has the least chance of breaking ED's input code, I follow their formats and just append extra input commands from a seperate path to be safe.

  • Like 2
Link to comment
Share on other sites

3 hours ago, Quaggles said:

I've gone in and attempted to get it working but it seems like even creating a custom joystick axis input command it won't show up in any of the joystick categories, I assume there is something that blocks gun up/down left/right so that it can only be bound to mouse even if you include it in joystick/default.lua. It might be possible to workaround with further modding of "DCS World\Scripts\Input\Data.lua" but I try to keep the mod so it has the least chance of breaking ED's input code, I follow their formats and just append extra input commands from a seperate path to be safe.

Owe wow. Thanks for taking a look. I had tried antimicroX joystick mapping app, and also I tried to copy what was from the mouse.lua and apply it to joystick.lua, I was able to map a joystick, but the input behavior was un-usable, aside from being center, either the Kord gun swings maximum left or right , up down.. there was no controllable joystick response in between.

The mouse works in relative, instead of absolute coordinates..in some manner like that..

I'll take a look at data.lua, though this whole quaggles injector thing is new to me.. 🤯

Many thanks!


Edited by hannibal

find me on steam! username: Hannibal_A101A

http://steamcommunity.com/profiles/76561197969447179

Link to comment
Share on other sites

@Quaggles

i see some containers or pointers in the command_defs.lua

    Gunner_SIGHT_UP_DOWN_AXIS 
    Gunner_SIGHT_LEFT_RIGHT_AXIS

but cant make heads or tails for the data.lua. 

btw, in the default.lua of C:\Program Files\Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\Mi-24P\Input\Mi-24P_Gunner\joystick

i noticed that it didnt have the syntax declared

local cockpit = folder.."../../../Cockpit/Scripts/"
dofile(cockpit.."devices.lua")
dofile(cockpit.."command_defs.lua")

in which the  Mods\aircraft\Mi-24P\Input\Mi-24P_Gunner\mouse\default.lua had...

not sure if these calls go to some function that allows something...lol

find me on steam! username: Hannibal_A101A

http://steamcommunity.com/profiles/76561197969447179

Link to comment
Share on other sites

  • 1 month later...

Version 1.0.8 released: https://github.com/Quaggles/dcs-input-command-injector/releases/tag/1.0.8

* More defensive handling of table joins when the original keyCommands/axisCommands table is nil. Now if the original table is nil instead of being joined with the injected table it is overridden by the injected table.

* Processing of axisCommands tables are now skipped for the "Keyboard" device, this prevents axis binds from showing up in that column since keyboards don't have any axis. This also fixes issue #5 that occured when an injected keyboard/default.lua contained an axisCommands table.

* Logging now includes the device name that triggered the injection

* Paths and device names are now wrapped in quotes in log messages

  • Like 2
  • Thanks 3
Link to comment
Share on other sites

  • Quaggles changed the title to Quaggles - DCS Input Command Injector Mod v1.0.8 - Store custom input commands safely in Saved Games instead of merging them with developer changes each update
  • 2 weeks later...

hi im trying to add custom commands directly into the dcs default lua (i dont mind addind it back in every update) what im struggling with is how to add on else off into the control. (its for wing and tail position lights on the f14) i added , else off,  into the line and thats what it shows in controls ingame but when i bind it it just behaves as normal so does switch off when i release the switch, iv tried addind down =1 up = 0 aswell and no joy, what do i actually need to do?

7700k @5ghz, 32gb 3200mhz ram, 2080ti, nvme drives, valve index vr

Link to comment
Share on other sites

16 hours ago, eatthis said:

hi im trying to add custom commands directly into the dcs default lua (i dont mind addind it back in every update) what im struggling with is how to add on else off into the control. (its for wing and tail position lights on the f14) i added , else off,  into the line and thats what it shows in controls ingame but when i bind it it just behaves as normal so does switch off when i release the switch, iv tried addind down =1 up = 0 aswell and no joy, what do i actually need to do?

Maybe try copying the ones from Mulkwolf's community keybinds repo, it looks like he's already written on else off commands for the lights: https://github.com/Munkwolf/dcs-community-keybinds/blob/main/InputCommands/F14/Input/F-14B-Pilot/joystick/default.lua#L282

  • Like 1
Link to comment
Share on other sites

  • Quaggles changed the title to Quaggles - DCS Input Command Injector Mod v1.0.9 - Store custom input commands safely in Saved Games instead of merging them with developer changes each update
  • 1 month later...

Can't seem to get this to work with the F-15E.  I think I got the structure correct, but commands not showing.

f1.jpg

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

Link to comment
Share on other sites

In JoyPro you mean?  Yep, me too. I can't get JP to do the CleanDB as it comes up with an error so I am also getting default binds creeping into the F-15.

Re Quaggles mod, I've got it working now. The structure for F-15 was different in different locations.

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

Link to comment
Share on other sites

  • 2 weeks later...

I'm moving to use the input injector and my first module was the A-10C II. I want to just migrate the custom bindings I created over time to the Injector format rather than adopting the huge files Munkwolf laudably produced. My collection includes some axis commands, so I added these lines:


	axisCommands = {
-- Enter axis commands here	
{action = 3001, cockpit_device_id = 49, name = _('Engine Instruments Lights Axis')},
{action = 3002, cockpit_device_id = 49, name = _('Flight Instruments Lights Axis')},
{action = 3003, cockpit_device_id = 49, name = _('Auxiliary Instruments Lights Axis')},
{action = 3005, cockpit_device_id = 49, name = _('Flood Light Axis')},
{action = 3006, cockpit_device_id = 49, name = _('Console Light Axis')},
{action = 3011, cockpit_device_id = 54, name = _('UHF Radio Volume Axis')},
{action = 3005, cockpit_device_id = 55, name = _('VHF AM Radio Volume Axis')},
{action = 3005, cockpit_device_id = 56, name = _('VHF FM Radio Volume Axis')},
{action = 3013, cockpit_device_id = 38, name = _('Yaw Trim Knob Axis')},	
	}

and, following Munkwolf's structure, added a comma to the line above so it looked like this:

	},

With this, my added key commands all worked; but several joystick commands showed red warnings in Options/Controls and they were not functional. When I removed the comma the problem was gone.

So my question is: If I want to add an axis section, should the key section be terminated wih a comma?

  • Like 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

3 hours ago, LeCuvier said:

So my question is: If I want to add an axis section, should the key section be terminated wih a comma?

Welcome to the cult of quaggles @LeCuvier! 🙂

That is correct, if adding an axis section then the key section should have a comma after it (main structure is an object of objects). Blank structure for keys plus axis should look like:

return {
	keyCommands = {
		
	},
	axisCommands = {
		
	}
}

Do you have the return in your file? Returning the whole object of objects is a key difference of how quaggles command injector files are formatted vs the stock lua files. Also you probably saw it but in case not, there is the blank InputCommands in Quaggles mod, which is the InputCommands_Skeleton from the community keybinds - both have all the folders setup with blank lua files for all modules.

also, if you have any issues with the binds loading, there is often a log entry added to dcs.log, search for 'inputcommand' in the log and it'll oftentimes point you in the right direction.

  • Like 1
Link to comment
Share on other sites

I am trying to clone just part of your repo, the InputCommands folder, into my SavedGames/DCSopenbeta folder. I am using gitkraken but it seems not to allow this

https://github.com/Munkwolf/dcs-community-keybinds/InputCommands.git

I get a 'clone failed' error Access Denied. I CAN clone the whole repo

https://github.com/Munkwolf/dcs-community-keybinds.git

but then I have to manually move the inputCommands folder out of the repo to the root of the DCSopenbeta folder

The reason for doing this is so I can easily update the repo without these manual steps.


Edited by skypickle

4930K @ 4.5, 32g ram, TitanPascal

Link to comment
Share on other sites

Yes I used the skeleton format you show. And I got several blocked joystick commands. And after I removed the comma the problem went away. The funny thing is, when I use your "default.lua" (A-10C II, joystick), I don't get the problem. I will have to do more testing later. It's a nightmare right now as I cannot connect to the authorization server and every game load takes forever.

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

@Munkwolf: I re-created the file adding blocks of lines and testing step by step.
Now got it working with the comma. I suspect that one line was problematic and I left it out.


Please allow an off-topic question: am I the only one not able to get authorization?
I also find that I cannot open http://www.digitalcombatsimulator.com although I have good internet access.

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

PSA: There are changes to one of the core files that the input injector modifies in DCS 2.9 (DCS World\Scripts\Input\Data.lua), I suspect enabling the mod in 2.9 will break certain aspects of the game so I recommend keeping it disabled until I can update it for the new version hopefully tomorrow. 

  • Thanks 5
Link to comment
Share on other sites

Thanks a lot for the update!

  • Like 2

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

Link to comment
Share on other sites

@MalakhitThanks for taking a shot at it, I've had a look at the local variable issue and it looks like in DCS 2.9 ED uses the entire 200 local variable limit in Data.lua haha, they have no room to expand without refactoring some things

Fortunately the inject function is only called from one place so I can put the QuagglesInputCommandInjector function locally inside the loadDeviceProfileFromFile function and it's scoped in a way that doesn't hit the 200 local var limit without having to hardcode everything or make the function global.

Version 1.0.10 released: https://github.com/Quaggles/dcs-input-command-injector/releases/tag/1.0.10

* Updated mod to be compatible with DCS 2.9.0.46801 Data.lua changes

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • Quaggles changed the title to Quaggles - DCS Input Command Injector Mod v1.0.10 - Store custom input commands safely in Saved Games instead of merging them with developer changes each update
4 minutes ago, Quaggles said:

@MalakhitThanks for taking a shot at it, I've had a look at the local variable issue and it looks like in DCS 2.9 ED uses the entire 200 local variable limit in Data.lua haha, they have no room to expand without refactoring some things

Any decent static code analysis tool would scream about this.

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Im sorry if this has been covered, but I am reading through all of this trying to find out how to add a Custom command in the Apache to allow the back seater to hit the “Slave button” Im not a Coder, how can I add this function to my current Custom Options? I have Monkwolf’s Input file installed.

 

I have this:

image.png

Im looking to add this to the Custom List:

image.png

Thank you for any help

Windows 10 Pro - 64 Bit / ASUS ROG Strix B650E-F Gaming / AMD 7800X3D / G.Skill Trident Z5 NEO 64GB DDR5 6000 Ram / SSD M.2 SK hynix Platinum P41 2TB / MSI Gaming GeForce RTX 4090 SUPRIM Liquid X 24G / SteelSeries Arctis 7 Headset /LG-Ultragear 38" IPS LED Ultrawide HD Monitor (3840 x 1600) / Track IR4 / Thrustmaster TPR Pendular Rudder Pedals / Virpil HOTAS VPC Constellation ALPHA-R & VPC MongoosT-50CM3 Throttle

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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