Native Papyrus Functions

scriptName MyPapyrusScript

string function MyNativeFunction() global native
std::string MyNativeFunction(RE::StaticFunctionTag*) { return "Hello from C++!"; }

bool BindPapyrusFunctions(RE::BSScript::IVirtualMachine* vm) {
    vm->RegisterFunction("MyNativeFunction", "MyPapyrusScript", MyNativeFunction);
    return true;
}

SKSEPluginLoad(const SKSE::LoadInterface *skse) {
    SKSE::Init(skse);
    SKSE::GetPapyrusInterface()->Register(BindPapyrusFunctions);
    return true;
}

Updated: