Jump to content

I hate having to modify the default.lua joystick file after every update.


Recommended Posts

As the update says, I have to modify the default.lua file in "E:\Program Files\Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\FA-18C\Input\FA-18C\joystick" after it gets overwritten every update.

 

I want to add these lines:

{    down = iCommandPlaneGearUp,                            up = iCommandPlaneGearDown,                                                                                                            name = _('Landing Gear Control Handle - 2Pswitch'),                                category = {_('Special For Joystick'), _('Left Vertical Panel')}},
{    down = SMS_commands.MasterArmSw,        up = SMS_commands.MasterArmSw,        cockpit_device_id = devices.SMS,    value_down =  1.0,    value_up = 0.0,    name = _('Master Arm Switch - 2Pswitch'),    category = {_('Special For Joystick'), _('Master Arm Panel')}},
{    down = gear_commands.HookHandle,        up = gear_commands.HookHandle,        cockpit_device_id = devices.GEAR_INTERFACE,        value_down =  1.0,    value_up = 0.0,                            name = _('Arresting Hook Handle - 2P switch'),                            category = {_('Special For Joystick'),_('Right Vertical Panel')}},
{    down = hotas_commands.THROTTLE_EXTERIOR_LIGTHS_EXT,    up = hotas_commands.THROTTLE_EXTERIOR_LIGTHS_EXT,    cockpit_device_id = devices.HOTAS,    value_down =  1.0,    value_up = 0.0,            name = _('Exterior Lights Switch - 2Pswitch'),                category = {_('Special For Joystick'),_('Throttle Grip'), _('HOTAS')}},

Can I create a diff file in my saved games and how do I do that (actually it doesn't matter if it'll work or not, how do I create a diff.lua? everything on google is gobbledygook)?

 

EDIT:

Guys, mod managers are not the solution since the modded file will overwrite the latest official file and remove any official updates to the file.


Edited by 98abaile
Link to comment
Share on other sites

As the update says, I have to modify the default.lua file in "E:\Program Files\Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\FA-18C\Input\FA-18C\joystick" after it gets overwritten every update.

 

You should look into using a Mod Manager for this modifications, I use OvGME:

 

ygUqMXj.jpg

 

... and it makes it easy to disable all my Mods prior to a DCS update, and then re-enable them afterwards.

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

I think you're supposed to make modifications in the ''saved games'' user folder, specifically so they don't get overwritten. Anything you put in the main game directory will get blitzed every update.

 

As for the file just copy the one from the game directory to saved games and modify it there. You shouldn't have to change it again after that unless the change something in it.

Де вороги, знайдуться козаки їх перемогти.

5800x3d * 3090 * 64gb * Reverb G2

Link to comment
Share on other sites

You should look into using a Mod Manager for this modifications, I use OvGME:

 

image

 

... and it makes it easy to disable all my Mods prior to a DCS update, and then re-enable them afterwards.

The problem with that is that if they update the default file, you lose any of the new bindings when you put your modded one back.

 

I think you're supposed to make modifications in the ''saved games'' user folder, specifically so they don't get overwritten. Anything you put in the main game directory will get blitzed every update.

 

As for the file just copy the one from the game directory to saved games and modify it there. You shouldn't have to change it again after that unless the change something in it.

I've already tried that, it didn't work. I know it's supposed to, but it didn't.

Link to comment
Share on other sites

The problem with that is that if they update the default file, you lose any of the new bindings when you put your modded one back.

 

 

You are correct .. the Mod Managers manage whole files, they cant change just part of a file :(

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

The problem with that is that if they update the default file, you lose any of the new bindings when you put your modded one back.

 

 

I've already tried that, it didn't work. I know it's supposed to, but it didn't.

 

Ah. I've noticed on a few odds and ends it doesn't seem to take via the saved games stuff, but I'm not sure what the criteria is there.

Де вороги, знайдуться козаки їх перемогти.

5800x3d * 3090 * 64gb * Reverb G2

Link to comment
Share on other sites

You could write a simple batch script. This

 

echo { down = iCommandPlaneGearUp, up = iCommandPlaneGearDown, name = _('Landing Gear Control Handle - 2Pswitch'),category = {_('Special For Joystick'), _('Left Vertical Panel')}}, >> "E:\Program Files\Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\FA-18C\Input\FA-18C\joystick\default.lua"

 

should work. Simply appends each line to the file. Just have to duplicate that general idea for each line. Put that in a .bat file and run it. Might wanna make a backup and test it just in case.

i7 6700k @ 4.6, Gigabyte Z170X-UD3, 32GB DDR4 2666, GTX 1070, Rift S | MS Sidewinder FFB2 w/ TM F-22 Pro Grip, TM TWCS Throttle, VKB T-Rudder Mk. IV

Link to comment
Share on other sites

Why u are not just using RSMapper?

Works just fine.

 

The 4 lines he uses, are for adding new joystick commands to the game, I doubt that a simple mapper utility can do that.

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

Make it [the file] a mod for GME so before you update disable it then enable it after the update.

The only way to make sense out of change is to plunge into it, move with it, and join the dance.

"Me, the 13th Duke of Wybourne, here on the ED forums at 3 'o' clock in the morning, with my reputation. Are they mad.."

https://ko-fi.com/joey45

 

Link to comment
Share on other sites

I use OvGME and have 2 configurations. One config directs the bulk of my mods to the Saved Games folder; however some mods, like liveries, textures, and default key bindings must be directed to the main DCS folder, requiring a second configuration. This makes restoring my mods, post-updates, quite painless.

Link to comment
Share on other sites

You could write a simple batch script. This

 

echo { down = iCommandPlaneGearUp, up = iCommandPlaneGearDown, name = _('Landing Gear Control Handle - 2Pswitch'),category = {_('Special For Joystick'), _('Left Vertical Panel')}}, >> "E:\Program Files\Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\FA-18C\Input\FA-18C\joystick\default.lua"

should work. Simply appends each line to the file. Just have to duplicate that general idea for each line. Put that in a .bat file and run it. Might wanna make a backup and test it just in case.

It's a good idea, but it would put those lines outside of:

})

