Skip to content
roxxploxx edited this page May 20, 2017 · 74 revisions

Roxxploxx RimWorld Mod Guide - Welcome!

This guide will assist people trying to mod RimWorld, especially those doing more advanced modding. There are many guides out there but with spotty coverage of topics (from thin to outstanding) or at different technical levels. I will try to focus on high-level understanding and approaches of deep topics, over step-by-step instruction.

Modding is a great way to play RimWorld and to customize it to your needs and joys! Have fun.

NOTE: I love feedback, so find me on Discord : Roxxploxx.

Basics of Modding

Approaches

  • Easy: Create XML to apply existing functionality in new ways to make new things
  • Easy if can code: Create a C# class to make new functionality, which can be applied in XML to ThingDefs.
  • Harder: Use Harmony to modify existing code to do things. This is tedious and not covered here but check out the great work of the HugsLib people NOTE: If you use code injection, you can screw up other mods, making your mod incompatible with others.

So you want to...

  • Add a new Thing to RimWorld - Add a new ThingDef in XML
  • Add a new Thing to RimWorld, like an existing one - Read the Core XML and use an abstract XML def as a Parent
  • Add a new building or plant - As above, but make sure the category tag is set so your building tag gets used.
  • Create new functionality of a Thing in RimWorld - Create c# object and a ThingDef that uses it with <thingClass> pointing to MyNamespace.MyNewClass.
  • Add new data to a Thing in RimWorld - Create a new ThingDef class and use that in your XML as 'Class="YourThingDef"'
  • Change the Core code or a value - Code injection. See HugsLib and Harmony.

Short Tutorials

These tutorials are meant to get you up and running with the topics. They are not comprehensive but after going through them, you should be able to figure the rest of it out. Basically, this is what I needed to know before I could do anything useful on this topic...

Basics and Good-To-Knows

More In-Depth

  • ExtendedThings - Extend anything with Component-like functionality.
  • JobDefs - a bit about creating them
  • User Interface - in progress a tutorial on modding the GUI system of RimWorld
  • Adding Abilities to Pawns - Jecrell has done some great work putting these drop-in DLLs together for us
  • WorldComponent and GameComponent - in progress Add map behaviors.

Advanced Topics

  • DefPatches [external link - by Zhentar] - Modify existing items with XSLT translations in A17
  • Harmony - Using harmony for non-destructive detouring of code... i.e. modify existing RimWorld code.