WARNING: PatchOperations within an XML file will run in order even without a PatchOperationSequence and using a PatchOperationSequence can obfuscate or hide errors, making it difficult to debug if your child PatchOperations have errors. If any of them fail, then the Sequence stops and will not run any additional PatchOperations. For example, you could use the following xpath to target all ThingDefs that inherit from Additional XPath Resources ĭefs/ExampleDef/colors/liĭefs/ExampleDef/lines/liĭefs/ThingDef/statBases/Insulation_Coldĭefs/RecipeDef/products/WoodLogĬontains one or more additional PatchOperations, which are executed in order. For example, if you wanted to add another Stuff category to the abstract base Def for all shelves, you might use the following can use the same technique to target all Defs that inherit from a common base. You can target Defs that do not have a defName (such as abstract bases) by targeting their identifying attributes. In this case, we are looking for ThingDefs that have a child tag defName equal to "Wall". The square brackets denote a predicate, or conditional match.The first segment of any XPath targeting an XML Def will be Defs/ as all XML Defs use the root tag.For example, if you wanted to add a stat value to the vanilla Wall building, you might use an XPath like so: Note that an XPath is targeting the structure of the XML document after it's been parsed by RimWorld's parser, thus it has nothing to do with the actual file or folder paths. This is done via XML Path Language or XPath. Most PatchOperations must be targeted at one or more XML nodes inside the master XML document. Individual patches themselves are a standard XML file with as the root tag: Just as with XML Defs, folder and file names do not matter and you can freely name and organize your patch files in whatever manner you wish. PatchOperations are written as XML nodes that go into your mod's Patches folder:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |