Quote from: CannibarRechter on September 03, 2017, 05:33:37 PM
This is what you want.
IT WORKS! Thanks alot. I would have never figured it out on my own. I'll let you know when the next complete rollout it.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: CannibarRechter on September 03, 2017, 05:33:37 PM
This is what you want.
<Operation Class="PatchOperationSequence">
<success>Always</success>
<operations>
<li Class="PatchOperationTest">
<xpath>*/ThingDef[defName = "PlantTomato"]/graphicData/texPath</xpath>
</li>
<li Class="PatchOperationRemove">
<xpath>*/ThingDef[defName = "PlantTomato"]/graphicData/texPath</xpath>
<value>
<texPath>Things/TomatoPlant</texPath>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>*/ThingDef[defName = "PlantTomato"]/graphicData/texPath</xpath>
<value>
<texPath>Things/Plant/Tomato</texPath>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>*/ThingDef[defName = "PlantTomato"]/plant</xpath>
<value>
<immatureGraphicPath>Things/Plant/TomatoImmature</immatureGraphicPath>
</value>
</li>
</operations>
</Operation>
Quote from: The-Eroks on September 02, 2017, 02:49:51 PM
Those are very good! I think I'm going to borrow a few for Epic Omega.
Quote from: CannibarRechter on September 03, 2017, 05:57:19 AM
Use replace to replace something. Use add to add something. When you add, you will add "beneath" the queried item. When you replace you replace "at" the queried item. In the case of a replace, the XML is inclusive of the replacement. So if you say "replace" foo, the value must be <foo>something</foo>.
Hope this helps.
Quote from: kaptain_kavern on August 31, 2017, 11:15:31 AM
Patch operation guide : https://gist.github.com/Zhentar/4a1b71cea45b9337f70b30a21d868782
<Operation Class="PatchOperationSequence">
<success>Always</success>
<operations>
<li Class="PatchOperationTest">
<xpath>*/ThingDef[defName = "PlantTomato"]/graphicData/texPath</xpath>
<success>Invert</success>
</li>
<li Class="PatchOperationAdd">
<xpath>*/ThingDef[defName = "PlantTomato"]/graphicData/texPath</xpath>
<value>
<immatureGraphicPath>Things/Plant/TomatoImmature</immatureGraphicPath>
</value>
</li>
</operations>
</Operation>
Quote from: CannibarRechter on August 30, 2017, 08:15:38 PM
I believe you can do multiple things after the Test, not just the one, so you can sequence them together. For example, if I were detecting if a special plant existed, I could replace the main, immature, and leafless textures all as independence patch operations in one sequence, with just the one test.
<Operation Class="PatchOperationReplace">
<xpath>*/ThingDef[defName = "PlantTomato"]/graphicData/texPath</xpath>
<value><texPath>Things/Plant/Tomato</texPath></value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>*/ThingDef[defName = "PlantTomato"]/plant</xpath>
<value><immatureGraphicPath>Things/Plant/TomatoImmature</immatureGraphicPath></value>
</Operation>
<Operation Class="PatchOperationReplace">
<xpath>*/ThingDef[defName = "PlantCarrot"]/graphicData/texPath</xpath>
<value><texPath>Things/Plant/Carrot</texPath></value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>*/ThingDef[defName = "PlantCarrot"]/plant</xpath>
<value><immatureGraphicPath>Things/Plant/CarrotImmature</immatureGraphicPath></value>
</Operation>
Quote from: CannibarRechter on August 29, 2017, 07:45:16 PM
<value><texPath>Items/Corn</texPath></value>
...
<immatureGraphicPath>Items/Immature/Corn</immatureGraphicPath>
...
<value><texPath>Items/Devilstrand</texPath></value>
...
<immatureGraphicPath>Items/Immature/Devilstrand</immatureGraphicPath>
Quote from: Distman on August 29, 2017, 02:57:28 PM
You are adding the tag to wrong node.
It should be under plant.
<Operation Class="PatchOperationInsert"> <!-- "Adding immatureGraphicPath to PlantDevilstrand" -->
<xpath>/ThingDefs/ThingDef[DefName = "PlantDevilstrand"]/graphicData/graphicClass</xpath>
<value>
<immatureGraphicPath>Things/Plant/Devilstrandimmature/</immatureGraphicPath>
</value>
</Operation>
Quote from: Distman on August 29, 2017, 11:22:54 AM
Use these tags to get leafless and immature graphics to work:
<leaflessGraphicPath>
<immatureGraphicPath>