Skip to content

Instantly share code, notes, and snippets.

@EliteMasterEric
EliteMasterEric / Eric's EZ Guide to Harmony Patches.md
Created August 16, 2025 22:14
A guide to creating Prefix and Postfix patches in Harmony, for beginner Unity modders.

Introduction to BepInEx

(If you understand how BepInEx works and what it does, you can skip this and go to the next section.)

Modding Unity games is pretty standardized in 2025. In general, you have to create your mod code in C#, build it into a DLL file, then convince the game to execute your code.

There are two ways of doing this. The first is if the game has a mod loader built in, you just have to create and install mods based on their instructions. Games that work like this include Rimworld and Oxygen Not Included, and games that work like this generally have Steam Workshop support or some other standard way of distributing mods.

The other way is that if the game doesn't natively support mods, you can use BepInEx. BepInEx is a modloader, similar to Fabric for Minecraft. BepInEx works by placing a winhttp.dll file in your game folder, which does all the same things as the winhttp.dll file in your System32 folder, but it also tells it to load the code in the BepInEx DLL. From there, BepInEx can de

@megalon
megalon / AssetPostProcessorReorderBonesEditor.cs
Created November 12, 2023 06:23
Unity custom model importing scripts for mods
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.Linq;
//sorts transform bone indexes in skinned mesh renderers so that we can swap skinned meshes at runtime
public class AssetPostProcessorReorderBonesEditor : AssetPostprocessor
{
private string targetObjectName = "object-name-here";
private List<string> CorrectBoneOrder = new List<string> {

Why License?

With no license, code is "All Rights Reserved" and any other application using your code is committing copyright infringement! So you should choose a license for any code you distribute publically.

Licenses will additionally protect the copyright holder from damages, and absolve any liability or unstated warranties related to the copyrighted code.

Copyleft Licenses

  • Generally require any changes to the provided source files to be redistributed.
  • Pros:
    • Encourages contributions to the original project and benefits the open-source community.
  • Prevents massive companies from selling open-source software.
package;
import flixel.system.FlxAssets.FlxShader;
import openfl.display.BitmapData;
/**
* Implements the overlay blend mode as a Flixel shader.
*
* @see https://en.wikipedia.org/wiki/Blend_modes#Overlay
* @author EliteMasterEric
@WolfgangSenff
WolfgangSenff / gist:168cb0cbd486c8c9cd507f232165b976
Last active November 11, 2025 12:52
Godot 4.0 Migration/Upgrade guide
## For a beginner-friendly version of the following (more advanced users likely will get better use of the below,
## if you're just starting out...), see this new gist:
## https://gist.github.com/WolfgangSenff/0a9c1d800db42a9a9441b2d0288ed0fd
This document represents the beginning of an upgrade or migration document for GDScript 2.0 and Godot 4.0. I'm focusing on 2D
at the moment as I'm upgrading a 2D game, but will hopefully have more to add for 3D afterward.
## If you want more content like this, please help fund my cat's medical bills at https://ko-fi.com/kyleszklenski - thank you very much! On to the migration guide.
@EliteMasterEric
EliteMasterEric / FNFEngines.md
Last active September 9, 2024 18:21
Friday Night Funkin' Game Engine Comparison

List of Friday Night Funkin' Engines:

The base game. Like vanilla ice cream, some people find it bland while, for others, it's their personal favorite. Only version available on Newgrounds (re-uploads of FNF or even mods aren't allowed). The Newgrounds web-only edition (no source code available) includes spritemap animations for cutscenes (the Tricky Mod uses pre-rendered videos), custom keybinds, and note splashes.

One of the original modded engines, developed for the Full Ass Tricky Mod, and later separately maintained. Focused on high-level play, featuring a reworked input system, improved player stats like a results screen hitgraph, and custom keybinds. The most common engine to use in mods (even if it isn't the simplest to mod).

@TrueCP6
TrueCP6 / forge-to-fabric-ports.md
Last active August 22, 2025 19:46
A list of decently sized Forge mods ported or being ported to Fabric
@JavidPack
JavidPack / AnotherSimpleHarmonyTranspilerTutorial.md
Last active September 11, 2025 19:04
Another Simple Harmony Transpiler Tutorial

About

This guide is yet another Harmony Transpiler Tutorial. This guide will use Terraria as the target game and will touch lightly upon Labels, Extension Methods, and AccessTools. If you'd like, you can skip right to the bottom and see these sections directly. Read the guide from start to finish if you'd like to follow the thought process of developing this Transpiler.

Prerequisites

  • This guide assumes you have gone through the original tutorial.
  • dnSpy - We will use the compile functionality to help design our patch.
  • Familiarity with Terraria is NOT required

Goal

The goal that this guide will work toward is making the various bee related items in Terraria stronger. For those not familiar with Terraria, various items will spawn bees as weapons. If the player has the strongBees ability, bees will have a random chance of spawning as GiantBee instead. This patch will further augment the `stron

@larsiusprime
larsiusprime / PakLibrary.hx
Last active October 25, 2021 07:25
Pak & Unpack system
package;
import haxe.io.Bytes;
import lime.utils.UInt8Array;
import lime.graphics.Image;
import lime.graphics.ImageBuffer;
import openfl.Assets.AssetLibrary;
import openfl.Assets;
import openfl.Lib;
import openfl.utils.ByteArray;
@aras-p
aras-p / preprocessor_fun.h
Last active December 5, 2025 05:33
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,