Hello,
I was about to patch Royalty to make nobles accept apparel from my mod. I tried to patch the expansion and want it only to do so if Royalty is enabled. The error log told me it failed to execute the patch operation even if Royalty is enabled:
Here is the patch file:
Did I miss something or does patching work differently now than in older versions of RimWorld?
Thank You
I was about to patch Royalty to make nobles accept apparel from my mod. I tried to patch the expansion and want it only to do so if Royalty is enabled. The error log told me it failed to execute the patch operation even if Royalty is enabled:
Code Select
[Ancient Rim - Oriental/Desert Edition (unfinished)] Patch operation Verse.PatchOperationFindMod(Royalty) failed
file: C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\AR_Orient\1.1\Patches\Royality.xml
Verse.Log:Error(String, Boolean)
Verse.PatchOperation:Complete(String)
Verse.LoadedModManager:ClearCachedPatches()
Verse.LoadedModManager:LoadAllActiveMods()
Verse.PlayDataLoader:DoPlayLoad()
Verse.PlayDataLoader:LoadAllPlayData(Boolean)
Verse.<>c:<Start>b__6_1()
Verse.LongEventHandler:RunEventFromAnotherThread(Action)
Verse.<>c:<UpdateCurrentAsynchronousEvent>b__27_0()
System.Threading.ThreadHelper:ThreadStart_Context(Object)
System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object, Boolean)
System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object)
System.Threading.ThreadHelper:ThreadStart()
Here is the patch file:
Code Select
<?xml version="1.0" encoding="utf-8" ?>
<Patch>
<Operation Class="PatchOperationFindMod">
<mods>
<li>Royalty</li>
</mods>
<match Class="PatchOperationSequence">
<!--success>Always</success-->
<operations>
<!-- Esquire -->
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Esquire"]/requiredApparel/li[1]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Esquire"]/requiredApparel/li[2]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<!-- Knight -->
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Knight"]/requiredApparel/li[1]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Knight"]/requiredApparel/li[2]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<!-- Praetor -->
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Praetor"]/requiredApparel/li[1]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Praetor"]/requiredApparel/li[2]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<!-- Baron -->
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Baron"]/requiredApparel/li[1]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Baron"]/requiredApparel/li[2]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<!-- Count -->
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Count"]/requiredApparel/li[1]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Count"]/requiredApparel/li[2]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<!-- Duke -->
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Duke"]/requiredApparel/li[1]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Duke"]/requiredApparel/li[2]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<!-- Consul -->
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Consul"]/requiredApparel/li[1]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Consul"]/requiredApparel/li[2]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<!-- Stellarch -->
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Stellarch"]/requiredApparel/li[1]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Stellarch"]/requiredApparel/li[2]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<!-- Emperor -->
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Emperor"]/requiredApparel/li[1]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/RoyalTitleDef[defName = "Emperor"]/requiredApparel/li[2]/allowedTags</xpath>
<value>
<li>EgyptianNoble</li>
<li>EgyptianRoyal</li>
</value>
</li>
</operations>
</match>
</Operation>
</Patch>
Did I miss something or does patching work differently now than in older versions of RimWorld?
Thank You