/S4ModApi

A library for The Settlers 4 mods

Primary LanguageC++GNU Lesser General Public License v3.0LGPL-3.0

S4ModApi GitHub release (latest by date)

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.

Features

  • 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

Installation for Players

Download a release and unpack the S4ModApi.dll next to your S4_Main.exe.

Remarks for Modders

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.

Contribute

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.

Acknowledgments

Special thanks to the following contributors. Without their work this project would not be as far as it is today.

License

The S4ModApi project is licensed under the GNU Lesser General Public License version 3 (LGPLv3). See COPYING.LESSER file for details.