RimWorld

RimWorld

Project RimFactory Lite
HawnHan 24 Jun, 2021 @ 2:17am
[Tutorial]Modify Patch to be compatible with Industrial Roller
If you enable Industrial Roller and this mod at the same time then you got many errors.You can fix it by yourself before modder fixes the errors.

1.Open file in Project RimFactory Lite\Patches\Industrial Rollers\Rollers Research.xml
Copy the following contents and override all:

<?xml version="1.0" encoding="utf-8" ?>
<Patch>

<!--Set Rollers Research -->
<Operation Class="PatchOperationFindMod">
<mods>
<li>Industrial Rollers</li>
</mods>
<match Class="PatchOperationSequence">
<success>Always</success>
<operations>
<li Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[
defName="MovingRailPusher" or
defName="MovingRailGreenPuller" or
defName="MovingRailPuller"]
</xpath>
<value>
<researchPrerequisites><li>PRF_BeltsII</li></researchPrerequisites>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[
defName="MovingRailStraight" or
defName="MovingRailRight" or
defName="MovingRailLeft"]
</xpath>
<value>
<researchPrerequisites><li>PRF_BeltsI</li></researchPrerequisites>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[
defName="MovingRailUndergroundInput" or
defName="MovingRailWall" or
defName="MovingRailSplitter" or
defName="MovingRailUndergroundOutput"]
</xpath>
<value>
<researchPrerequisites><li>PRF_BeltsIII</li></researchPrerequisites>
</value>
</li>
</operations>
</match>
</Operation>

</Patch>

save and close.

2.Open file in Project RimFactory Lite\Patches\Industrial Rollers\Rollers.xml
Copy the following contents and override all:

<?xml version="1.0" encoding="utf-8" ?>
<Patch>

<!--Clean up Industrial rollers -->
<Operation Class="PatchOperationFindMod">
<mods>
<li>Industrial Rollers</li>
</mods>
<match Class="PatchOperationSequence">
<success>Always</success>
<operations>
<li Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[
defName="MovingRailPusher" or
defName="MovingRailGreenPuller" or
defName="MovingRailPuller"]
</xpath>
<value>
<designatorDropdown>PRF_PullersGroup</designatorDropdown>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[
defName="MovingRailStraight" or
defName="MovingRailRight" or
defName="MovingRailSplitter" or
defName="MovingRailLeft"]
</xpath>
<value>
<designatorDropdown>PRF_BeltsGroup</designatorDropdown>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[
defName="MovingRailUndergroundInput" or
defName="MovingRailUndergroundOutput"]
</xpath>
<value>
<designatorDropdown>PRF_UgBeltsGroup</designatorDropdown>
</value>
</li>
</operations>
</match>
</Operation>

<!-- If malkavs Industrial roller Addon mod isnt installed, collapse all IR rollers -->
<Operation Class="PatchOperationFindMod">
<mods>
<li>Industrial Rollers</li>
</mods>
<match Class="PatchOperationFindMod">
<mods>
<li>Industrial Rollers Addon</li>
</mods>
<nomatch Class="PatchOperationSequence">
<success>Always</success>
<operations>
<li Class="PatchOperationReplace">
<xpath>/Defs/ThingDef[
defName="MovingRailUndergroundInput" or
defName="MovingRailUndergroundOutput"]/designatorDropdown
</xpath>
<value>
<designatorDropdown>Rails_gr</designatorDropdown>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[defName="MovingRailWall"]</xpath>
<value>
<designatorDropdown>Rails_gr</designatorDropdown>
</value>
</li>
</operations>
</nomatch>
</match>
</Operation>

</Patch>

save and close.

OK
Last edited by HawnHan; 24 Jun, 2021 @ 2:20am