Skip to content

SHORTTUTORIAL: The Basics of Modding

Roxx Ploxx edited this page May 25, 2017 · 3 revisions

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 things. These c# classes can be used in XML ThingDefs.
  • Harder: Extend Rimwork and use Harmony in HugsLib to modify existing code to do brand new things.

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 one if the abstract XML definitions as a Parent. You'll inherit it's properties.
    • 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 - If it doesn't exist, create a C# class to do it.
    • 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"'
  • Alter the RimWorld code - See HugsLib and Harmony to insert patches.

Clone this wiki locally