[XPath] Multiple Replacements?

Started by SinStar87, September 11, 2018, 02:23:06 PM

Previous topic - Next topic

SinStar87

Is there a way to combine these into one operation section?
    <Operation Class="PatchOperationReplace">
        <xpath>/Defs/ThingDef[defName = "Plasteel"]/label</xpath>
        <value>
            <label>new name</label>
        </value>
    </Operation>
    <Operation Class="PatchOperationReplace">
        <xpath>/Defs/ThingDef[defName = "Plasteel"]/description</xpath>
        <value>
            <description>Replacement Description.</description>
        </value>
    </Operation>

AileTheAlien

Nope. They're replacing different things, so the XPaths and operations need to remain separate.

SinStar87

Ok, thanks. Couldn't figure out how to block out vanilla stuff so just going to replace a bunch and info on xpath says it can bog down the game, so anything to trim down on lookups would help.

AileTheAlien

The thing that would slow down xpathing is having wildcards, especially near the top of the tree. The paths you've shown are very explicit, so they would not slow the mod-loading process to a significant degree.

SinStar87