Modding Tutorials/PatchOperations

From RimWorld Wiki
Revision as of 05:53, 23 May 2017 by Spdskatr (talk | contribs) (Here's a start)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:UC In Alpha 17, a new feature to RimWorld Modding was added, and that was XML PatchOperations. It allows different mods to edit specific elements of an xml def without one overriding the other. Here's a simple example of replacing the texture path for deep water:

  <Operation Class="PatchOperationReplace">
	<xpath>//TerrainDef[defName = "WaterDeep"]/texturePath</xpath>
	<value><texturePath>Your/Texture/Path/Here</texturePath></value>
  </Operation>

There is currently a short tutorial on PatchOperations created by Zhentar: Introduction to PatchOperation

You can also learn about XPaths here: XPath tutorial