Script Patches
Inside a Mod Package, you can easily add new AngelScript files and have them be loaded and compiled by the game on startup. Some script classes are automatically picked up and registered (like conversation topics), but sometimes, you may need to actually change something in the base games script code to get the behavior you want.
To do this - while still allowing compatibility to other mods being loaded by players at the same time - Gothic 1 Remake can automatically apply UnifiedDiff-style .patch files before compiling the scripts.
The recommended workflow uses Git and goes like this:
- Have the base games script in a Git repository
This can be your own local repository, or cloned from the official GitHub repository - Create a branch for your mod
- Make the changes you need, commit them to your branch
- Create a
.patchfile by taking the diff between your branch and the main branch
Detailed walkthrough using Git
Section titled “Detailed walkthrough using Git”Clone the official Gothic 1 Remake script sources from Github into a directory of your choice:
git clone https://github.com/AlkimiaInteractive/G1R-ModkitThen, create a branch for your mod, we will call it mymod in this example:
git switch -c mymodEdit the script files as you wish.
Then, Commit your work as usual:
git add .git commit -m "Initial changes for my mod"Now the key part: Create a diff against the main branch and write it to your mods package:
# Assuming your G1R installation is at C:/, change this to your actual path# This will write MyChanges.patch into the MyMod mod package.
git diff main -- Script/ > C:/G1R/Mods/MyMod/ScriptPatches/MyChanges.patch
# if you are using a local repository, Git may have created a 'master' branch instead
git diff master -- Script/ > C:/G1R/Mods/MyMod/ScriptPatches/MyChanges.patchThis will write a patchfile with all the changes you made compared to the base game scripts. The game will apply all patch files automatically when the mod is loaded on startup.