return res

at the end of the file.

Link to comment
Share on other sites

It's a good idea, but it would put those lines outside of:

})

return res

at the end of the file.

 

Oops.

 

Here's a one-liner powershell that does it. I don't have the hornet, but I tested it with the F-5 which uses the same format I think (}) return res at the bottom). It will add the lines from a text file (in this example MOD.txt) right before the }) return res portion:

 

(gc -raw default.lua) -replace "}\)\r\n\r\nreturn res", ("`r`n" + (gc -raw MOD.txt) + "`r`n})`r`n`r`nreturn res") | Out-File default.lua

 

You'll have to modify the above to include the full path for default.lua and MOD.txt. You might also have to change your PowerShell execution policy to allow local scripts to run:

 

https://superuser.com/questions/106360/how-to-enable-execution-of-powershell-scripts

 

edit: It's actually good you brought this up, because I had been using the ovgme solution without considering the case where the binds file gets updated! I'll be re-using this for myself as well.

i7 6700k @ 4.6, Gigabyte Z170X-UD3, 32GB DDR4 2666, GTX 1070, Rift S | MS Sidewinder FFB2 w/ TM F-22 Pro Grip, TM TWCS Throttle, VKB T-Rudder Mk. IV

Link to comment
Share on other sites

Oops.

 

Here's a one-liner powershell that does it. I don't have the hornet, but I tested it with the F-5 which uses the same format I think (}) return res at the bottom). It will add the lines from a text file (in this example MOD.txt) right before the }) return res portion:

 

(gc -raw default.lua) -replace "}\)\r\n\r\nreturn res", ("`r`n" + (gc -raw MOD.txt) + "`r`n})`r`n`r`nreturn res") | Out-File default.lua

You'll have to modify the above to include the full path for default.lua and MOD.txt. You might also have to change your PowerShell execution policy to allow local scripts to run:

 

https://superuser.com/questions/106360/how-to-enable-execution-of-powershell-scripts

 

edit: It's actually good you brought this up, because I had been using the ovgme solution without considering the case where the binds file gets updated! I'll be re-using this for myself as well.

Awesome, I'll give this a try.

Link to comment
Share on other sites

The problem with that is that if they update the default file, you lose any of the new bindings when you put your modded one back.

I agre with Rudel: the best way to manage "default.lua" mods is OvGME.

And after major updates I use the "Compare" plug-in in Notepad++ to see whar has been added. And then I copy the additions from the new original file to my modified file. No sweat. Sometimes of course, an addition in the original file duplicates one of my mods. In that case I have to choose between two possible courses of action:

1. continue using my modified file

2. copy my mods (the ones that are not duplicated) into the new original and make that my new modded file.

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

Oops.

 

Here's a one-liner powershell that does it. I don't have the hornet, but I tested it with the F-5 which uses the same format I think (}) return res at the bottom). It will add the lines from a text file (in this example MOD.txt) right before the }) return res portion:

 

(gc -raw default.lua) -replace "}\)\r\n\r\nreturn res", ("`r`n" + (gc -raw MOD.txt) + "`r`n})`r`n`r`nreturn res") | Out-File default.lua

You'll have to modify the above to include the full path for default.lua and MOD.txt. You might also have to change your PowerShell execution policy to allow local scripts to run:

 

https://superuser.com/questions/106360/how-to-enable-execution-of-powershell-scripts

 

edit: It's actually good you brought this up, because I had been using the ovgme solution without considering the case where the binds file gets updated! I'll be re-using this for myself as well.

I couldn't get it to work in the end. Just as well really, since it would have appended the lines in the axis section of the file which may have caused problems.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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