I hate having to modify the default.lua joystick file after every update. - Page 2 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 06-11-2019, 01:00 PM   #11
joey45
Veteran
 
joey45's Avatar
 
Join Date: Jul 2006
Location: Quixel suite and 3ds max
Posts: 10,446
Default

Make it [the file] a mod for GME so before you update disable it then enable it after the update.
__________________
General 3D modeling thread and reference sites
new UK liveries for planes, ships and MODS.
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.."
Please send all hate mail to No11
new AV8 livery USN style
joey45 is offline   Reply With Quote
Old 06-11-2019, 01:31 PM   #12
Habu_69
Member
 
Join Date: Jul 2011
Location: USA VA
Posts: 922
Default

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.
Habu_69 is offline   Reply With Quote
Old 06-11-2019, 07:42 PM   #13
98abaile
Member
 
Join Date: May 2011
Posts: 566
Default

Quote:
Originally Posted by JoeyJoJoJunior View Post
You could write a simple batch script. This

Code:
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:
Code:
})

return res
at the end of the file.
98abaile is offline   Reply With Quote
Old 06-11-2019, 11:51 PM   #14
JoeyJoJoJunior
Member
 
Join Date: Feb 2019
Location: Ottawa, Canada
Posts: 147
Default

Quote:
Originally Posted by 98abaile View Post
It's a good idea, but it would put those lines outside of:
Code:
})

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:

Code:
(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/1063...rshell-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
JoeyJoJoJunior is offline   Reply With Quote
Old 06-12-2019, 02:29 PM   #15
98abaile
Member
 
Join Date: May 2011
Posts: 566
Default

Quote:
Originally Posted by JoeyJoJoJunior View Post
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:

Code:
(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/1063...rshell-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.
98abaile is offline   Reply With Quote
Old 06-13-2019, 05:17 PM   #16
LeCuvier
Senior Member
 
Join Date: May 2013
Location: South of France
Posts: 1,705
Default

Quote:
Originally Posted by 98abaile View Post
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
LeCuvier is offline   Reply With Quote
Old 06-13-2019, 09:32 PM   #17
98abaile
Member
 
Join Date: May 2011
Posts: 566
Default

Quote:
Originally Posted by JoeyJoJoJunior View Post
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:

Code:
(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/1063...rshell-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.
98abaile is offline   Reply With Quote
Old 06-13-2019, 11:41 PM   #18
Razi
Member
 
Razi's Avatar
 
Join Date: Oct 2006
Location: Saskatchewan, Canada
Posts: 282
Default

I switched to joystick_gremlin for this exact reason. Once I figured it out I really like it and use it for all my custom bindings. Now I don't have to touch the default.lua or worry about any updates.


https://whitemagic.github.io/JoystickGremlin/
Razi is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 01:57 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.