RimWorld

RimWorld

Celsius Patches
Bugs
[RF] Concrete (Continued).xml
Line 41:
Instead of
RFFPlaticreteEmbrasure
it should be
RFFPlasticreteEmbrasure

Additionally:
There is a mod for a mod, Concrete Patches , one that modernizes [RF] Concrete (Continued), provides additional options, like disabling embrasures, as well as compatibility with other mods, like Soil Relocation Framework.

https://steamhost.cn/steamcommunity_com/workshop/filedetails/discussion/2012397587/4356745862498490708/

https://github.com/Mlg-arch/ConcretePatches

However, when using this mod, specifically options that remove certain things, causes errors with [RF] Concrete (Continued).xml patch. Below an example with embrasures set to disabled:
When an option is disabled, Concrete Patches removes the definition via:
<Operation Class="XmlExtensions.PatchOperationSafeRemove"> <xpath>Defs/ThingDef[defName="Embrasure"]</xpath> </Operation>

This in turn causes the following errors:

[Celsius Patches - Start of stack trace] Verse.PatchOperationAddModExtension(xpath="Defs/ThingDef[defName="Embrasure"]"): Failed to find a node with the given xpath Verse.PatchOperationSequence: Error in the operation at position=3 Verse.PatchOperationFindMod([RF] Concrete (Continued)): Error in <match> [End of stack trace] The top operation is the one that failed, the ones below it are the parents Source file: D:\games\RimWorld\Mods\3072081544\1.5\Patches\Mods\[RF] Concrete (Continued).xml UnityEngine.StackTraceUtility:ExtractStackTrace () (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch4 (string) XmlExtensions.ErrorManager:PrintErrors (string,Verse.ModContentPack) XmlExtensions.PatchOperation_Patch:Postfix (Verse.PatchOperation,bool&,System.Xml.XmlDocument) (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.PatchOperation.Apply_Patch2 (Verse.PatchOperation,System.Xml.XmlDocument) (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.LoadedModManager.ApplyPatches_Patch8 (System.Xml.XmlDocument,System.Collections.Generic.Dictionary`2<System.Xml.XmlNode, Verse.LoadableXmlAsset>) Verse.LoadedModManager:LoadAllActiveMods (bool) Verse.PlayDataLoader:DoPlayLoad () Verse.PlayDataLoader:LoadAllPlayData (bool) Verse.Root/<>c:<Start>b__6_1 () Verse.LongEventHandler:RunEventFromAnotherThread (System.Action) Verse.LongEventHandler/<>c:<UpdateCurrentAsynchronousEvent>b__28_0 () System.Threading.ThreadHelper:ThreadStart_Context (object) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) System.Threading.ThreadHelper:ThreadStart () [Celsius Patches] Patch operation Verse.PatchOperationFindMod([RF] Concrete (Continued)) failed file: D:\games\RimWorld\Mods\3072081544\1.5\Patches\Mods\[RF] Concrete (Continued).xml UnityEngine.StackTraceUtility:ExtractStackTrace () (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch4 (string) Verse.PatchOperation:Complete (string) (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.LoadedModManager.ClearCachedPatches_Patch3 () Verse.LoadedModManager:LoadAllActiveMods (bool) Verse.PlayDataLoader:DoPlayLoad () Verse.PlayDataLoader:LoadAllPlayData (bool) Verse.Root/<>c:<Start>b__6_1 () Verse.LongEventHandler:RunEventFromAnotherThread (System.Action) Verse.LongEventHandler/<>c:<UpdateCurrentAsynchronousEvent>b__28_0 () System.Threading.ThreadHelper:ThreadStart_Context (object) System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) System.Threading.ThreadHelper:ThreadStart ()


To avoid this, and make it compatibile with both, I have rewritten [RF] Concrete (Continued).xml, using PatchOperationConditional, hopefully correctly...
XML below, a bit unsure if ThingDef were set correctly but errors are gone, for both disabled and enabled options.

<?xml version="1.0" encoding="utf-8"?> <Patch> <Operation Class="PatchOperationFindMod"> <mods> <li>[RF] Concrete (Continued)</li> </mods> <match Class="PatchOperationSequence"> <operations> <li Class="PatchOperationConditional"> <xpath>Defs/ThingDef/RFC_WallBase[defName="RFFConcreteWall" or defName="RFFReinforcedConcreteWall" or defName="RFFPlasticreteWall"]</xpath> <match Class="PatchOperationAddModExtension"> <value> <li Class="Celsius.ThingThermalProperties"> <heatCapacity>8</heatCapacity> <insulation>6</insulation> </li> </value> </match> </li> <li Class="PatchOperationConditional"> <xpath>Defs/ThingDef/RFC_DoorBase[defName="RFFConcreteDoor" or defName="RFFConcreteAutodoor" or defName="RFFPlasticreteDoor" or defName="RFFPlasticreteAutodoor"]</xpath> <match Class="PatchOperationAddModExtension"> <value> <li Class="Celsius.ThingThermalProperties"> <heatCapacity>6</heatCapacity> <insulation>4</insulation> <airflowWhenOpen>0.75</airflowWhenOpen> </li> </value> </match> </li> <li Class="PatchOperationConditional"> <xpath>Defs/ThingDef/RFC_EmbrasureBase[defName="Embrasure"]</xpath> <match Class="PatchOperationAddModExtension"> <value> <li Class="Celsius.ThingThermalProperties"> <heatCapacity>7</heatCapacity> <insulation>5</insulation> <volume>.01</volume> <airflow>0.25</airflow> </li> </value> </match> </li> <li Class="PatchOperationConditional"> <xpath>Defs/ThingDef/RFC_EmbrasureBase[defName="BrickEmbrasure" or defName="RFFConcreteEmbrasure" or defName="RFFPlasticreteEmbrasure"]</xpath> <match Class="PatchOperationAddModExtension"> <value> <li Class="Celsius.ThingThermalProperties"> <heatCapacity>7</heatCapacity> <insulation>5</insulation> <airflow>0.25</airflow> </li> </value> </match> </li> <li Class="PatchOperationConditional"> <xpath>Defs/ThingDef/ResourceBase_Concrete[defName="RFFBlocksConcrete"]</xpath> <match Class="PatchOperationAddModExtension"> <value> <li Class="Celsius.StuffThermalProperties"> <volumetricHeatCapacity>1100</volumetricHeatCapacity> <insulationFactor>0.8</insulationFactor> </li> </value> </match> </li> </operations> </match> </Operation> </Patch>
Last edited by Jasser_Arrafat; 12 Jul @ 8:56am