Modding Tutorials/PatchOperations
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