Skip to content

Instantly share code, notes, and snippets.

@mrowrpurr
Last active March 23, 2022 13:27
Show Gist options
  • Select an option

  • Save mrowrpurr/d075745a36fbd705bbb533934334817d to your computer and use it in GitHub Desktop.

Select an option

Save mrowrpurr/d075745a36fbd705bbb533934334817d to your computer and use it in GitHub Desktop.
CommonLib SKSE Hello World
#include <SKSE/SKSE.h>
#include <RE/C/ConsoleLog.h>
extern "C" __declspec(dllexport) bool SKSEAPI SKSEPlugin_Load(const SKSE::LoadInterface* skse) {
SKSE::Init(skse);
SKSE::GetMessagingInterface()->RegisterListener([](SKSE::MessagingInterface::Message* event){
if (event->type == SKSE::MessagingInterface::kDataLoaded) {
RE::ConsoleLog::GetSingleton()->Print("Hello from mod.");
}
});
return true;
}
extern "C" __declspec(dllexport) bool SKSEAPI SKSEPlugin_Query(const SKSE::QueryInterface*, SKSE::PluginInfo* info) {
info->infoVersion = SKSE::PluginInfo::kVersion;
info->name = "SkySpecExample";
info->version = 1;
return true;
}
extern "C" __declspec(dllexport) constinit auto SKSEPlugin_Version = [](){
SKSE::PluginVersionData version;
version.PluginName("SkySpecExample");
version.PluginVersion({ 0, 0, 1 });
version.CompatibleVersions({ SKSE::RUNTIME_LATEST });
return version;
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment