Jump to content

Single userconfig file for tweaks in Saved Games


doveman

Recommended Posts

At the moment, we have to edit multiple luas to do various tweaks. Even though we can use JSGME to do these, it means we have to copy the original lua to our JSGME/mod folder, edit it, then enable it. Then when DCS is updated, we have to disable the mods, check to see if the original lua has been changed at all by the update and if so, copy the updated one to our JSGME/mod folder and make our edits to that. Then repeat all that for every lua that we've edited.

 

Even if we can put our modified luas in Saved Games\ and I'm not sure if that works for every lua, (JSGME is probably not needed for this, as DCS doesn't update anything in Saved Games as far as I'm aware), that just means we don't have to enable/disable the mods when updating DCS but we still have to check the original luas after each update to see if they've been changed and if so, make new copies to Saved Games\ and re-edit them.

 

What I propose is to have a single file in Saved Games\Config, e.g. userconfig.lua, in which we can put all our tweaks to the various luas. This could be done using headings, like ViewPortHandling under which any tweaks to ViewPortHandling.lua would go. Assuming that the luas all use variables that are distinct to them and not shared or common with any other lua, then these headings might not actually be needed by DCS internally but they'd help users to organise and understand the file. Then the only time we'd need to change our userconfig.lua is if we wanted to change something, add a new tweak or if ED changed the name of one of the variables used in the luas (which hopefully they can commit not to doing).

 

Many mods probably only change one or two lines in a lua, so for example one mod I use I believe only changes these two lines in MissionEditor.lua:

 

main_w = 1024

main_h = 768

 

So if main_w and main_h are only used in this lua, DCS will know what to do with them, regardless of whether the userconfig.lua uses headers or not.

 

I'm not sure when exactly luas are loaded/processed but the userconfig.lua could be used in two ways, depending on how DCS works. One way would be to load it after everything else, substituting/overwriting (in memory) the values within for those in the original luas. The other way would be to load it into memory first and then refer to it every time an lua is processed and substitute the values within for those loaded from the original lua.

 

So for example, MissionEditor.lua is processed and loads main_w and main_h into RAM somewhere, then DCS refers to userconfig.lua (which has already been stored in RAM to avoid constantly having to load it from HDD/SSD) and overwrites main_w and main_h wherever they are being stored in RAM. I suppose this would require DCS to use a table of sorts to reference where each variable is stored, as they're obviously not going to be loaded to the same specific location in RAM each time.

 

I think I'll stop now, as I'm no programmer and I might not be making much sense but I think I've explained the idea at least and hopefully someone who is a programmer can explain how this would work better and ED will see the benefit and implement it.

Main rig: i5-4670k @4.4Ghz, Asus Z97-A, Scythe Kotetsu HSF, 32GB Kingston Savage 2400Mhz DDR3, 1070ti, Win 10 x64, Samsung Evo 256GB SSD (OS & Data), OCZ 480GB SSD (Games), WD 2TB and WD 3TB HDDs, 1920x1200 Dell U2412M, 1920x1080 Dell P2314T touchscreen

Link to comment
Share on other sites

  • 3 weeks later...

Does no-one else see the problems with the current system and the potential benefits of my suggestion?

 

If it couldn't work for some reason, feel free to explain why so that I can resign myself to having to put up with how it is ;)

Main rig: i5-4670k @4.4Ghz, Asus Z97-A, Scythe Kotetsu HSF, 32GB Kingston Savage 2400Mhz DDR3, 1070ti, Win 10 x64, Samsung Evo 256GB SSD (OS & Data), OCZ 480GB SSD (Games), WD 2TB and WD 3TB HDDs, 1920x1200 Dell U2412M, 1920x1080 Dell P2314T touchscreen

Link to comment
Share on other sites

Im not a .lua programmer, but I do program in C#. Your suggestion is a good idea and a simple one at that. Granted I dont know how the code is in the game, but I can imagine to implement a change like that would require significant code changes to the game, and even the patching system.

DCS: A10C Warthog JTAC coordinate entry training mission http://www.digitalcombatsimulator.com/en/files/99424/

 

DCS: Blackshark 2 interactive training missions http://forums.eagle.ru/showthread.php?t=84612

Link to comment
Share on other sites

Thanks for the kind words and for giving me hope ;)

 

I'm sure it would require a lot of coding to implement but hopefully ED will consider it sometime, when they're not so busy.

 

I don't see how it would affect the patching system though, as my suggestion would just allow us to put all our tweaks (which are just variables at the end of the day) in a file, or files, in Saved Games\DCS\Config, rather than having to modify files in the DCS install folder. So it shouldn't make any difference to how DCS updates it's files.

Main rig: i5-4670k @4.4Ghz, Asus Z97-A, Scythe Kotetsu HSF, 32GB Kingston Savage 2400Mhz DDR3, 1070ti, Win 10 x64, Samsung Evo 256GB SSD (OS & Data), OCZ 480GB SSD (Games), WD 2TB and WD 3TB HDDs, 1920x1200 Dell U2412M, 1920x1080 Dell P2314T touchscreen

Link to comment
Share on other sites

  • Recently Browsing   0 members

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