Sure! Here's a template for a commonLibsse SKSE (Skyrim Script Extender) plugin in C++:
main.cpp:
cpp
#include "commonLibssePlugin.h"
bool SKSEPlugin_Load(const SKSEInterface* skse)
{
// Plugin initialization code here
return true;
}
extern "C"
{
bool SKSEPlugin_Query(const SKSEInterface* skse, PluginInfo* info)
{
// Fill in plugin info
info->infoVersion = PluginInfo::kInfoVersion;
info->name = "YourPluginName";
info->version = 1;
// SKSE version check
if (skse->isEditor)
{
_MESSAGE("YourPluginName: Editor mode detected, disabling plugin.");
return false;
}
else if (skse->runtimeVersion != RUNTIME_VERSION_1_5_97)
{
_MESSAGE("YourPluginName: Unsupported runtime version %08X. Plugin will be disabled.", skse->runtimeVersion);
return false;
}
// All checks passed
return true;
}
bool SKSEPlugin_Load(const SKSEInterface* skse)
{
return SKSEPlugin_Load(skse);
}
};
commonLibssePlugin.h:
cpp
#pragma once
#include "skse64_common/skse_version.h"
#include "skse64_common/BranchTrampoline.h"
#include "skse64_common/Relocation.h"
#include "skse64_common/SafeWrite.h"
#include "skse64/PluginAPI.h"
#include "skse64/GameAPI.h"
#include "skse64/GameRTTI.h"
#include "skse64/PapyrusVM.h"
#include "skse64/PapyrusNativeFunctions.h"
#include "skse64/NiTypes.h"
// Include any other necessary SKSE headers here
#include <Windows.h>
#include <string>
#include <vector>
// Define any additional global variables or functions here
// Example function
void MyFunction()
{
_MESSAGE("Hello from MyFunction!");
}
// Entry point for the plugin
bool SKSEPlugin_Load(const SKSEInterface* skse);
Replace "YourPluginName" with the desired name for your plugin. You can include any additional SKSE headers needed for your plugin's functionality. Feel free to add more global variables and functions as required.
Note: This is just a template and may need to be modified based on your