Skip to content

Instantly share code, notes, and snippets.

View mrowrpurr's full-sized avatar

Mrowr Purr mrowrpurr

View GitHub Profile
event OnEffectStart(Actor target, Actor caster)
Actor player = Game.GetPlayer()
float direction
if player.GetAngleZ() > 180
direction = player.GetAngleZ() - 180
else
direction = player.GetAngleZ() + 180
endIf
Actor player = Game.GetPlayer()
float direction
if player.GetAngleZ() > 180
direction = player.GetAngleZ() - 180
else
direction = player.GetAngleZ() + 180
endIf
float xOffset = (distanceFromTarget) * -Math.cos(player.GetAngleZ());
@mrowrpurr
mrowrpurr / GetPapyrusScriptName.psc
Created November 16, 2021 14:33
Get Papyrus Script Name
scriptName GetPapyrusScriptName
string function NameOfScript(Anything script)
return StringUtil.Substring(script, 1, StringUtil.Find(script, " ") - 1)
endFunction
@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}
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 / 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
@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 / 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 / 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!
}
{
"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}",