Skip to content

Instantly share code, notes, and snippets.

@Lanilor
Lanilor / rimworld-add-or-replace-patch.md
Last active May 26, 2024 00:56
A way to simplify defenvise sequence patches foradding fields

How you use it in the mods patch folder

<Operation Class="[YOUR C# MOD NAMESPACE].PatchOperationAddOrReplace">
    <xpath>/Defs/ThingDef[defName="Plant_TreeBirch"]/plant</xpath>
    <key>growDays</key>
    <value>22</value>
</Operation>

The class you need to add to your C# code

@Lanilor
Lanilor / rimworld-xml-patching.md
Last active May 26, 2024 00:56
Random stuff about XML patching

Notes

  • This document is still a draft. Don't rely on any information until it is done and tested.
  • This is a more advanced guide with some special cases, improvements and optimizations. If you need to know the basics, read this guide.

Compatibility patches (with FindMod)

You can use cores PatchOperationFindMod to create conditional patches when certain mods are loaded without the need of an external library.

<Operation Class="PatchOperationFindMod">
    <mods>