Getting Started with SKSE Plugin Development

From the CreationKit Wiki
Revision as of 17:06, 10 December 2024 by Xieve (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

[SKSE64 2.2.6 Revision]

Requirements[edit | edit source]

  • Skyrim Special Edition
  • SKSE for Skyrim SE (Also referred to as SKSE64), which you should already have installed.
  • Visual Studio 2022 Build Tools. You don't need to install the entire IDE if you won't use it.
  • An IDE like Visual Studio, VS Code or CLion. xieve recommends using CLion if you have not used Visual Studio before, as it will manage installation of vcpkg automatically, among other things.

Ensure that your Windows and SKSE installations are up-to-date. If Skyrim Special Edition has not received an update in the previous week or so, you will want that up-to-date too. See the official SKSE page to see which version is currently supported. Please keep in mind that this guide does not guarantee backward/forward compatibility, and things keep breaking in unforeseen ways.

Setup[edit | edit source]

The easiest and recommended approach is to use a template plugin. This one is currently (as of 2024-11-16) recommended for CommonLibSSE-NG. See here for a comparison of the different CommonLibSSE versions.

Follow the documentation that the template plugin of your choice provides, it will be more up-to-date and applicable than any external resource.

Should you want to, you can set environment variables inside CMakeLists.txt like so:

set(ENV{VARIABLE_NAME} "Variable value")

For example:

set(ENV{SKYRIM_MODS_FOLDER} "C:\\Games\\MO2\\mods")

Resources[edit | edit source]

As of 2024-11-16, there is no definitive resource on SKSE plugin modding.

Please note that instructions may differ from one source to another and that some might simply be completely wrong/outdated.

Generally, SKSE plugin development heavily depends on a good IDE that allows you to browse the SKSE and CommonLibSSE sources, and on reading other people's source code on GitHub.

If you chose to use CLion, navigate to <Project Directory>\build\debug-msvc\vcpkg_install\vcpkg\pkgs\commonlibsse-ng_x64-windows-skse, right-click it and select Mark directory asLibrary Files. Now, when you hit shift twice to invoke Search Everywhere, all the CommonLibSSE symbols will show up in your search!