Skip to content

Instantly share code, notes, and snippets.

Avatar
🤠
Back at RimWorld modding

KapTaiN KaVerN kaptain-kavern

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

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:

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

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).