-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Union] Plugins index and Patch files article (#127)
* [Union] add plugin description and patch files article
- Loading branch information
Showing
3 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# Union | ||
Union is a system to patch and extend Gothic's engine the ZenGin. It allows you to load `.dll` files - ZenGin extensions created using the Gothic/Union SDK and `.patch` files - files designed to patch the game's executable. The Union installer also contains the SystemPack a collection of bug fixes and engine edits that improve performance. | ||
|
||
## Plug-ins | ||
## [Plug-ins](plugins/index.md) | ||
Union plugins are shipped in the form of a `.dll` library. This library contains the compiled C++ code with the Union SDK and an embedded `.patch` file. | ||
|
||
## Union SDK & Gothic API | ||
## [Union SDK](sdk/index.md) & Gothic API | ||
Union software development kit is a collection of tools and the Gothic API that allow you to create Union plugins and alter the engine's behavior. | ||
Gothic API is a set of 4 interfaces (each for one different ZenGin version) that allow you to interface with the engine, access the engine objects, change their behavior and introduce new classes and functionality. | ||
|
||
## PATCH file format | ||
## [PATCH file format](patch.md) | ||
The `.patch` file contains one or more small programs that are designed to change the engine code (game executable). This is usually done to fix bugs. Union plug-ins contain an embedded `.patch` file and this file usually contains changes to the binary necessary for the proper function of the plug-in. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Patch files | ||
`.patch` files are scripts that are used to change memory values or committing some actions when starting the engine. Files patches are launched from any directories monitored by the file system (System, Saves, _Work and any others at the request of the engine). The launch is performed both from physical directories and from VDF & MOD. If physical and virtual directories contain identical patches with identical paths, physical copies will have read priority. | ||
|
||
!!! Info | ||
An additional [patch name] .MAP file can be created. This happens when the patch file has at least one patch marked 'static' (see the description of the patch format for more details). This file allows you to immediately download all previously made changes to process memory, skipping re-parsing of static blocks. By default, the file cannot be seen through standard files explorer. To make the file hidden, but visible, set the value SystemPack.ini -> ShowHiddenFiles = true. | ||
|
||
[Description of the patch format](https://worldofplayers.ru/threads/42178/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
title: Plugins | ||
--- | ||
# Union Plugins | ||
Plugins are libraries dynamically loaded via Union. They can be used to modify the behavior of the game, add new features, and fix bugs. Plugins are written in C++ and compiled into DLL files. The [Union SDK](../sdk/index.md) and Gothic API provide a set of functions and classes that can be used to create plugins. | ||
|
||
!!! Warning | ||
The plugin system is also a potential source of errors. If the plugin is written incorrectly, it can cause the game to crash or behave incorrectly. Therefore, when using plugins, you should be careful and follow the instructions of the plugin authors. | ||
|
||
## Loading | ||
Loading can be done both Physically and from VDF or MOD volumes. There are three options for loading libraries: | ||
|
||
### Systempack.ini | ||
The classic way is to specify the list of library names in SystemPack.ini -> PluginList separated by commas. Also through this parameter you can control the priority of launching plugins: | ||
|
||
1. If you specify two asterisks (plugin.dll**) at the end of the library name, then it will be loaded earlier than the Virtual file system. But in this case it cannot be loaded from VDF or MOD volume. | ||
|
||
2. If you specify one asterisk (plugin.dll*) at the end of the library name, then it will be launched immediately after the Virtual file system. At this stage the library can be loaded from VDF or MOD volume. | ||
|
||
3. If the name of the library is specified without changes (plugin.dll), then it will be loaded simultaneously with the game. At this stage libraries have the ability to use global instances of Gothic classes. | ||
|
||
### Autorun | ||
If the library is located in the Physical Directory `System/Autorun` or in the Virtual Directory `*/Autorun`, then the library will be loaded along with the engine, as in step 1.III. In current versions of Union, the order of loading plugins from this folder is determined by the dependencies of the libraries on each other. This means that if one plugin imports symbols from another, then the Exporting will be loaded first, and then the Importing. | ||
|
||
### Patch File | ||
The patch files start automatically. This means that plugins can also run patches along with them. There are two script functions: `LoadLibrary("plugin.dll")` and `LoadPlugins("plugin1.dll", ..., "pluginN.dll")`. |