Skip to content

Instantly share code, notes, and snippets.

Back at RimWorld modding

KapTaiN KaVerN kaptain-kavern

Back at RimWorld modding
  • Rouen, France
View GitHub Profile
Zhentar /
Last active Jul 31, 2020
Introduction to PatchOperation

There are 11 new "PatchOperation" actions we can perform to modify Defs without copying the whole thing. This in turn improves mod compatability dramatically - it allows two mods to modify different parts of the same Def without conflict. This guide only describes the basics of each operation available to us.

Patches go in xml files in a subfolder named "Patches" in your mod folder (So "MyMod\Patches", just like you might have "MyMod\Defs" or "MyMod\Textures"). Example.

Each PatchOperation has an "xpath" node, which should contain an xpath selector for the xml node(s) that the operation should affect. This is not an xpath tutorial. If you don't know xpath, not my problem. But minimurgle has you covered!

To illustrate the operations, I'll use this simple example def:

View gist:99a3858fafd2dc9bea8f685ed6b35556
<Operation Class="PatchOperationReplace">
<xpath>//HediffDef[defName = "Heatstroke"]/lethalSeverity</xpath>
<Operation Class="PatchOperationInsert">
cobyism /
Last active Jan 25, 2021
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).