-
Notifications
You must be signed in to change notification settings - Fork 36
Generating Patches and Templates
This is the process I use to generate viewport templates and patches.
First acquire a clean DCS installation. Run repair to make sure the files are clean:
C:\Program Files\Eagle Dynamics\DCS World>bin\DCS_updater repair
Now use the Helios tool GeneratePatches.exe to create a git repo to track all the Lua files in the DCS installation. If you are using a default DCS installation location, you may need to run this in an Administrator prompt. It is usually easier to just have another copy of DCS in a working location instead of messing with the default installed one. Then you also don't need admin privileges. However, I am using the default one in this example:
C:\Program Files\Helios Virtual Cockpit\Helios>GeneratePatches init -d "C:\Program Files\Eagle Dynamics\DCS World"
Initializing git repo at 'C:\Program Files\Eagle Dynamics\DCS World' and checking in lua files
Now apply any existing patches from the latest version of Helios. To do this, just create a profile with a DCS Additional Viewports interface in it. Select the target DCS folder that you are using for patch generation as the DCS Locations to Update. Install the patches.
All the changes made by Helios are now known to git:
C:\Program Files\Eagle Dynamics\DCS World>git diff --name-only
Mods/aircraft/Ka-50/Cockpit/Scripts/ABRIS/BAKE/init.lua
Mods/aircraft/Ka-50/Cockpit/Scripts/SHKVAL/BAKE/init.lua
…
For creation of a production set of patches, you will need to have all the aircraft installed. They don't need to be licensed, just installed.
At this point, we may want to add additional viewports that were not previously included in Helios.
Experiment with the changes you want to make in terms of viewports and make sure you know which files should receive the try_find_assigned_viewport…
code. When you have it working, note the files where you placed these changes.
Add these files to the master list of viewport modifications in
C:\Program Files\Helios Virtual Cockpit\Helios\Tools\ToolsCommon\Data\Viewports\ViewportTemplates.json
Note: This file is also shared with at least one other open source project working on DCS tools. Some of the information in there isn't actually used by Helios (such as the default locations,) so not all of it is always populated. This is a living document.
You can also add any viewports that exist without requiring patches to
C:\Program Files\Helios Virtual Cockpit\Helios\Tools\ToolsCommon\Data\Viewports\ExistingViewportTemplates.json
Finally, if there are changes that need to be made differently for different versions of DCS, you can add those to files called
C:\Program Files\Helios Virtual Cockpit\Helios\Tools\ToolsCommon\Data\Viewports\ViewportTemplates_???_????_??????_?????_?????.json"
There are some examples already in that directory to follow. The version stamp in the file is the first version of DCS at which these patches apply. For each aircraft, the tools use the highest numbered file containing that aircraft, without going over the version of DCS currently being modified. This way, when DCS changes file structure at some build number X, we can just create a file with version number X that reflects the changes.
To compile this file into changes, you run two tools:
C:\Program Files\Helios Virtual Cockpit\Helios>EditViewports -d "C:\Program Files\Eagle Dynamics\DCS World"
This adds the "try_find_assigned_viewport…" code to all the appropriate files, if not already there. It actually runs a Helios system that logs to the console, so the output is incredibly verbose and long.
And secondly:
C:\Program Files\Helios Virtual Cockpit\Helios>GenerateSimulatorViewportTemplates.exe Tools\ToolsCommon\Data\Viewports\ViewportTemplates.json %USERPROFILE%\Documents\Helios\Templates true
C:\Program Files\Helios Virtual Cockpit\Helios>GenerateSimulatorViewportTemplates.exe Tools\ToolsCommon\Data\Viewports\ExistingViewportTemplates.json %USERPROFILE%\Documents\Helios\Templates false
These will generate the Simulator Viewport templates for the Profile Editor toolbox.
The final step is to render a patch set for the current version of DCS:
C:\Program Files\Helios Virtual Cockpit\Helios>GeneratePatches generate -d "C:\Program Files\Eagle Dynamics\DCS World" -o %USERPROFILE%\Documents\Helios\Patches
This will create a tree of patches for the current version of DCS, with patches and reverse patches based on all the file changes according to git. Any file that git considers dirty is compared with its git version and the differences are encoded with Google diff-match-patch. Note that at least one critical bug was fixed in Google diff-match-patch in the Helios fork, so the patches may not be identical with the ones that would be (incorrectly) generated by the unmodified Google code. Since that project has apparently no current support, those fixes are not expected to flow back to the Google version.
Helios will use patches from the Documents\Helios\Patches
location so you can test them using Profile Editor. When you have good patches or changes to the Viewport JSON files, please submit them to Helios as a pull request from your fork to base repository: https://github.com/HeliosVirtualCockpit/Helios
and base: master
.
First clean up any of our changed files:
C:\Program Files\Eagle Dynamics\DCS World>git reset --hard
HEAD is now at 4fc45f0 Initial checkin of clean files
Update DCS and check in the changes made by DCS developers.
C:\Program Files\Eagle Dynamics\DCS World>git add .
C:\Program Files\Eagle Dynamics\DCS World>git commit -a -m "updated to version x.y.z.build"
Now apply patches again and make sure they still work. If not, fix up broken files manually and generate new JSON + patches.
Download latest Helios from this repo