A modding library for Bluebyte's The Settlers 4. The goal of this project is to provide a API to mod developers such that they do not have to resort to reverse engineer the game themselves.
- Create custom UI elements that the player can interact with
- Create player events programmatically
- Run code on specific events
- Dispatch access to common hooks fairly to mods thus reducing conflicts between them
- Simplify ASI mod creation by providing common functions for modding
- Manages a backward compatible ABI for the API
- Single header file
- Open Source
Download a release and unpack the S4ModApi.dll next to your S4_Main.exe.
Note: The ABI is stable and backward compatible only if you link against the latest release. Do not distribute your mod linking to a prerelease (labeled with RC) since the ABI is not stable and not backward compatible. Your mod will break with upcoming releases. Read the versioning guide for more information regarding ABI stability.
See the hello world sample mod on how to configure your project with the S4ModApi.
The reference of the API is available in the Wiki
Please consider contributing features that that we currently do not offer back to this project. You can make sure that your mod stays compatible with upcoming and past releases of The Settlers 4, if you link to the S4ModApi.dll instead of directly linking to the S4_Main.exe. Moreover does it reduce the risk of conflicts between plugins and other mods.
We are open for pull requests!
Follow the build instructions if you want to build the S4ModApi.dll and it's import library.
Some source files are only provided as precompiled obj files. This is due to license issues.
Special thanks to the following contributors. Without their work this project would not be as far as it is today.
- MuffinMario for the creation of s4.muffinmar.io and the reversal / documentation of the Lua interface including all function names, their parameters and many enumerations.
- Viciten for the support of alpha blended bitmaps.
- oberstrike for the contribution of features and bugfixes
- WizzardMaker for the contributions of features and bugfixes.
The S4ModApi project is licensed under the GNU Lesser General Public License version 3 (LGPLv3). See COPYING.LESSER file for details.