Skip to content

Instantly share code, notes, and snippets.

View mrowrpurr's full-sized avatar

Mrowr Purr mrowrpurr

View GitHub Profile
@mrowrpurr
mrowrpurr / NewBindings.txt.py
Last active April 22, 2022 03:19
NewBindings
ScriptName [Properties...]
FunctionName [Arguments...]
ScriptName *Selector*
EventName [Event Conditions] FunctionName [Arguments...]
ActionName [Argments...]
... AND WICKED BADASS PAPYRUS FUNCTIONS
# -------------------------------
@mrowrpurr
mrowrpurr / SKSE: Bind a script to an object at runtime.cpp
Created March 25, 2022 18:57
SKSE: Bind a script to an object at runtime
void BindObjectToScript() {
ConsoleLog::GetSingleton()->Print("Binding the BindMe script...");
auto* character = PlayerCharacter::GetSingleton();
auto* vm = VirtualMachine::GetSingleton();
auto* handlePolicy = vm->GetObjectHandlePolicy();
auto* bindPolicy = vm->GetObjectBindPolicy();
// Force load the BindMe script
vm->linker.Process(BSFixedString("BindMe"));
@mrowrpurr
mrowrpurr / plugin.cpp
Last active March 23, 2022 13:27
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.");
}
});
{
"version": 3,
"configurePresets": [
{
"name": "base",
"description": "For more information: http://aka.ms/cmakepresetsvs",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
@mrowrpurr
mrowrpurr / Learning SKSE - Little bits of Reflection.cpp
Created February 21, 2022 02:14
Learning SKSE - Little bits of Reflection
namespace
{
class MyCallback : public RE::BSScript::IStackCallbackFunctor
{
public:
MyCallback() {}
void operator()(RE::BSScript::Variable a_result)
{
// DO SOMETHING!
}
@mrowrpurr
mrowrpurr / Latest Favorite Skyrim Papyrus Project File Template.ppj
Created February 20, 2022 01:00
Latest Favorite Skyrim Papyrus Project File Template
<?xml version='1.0'?>
<PapyrusProject xmlns="PapyrusProject.xsd"
Flags="TESV_Papyrus_Flags.flg"
Game="sse"
Output="Scripts"
Anonymize="false"
Optimize="false"
Release="false"
Zip="false"
Package="false"
@mrowrpurr
mrowrpurr / Complete Skyrim Mod Authoring Setup.md
Last active February 19, 2022 22:12
Complete Skyrim Mod Authoring Setup

Complete Skyrim Mod Authoring Setup

Things to install...

Skyrim

  • Skyrim (LE)
  • Skyrim (VR)
  • Skyrim AE with Creation Club content
  • Skyrim AE without Creation Club content
@mrowrpurr
mrowrpurr / Generate BAT file to do it.rb
Last active February 19, 2022 22:40
Move AE CC mods into folders.rb
require "fileutils"
FileUtils.rm_f "move_cc_files.bat"
BATCH_FILE = File.open "move_cc_files.bat", "a"
def append(line)
BATCH_FILE.write "#{line}\n"
end
event OnInit()
int formId = GetOwningQuest().GetFormID()
int modIndex = Math.RightShift(formId, 24)
if modIndex == 0xFE
int lightModIndex = Math.LogicalAnd(Math.RightShift(formId, 12), 0xFFF)
Debug.MessageBox(Game.GetLightModName(lightModIndex))
else
Debug.MessageBox(Game.GetModName(modIndex))
endIf
endEvent
@mrowrpurr
mrowrpurr / ExampleUsage.ts
Last active November 19, 2021 06:26
Get mod name and relative ID for Skyrim mod (using Skyrim Platform)
import { printConsole, Game } from "skyrimPlatform"
import { getFormInfo } from "./FormInfo"
export default function StartRuntime() {
// ESPFE
const justDesserts = Game.getFormFromFile(0x801, "JustDesserts.esp")
const justDessertsInfo = getFormInfo(justDesserts!)
printConsole(JSON.stringify(justDessertsInfo))
// Prints out: {"modName":"JustDesserts.esp","relativeFormId":2049}