SKSE Plugin Development/What Is SKSE
If you are new to this, the single most useful thing to learn first is that the word "SKSE" can mean at least four different things, and almost every point of confusion comes from them being used interchangeably. This page attempts to separate them, and shows how they fit together.
"SKSE" can mean four things[edit | edit source]
| # | Name | Description | Where? |
|---|---|---|---|
| 1 | The runtime | Code in the form of a DLL injected into the game at startup that hooks the engine. It is responsible for extending the functionality of papyrus scripts, loading plugins, injecting code into the game, and provides the API that plugins use. | injected by the skse64_loader.exe (Inject.cpp), brought up by SKSE64_Initialize
|
| 2 | The plugin ABI | The frozen connection point every plugin must match. It's a fixed set of entry points it exports (like SKSEPlugin_Load) and one plain-C struct the runtime hands back. It doesn't change shape, so a plugin built long after the runtime still fits. |
PluginAPI.h
|
| 3 | An SDK | The library you compile against to build a plugin | SKSE's own source OR one of the forks of CommonLibSSE (e.g. Po3, NG) |
| 4 | The Papyrus surface | SKSE adds additional functionality to existing vanilla papyrus scripts. For example, adding additional functions on the Actor script. This allows script authors to do more, without having to dive into C++ or SKSE modding themselves. | registered into the VM by SKSE, modified scripts here |
When you read "SKSE" or "Requires SKSE", the author could mean any one of these.
The hourglass[edit | edit source]
SKSE has a runtime half (present in the running game) and a build-time half (what a developer compiles against). The two halves meet at one seam: the plugin ABI
Which SDK should a developer use?[edit | edit source]
Please note that this information is in flux. Forks are abandoned or shift owners. The information here could be outdated by the time you read it. Please verify that the project you build against is actively maintained.
There are two ways to build an SKSE plugin, and for most developers CommonLibSSE, not SKSE's own source.
- SKSE's own source: The runtime, but also usable directly as an SDK. Building against it is lower-level and tends to be less ergonomic for any user not already familiar with reverse engineering techniques.
- CommonLibSSE: A separately-authored library that most plugin developers build against for its easier C++ API. It looks and behaves more like how a developer might interact with a game. It targets the same plugin ABI at the waist, so a CommonLibSSE plugin loads under the same SKSE runtime. At compile time, commonlibsse it is a separate codebase: it re-derives the game's types itself and even redeclares the plugin-ABI structs, so its headers and SKSE's own cannot be included alongside each other. You build against only one.
CommonlibSSE 'NG' also provides functionality which allows it to handle different versions/patches of Skyrim. Since some users opt to downgrade for compatibility reasons, it may be advisable to use this fork to maximize compatibility of your own mod.