Patch operation Verse.PatchOperationFindMod failed

Started by EnderNyktos, April 03, 2024, 02:47:50 PM

Previous topic - Next topic

EnderNyktos

Hello, I'm trying to learn how to create a mod. Starting on something simple, but I have these errors, and idk what else can i do.

File:

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

   <Operation Class="PatchOperationFindMod">
      <mods>
         <li>Core</li>
      </mods>
      
      <match Class="PatchOperationSequence">
         <operations>
         
            <!-- Centipede -->
            <li Class="PatchOperationReplace">
            <xpath>/Defs/ThingDef[@Name="MechCentipede"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>20</Steel>
                     <ChunkSlagSteel>2</ChunkSlagSteel>
                     <Plasteel>20</Plasteel>
                     <Gold>10</Gold>
                     <ComponentIndustrial>1</ComponentIndustrial>
                  </butcherProducts>
               </value>
            </li>
            
            <!-- Lancer - fast mid-range shooter -->
            <li Class="PatchOperationReplace">
            <xpath>/Defs/ThingDef[defName="Mech_Lancer"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>10</Steel>
                     <ChunkSlagSteel>1</ChunkSlagSteel>
                     <Plasteel>15</Plasteel>
                     <Gold>5</Gold>
                  </butcherProducts>
               </value>
            </li>
            
            <!-- Scyther - fast melee -->
            <li Class="PatchOperationReplace">
            <xpath>/Defs/ThingDef[defName="Mech_Scyther"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>15</Steel>
                     <ChunkSlagSteel>1</ChunkSlagSteel>
                     <Plasteel>10</Plasteel>
                  </butcherProducts>
               </value>
            </li>
            
            <!-- Pikeman - slow sniper weak at close range -->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="Mech_Pikeman"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>15</Steel>
                     <ChunkSlagSteel>1</ChunkSlagSteel>
                     <Plasteel>15</Plasteel>
                     <Gold>5</Gold>
                     <ComponentIndustrial>1</ComponentIndustrial>
                  </butcherProducts>
               </value>
            </li>
               
            <!--Termite-->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="Mech_Termite"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>15</Steel>
                     <ChunkSlagSteel>2</ChunkSlagSteel>
                     <Plasteel>15</Plasteel>
                     <Gold>10</Gold>
                     <ComponentIndustrial>1</ComponentIndustrial>
                  </butcherProducts>
               </value>
            </li>
         </operations>
      </match>
   </Operation>
</Patch>

Error:

Quote[Better VFEM Loot] Patch operation Verse.PatchOperationFindMod(Core) failed
file: D:\Steam\steamapps\common\RimWorld\Mods\Better VFEM Loot\Patches\Core\Core Mechs.xml
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch1 (string)
Verse.PatchOperation:Complete (string)
Verse.LoadedModManager:ClearCachedPatches ()
Verse.LoadedModManager:LoadAllActiveMods ()
Verse.PlayDataLoader:DoPlayLoad ()
Verse.PlayDataLoader:LoadAllPlayData (bool)
Verse.Root/<>c:<Start>b__6_1 ()
Verse.LongEventHandler:RunEventFromAnotherThread (System.Action)
Verse.LongEventHandler/<>c:<UpdateCurrentAsynchronousEvent>b__27_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 ()


2nd File:

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

   <Operation Class="PatchOperationFindMod">
      <mods>
         <li>Vanilla Factions Expanded - Mechanoids</li>
      </mods>

      <match Class="PatchOperationSequence">
         <operations>
         
            <!-- Carpenter - slow deconstructor -->
            <li Class="PatchOperationReplace">
            <xpath>/Defs/ThingDef[defName="VFE_AncientMech_AncientCarpenter"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>20</Steel>
                     <ChunkSlagSteel>3</ChunkSlagSteel>
                     <Plasteel>20</Plasteel>
                     <Gold>10</Gold>
                     <ComponentIndustrial>1</ComponentIndustrial>
                  </butcherProducts>
               </value>
            </li>
         
            <!-- Centipede -->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="VFE_Mech_Centipede"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>20</Steel>
                     <ChunkSlagSteel>2</ChunkSlagSteel>
                     <Plasteel>20</Plasteel>
                     <Gold>10</Gold>
                     <ComponentIndustrial>2</ComponentIndustrial>
                  </butcherProducts>
               </value>
            </li>
         
            <!-- Lancer - fast mid-range shooter -->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="VFE_Mech_Lancer"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>10</Steel>
                     <ChunkSlagSteel>1</ChunkSlagSteel>
                     <Plasteel>15</Plasteel>
                     <Gold>5</Gold>
                     <ComponentIndustrial>1</ComponentIndustrial>
                  </butcherProducts>
               </value>
            </li>
         
            <!-- Knight - slow short-range shooter -->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="VFE_Mech_Knight"]/butcherProducts</xpath>
               <value>
                  <butcherProducts>
                     <Steel>20</Steel>
                     <ChunkSlagSteel>1</ChunkSlagSteel>
                     <Plasteel>15</Plasteel>
                     <ComponentIndustrial>1</ComponentIndustrial>
                  </butcherProducts>
               </value>
            </li>
         
            <!-- Inquisitor - armored short-range flamer -->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="VFE_Mech_Inquisitor"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>20</Steel>
                     <ChunkSlagSteel>1</ChunkSlagSteel>
                     <Plasteel>10</Plasteel>
                     <ComponentIndustrial>2</ComponentIndustrial>
                  </butcherProducts>
               </value>
            </li>
         
            <!-- Scyther - fast melee -->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="VFE_Mech_Scyther"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>15</Steel>
                     <ChunkSlagSteel>1</ChunkSlagSteel>
                     <Plasteel>10</Plasteel>
                     <ComponentIndustrial>1</ComponentIndustrial>
                  </butcherProducts>
               </value>
            </li>
         
            <!-- Pikeman - slow sniper weak at close range -->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="VFE_Mech_Pikeman"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>15</Steel>
                     <ChunkSlagSteel>1</ChunkSlagSteel>
                     <Plasteel>15</Plasteel>
                     <Gold>5</Gold>
                     <ComponentIndustrial>1</ComponentIndustrial>
                  </butcherProducts>
               </value>
            </li>
         
            <!-- Carpenter - slow deconstructor -->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="VFE_Mech_Carpenter"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>20</Steel>
                     <ChunkSlagSteel>3</ChunkSlagSteel>
                     <Plasteel>20</Plasteel>
                     <Gold>10</Gold>
                     <ComponentIndustrial>2</ComponentIndustrial>
                  </butcherProducts>
               </value>
            </li>
         
            <!--Termite-->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="VFE_Mech_Termite"]/butcherProducts</xpath>
               <value>
                  <butcherProducts>
                     <Steel>15</Steel>
                     <ChunkSlagSteel>2</ChunkSlagSteel>
                     <Plasteel>15</Plasteel>
                     <Gold>10</Gold>
                     <ComponentIndustrial>2</ComponentIndustrial>
                  </butcherProducts>
               </value>
            </li>
            
            <!-- Advanced Centipede -->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="VFE_Mech_AdvancedCentipede"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>30</Steel>
                     <ChunkSlagSteel>2</ChunkSlagSteel>
                     <Plasteel>30</Plasteel>
                     <Gold>15</Gold>
                     <ComponentSpacer>2</ComponentSpacer>
                  </butcherProducts>
               </value>
            </li>

            <!-- Advanced Lancer - fast mid-range shooter -->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="VFE_Mech_AdvancedLancer"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>20</Steel>
                     <ChunkSlagSteel>1</ChunkSlagSteel>
                     <Plasteel>25</Plasteel>
                     <Gold>10</Gold>
                     <ComponentSpacer>1</ComponentSpacer>
                  </butcherProducts>
               </value>
            </li>
            
            <!-- Advanced Knight - slow short-range shooter -->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="VFE_Mech_AdvancedKnight"]/butcherProducts</xpath>
               <value>
                  <butcherProducts>
                     <Steel>30</Steel>
                     <ChunkSlagSteel>1</ChunkSlagSteel>
                     <Plasteel>25</Plasteel>
                     <Gold>5</Gold>
                     <ComponentSpacer>1</ComponentSpacer>
                  </butcherProducts>
               </value>
            </li>

            <!-- Advanced Inquisitor - armored short-range flamer -->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="VFE_Mech_AdvancedInquisitor"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>30</Steel>
                     <ChunkSlagSteel>1</ChunkSlagSteel>
                     <Plasteel>20</Plasteel>
                     <Gold>5</Gold>
                     <ComponentIndustrial>1</ComponentIndustrial>
                     <ComponentSpacer>1</ComponentSpacer>
                  </butcherProducts>
               </value>
            </li>

            <!-- Advanced Scyther - fast melee -->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="VFE_Mech_AdvancedScyther"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>25</Steel>
                     <ChunkSlagSteel>1</ChunkSlagSteel>
                     <Plasteel>20</Plasteel>
                     <ComponentSpacer>1</ComponentSpacer>
                  </butcherProducts>
               </value>
            </li>
            
            <!-- Advanced Pikeman - slow sniper weak at close range -->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="VFE_Mech_AdvancedPikeman"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>25</Steel>
                     <ChunkSlagSteel>1</ChunkSlagSteel>
                     <Plasteel>25</Plasteel>
                     <Gold>10</Gold>
                     <ComponentSpacer>1</ComponentSpacer>
                  </butcherProducts>
               </value>
            </li>
            
            <!-- Advanced Carpenter - slow deconstructor -->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="VFE_Mech_AdvancedCarpenter"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>30</Steel>
                     <ChunkSlagSteel>3</ChunkSlagSteel>
                     <Plasteel>30</Plasteel>
                     <Gold>15</Gold>
                     <ComponentSpacer>2</ComponentSpacer>
                  </butcherProducts>
               </value>
            </li>
            
            <!--Advanced Termite-->
            <li Class="PatchOperationReplace">
               <xpath>/Defs/ThingDef[defName="VFE_Mech_AdvTermite"]/butcherProducts</xpath>
               <value>   
                  <butcherProducts>
                     <Steel>25</Steel>
                     <ChunkSlagSteel>2</ChunkSlagSteel>
                     <Plasteel>25</Plasteel>
                     <Gold>20</Gold>
                     <ComponentSpacer>2</ComponentSpacer>
                  </butcherProducts>
               </value>
            </li>
         </operations>
      </match>
   </Operation>
</Patch>

2nd Error:

Quote[Better VFEM Loot] Patch operation Verse.PatchOperationFindMod(Vanilla Factions Expanded - Mechanoids) failed
file: D:\Steam\steamapps\common\RimWorld\Mods\Better VFEM Loot\Patches\VFE.Mechanoid\Loot_VFEMechanoid.xml
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch1 (string)
Verse.PatchOperation:Complete (string)
Verse.LoadedModManager:ClearCachedPatches ()
Verse.LoadedModManager:LoadAllActiveMods ()
Verse.PlayDataLoader:DoPlayLoad ()
Verse.PlayDataLoader:LoadAllPlayData (bool)
Verse.Root/<>c:<Start>b__6_1 ()
Verse.LongEventHandler:RunEventFromAnotherThread (System.Action)
Verse.LongEventHandler/<>c:<UpdateCurrentAsynchronousEvent>b__27_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 ()

Thanks in advance