Skip to content

A template project for creating union plugin for Gothic Games

Notifications You must be signed in to change notification settings

Patrix9999/union-plugin-template

Repository files navigation

Introduction

This project serves as a starting point for creating a union plugin for the following Gothic games:

It provides a preconfigured base code designed to simplify the development process and help you focus on building new features for your plugin.

Requirements

Before you start making your own plugin, you need to install some software first, here's a full list of things that you'll need to install to be able to build the union plugin:

  • git Required for version control and to clone the project repository
  • CMake Optional if you plan to use Visual Studio
  • Visual Studio Essential for compiling the plugin using the MSVC toolset
    (make sure to install C++ Workload and CMake Tools for Visual Studio)

The Union plugin requires the MSVC toolset for compatibility, so alternative toolchains like MinGW are not supported.

Fetching the source code

  1. Make sure to clone the your project repository recursively (to fetch all of the git submodules).
  2. You can achieve this by typing this command in your terminal:
git clone --recursive URL_TO_YOUR_REPO

Configuration

All of the plugin configuration is located in REPO_ROOT/CMakeLists.txt.
Some of the common things that you should propably change are:

  • project name (this is also setting the name of your plugin dll)
    default value is UnionPlugin
  • project version
    default value is 1.0.0.0

Building

Follow the steps below to compile the plugin:

Step 1: Open the Project in Visual Studio

  1. Navigate to the root directory of your repository.
  2. Right-click on the folder's content (without selecting any files or subfolders).
  3. Select Open with Visual Studio from the context menu.

Step 2: Choose a Configuration

  1. In Visual Studio, locate the Solution Configurations dropdown menu in the top toolbar.
  2. Select the desired configuration for your build

Step 3: Pick the Startup Project

  1. In Visual Studio, locate the Solution Startup Item dropdown menu in the top toolbar.
  2. Select your plugin from dropdown list

Step 4: Build the plugin

  1. Once everything is configured, click Build Solution (or press Ctrl+Shift+B).
  2. If you've configured everything correctly, the build process should complete successfully.

Plugin installation

Once the plugin has been compiled successfully, you can tell the game to load it during startup by placing it in System/autorun subdirectory.

To do that copy the plugin:
from: REPO_ROOT/out/build/YOUR_CONFIGURATION/YOUR_PROJECT_NAME.dll
to: GAME_ROOT/System/autorun/

You can also create a symbolic link for your dll in System/autorun subdirectory, that way you won't be forced to copy the plugin dll each time while you compile a new version of your plugin.
On Windows you can use Link Shell Extension that allows you to create symlinks from file context menu.

Publishing plugin

This project provides github action for compiling and releasing a new version of your plugin via github.

Before you publish a new release, make sure to set a new version in CMakeLists.txt, and document your changes in CHANGELOG.md file. I recommend updating your changelog file regularly during the development of your plugin, to not forget about adding this later.

To publish a new version of your plugin you just need to create a new github release.
I recommend naming your release by using your plugin version.

And that's it, when plugin will be built successfully it will automatically be added as release asset to the newest release. By default CI/CD script is using the MP-Release configuration, depending on your plugin requirements you might want to change this, to match your plugin supported platform(s).

About

A template project for creating union plugin for Gothic Games

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published