Vanilla-Expanded / VanillaExpanded-RoyaltyPatches

1 stars 1 forks source link

Latest Update broke VFESpacer_Empire.xml #1

Open hcribeiro opened 1 year ago

hcribeiro commented 1 year ago

The latest update, (f887d5b) seems to have broken VFESpacer_Empire.xml.

[Vanilla Expanded - Royalty Patches - Start of stack trace]
Verse.PatchOperationReplace(xpath="/Defs/RoyalTitleDef[@ParentName="DukeBase" or defName = "VFEE_Archcount" or @ParentName="ConsulBase" or defName = "VFEE_Marquess" or defName = "VFEE_Archduke" or defName = "VFEE_Magister" or defName = "VFEE_Despot" or defName = "VFEE_HighStellarch"]/bedroomRequirements/li[@Class="RoomRequirement_ThingAnyOf"][things/li="EndTable"]/things"): Failed to find a node with the given xpath
Verse.PatchOperationSequence: Error in the operation at position=2
Verse.PatchOperationFindMod(Vanilla Furniture Expanded - Spacer Module): Error in <match>
Verse.PatchOperationSequence: Error in the operation at position=1
Verse.PatchOperationFindMod(Vanilla Factions Expanded - Empire): 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:\SteamLibrary\steamapps\workshop\content\294100\2260012940\1.4\Patches\VFESpacer_Empire.xml

UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
XmlExtensions.ErrorManager:PrintErrors (string,Verse.ModContentPack)
XmlExtensions.PatchOperation_Patch:Postfix (Verse.PatchOperation,bool&,System.Xml.XmlDocument)
(wrapper dynamic-method) Verse.PatchOperation:Verse.PatchOperation.Apply_Patch2 (Verse.PatchOperation,System.Xml.XmlDocument)
(wrapper dynamic-method) Verse.LoadedModManager:Verse.LoadedModManager.ApplyPatches_Patch2 (System.Xml.XmlDocument,System.Collections.Generic.Dictionary`2<System.Xml.XmlNode, Verse.LoadableXmlAsset>)
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 ()

Others in Steam have also noticed this bug.

hcribeiro commented 1 year ago

Managed to get things running by modifying some files: VFESpacer_Empire.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Patch>
    <Operation Class="PatchOperationFindMod">
        <mods>
            <li>Vanilla Factions Expanded - Empire</li>
        </mods>
        <match Class="PatchOperationSequence">
            <operations>
                <li Class="PatchOperationFindMod">
                    <mods>
                        <li>Vanilla Furniture Expanded - Spacer Module</li>
                    </mods>
                    <match Class="PatchOperationSequence">
                        <operations>
                            <li Class="PatchOperationAdd">
                                <xpath>/Defs/RoyalTitleDef[@ParentName="DukeBase" or defName = "VFEE_Archcount" or @ParentName="ConsulBase" or defName = "VFEE_Marquess" or defName = "VFEE_Archduke" or  defName = "VFEE_Magister" or defName = "VFEE_Despot" or defName = "VFEE_HighStellarch"]/bedroomRequirements/li[@Class="RoomRequirement_ThingAnyOf"][disablingPrecepts/li="SlabBed_Preferred"]/things</xpath>
                                <value>
                                    <li>Bed_Kingsize</li>
                                    <li>Bed_DoubleErgonomic</li>
                                    <li>Bed_AdvDoubleBed</li>
                                </value>
                            </li>
                            <li Class="PatchOperationReplace">
                                <xpath>/Defs/RoyalTitleDef[@ParentName="DukeBase" or defName = "VFEE_Archcount" or @ParentName="ConsulBase" or defName = "VFEE_Marquess" or defName = "VFEE_Archduke" or defName = "VFEE_Magister" or defName = "VFEE_Despot" or defName = "VFEE_HighStellarch"]/bedroomRequirements//li[@Class="RoomRequirement_Thing"][thingDef="EndTable"]</xpath>
                                <value>
                                    <li Class="RoomRequirement_ThingAnyOf">
                                        <things>
                                            <li>EndTable</li>
                                            <li>Table_LightEndTable</li>
                                            <li>Table_IlluminatedEndTable</li>
                                            <li>Table_RoyalEndTable</li>
                                        </things>
                                    </li>
                                </value>
                            </li>
                            <li Class="PatchOperationReplace">
                                <xpath>/Defs/RoyalTitleDef[@ParentName="DukeBase" or defName = "VFEE_Archcount" or @ParentName="ConsulBase" or defName = "VFEE_Marquess" or defName = "VFEE_Archduke" or defName = "VFEE_Magister" or defName = "VFEE_Despot" or defName = "VFEE_HighStellarch"]/bedroomRequirements//li[@Class="RoomRequirement_Thing"][thingDef="Dresser"]</xpath>
                                <value>
                                    <li Class="RoomRequirement_ThingAnyOf">
                                        <things>
                                            <li>Dresser</li>
                                            <li>Table_IlluminatedDresser</li>
                                            <li>Table_RoyalDresser</li>
                                        </things>
                                    </li>
                                </value>
                            </li>
                        </operations>
                    </match>
                    <nomatch Class="PatchOperationSequence">
                        <operations>
                            <li Class="PatchOperationFindMod">
                                <mods>
                                    <li>Vanilla Furniture Expanded</li>
                                </mods>
                                <match Class="PatchOperationSequence">
                                    <operations>
                                        <li Class="PatchOperationReplace">
                                            <xpath>Defs/RoyalTitleDef[@ParentName="DukeBase" or defName = "VFEE_Archcount" or @ParentName="ConsulBase" or defName = "VFEE_Marquess" or defName = "VFEE_Archduke" or defName = "VFEE_Magister" or defName = "VFEE_Despot" or defName = "VFEE_HighStellarch"]/bedroomRequirements/li[@Class="RoomRequirement_Thing"][thingDef="EndTable"]/things</xpath>
                                            <value>
                                                <li Class="RoomRequirement_Thing">
                                                    <things>
                                                        <li>EndTable</li>
                                                    </things>
                                                </li>
                                            </value>
                                        </li>
                                        <li Class="PatchOperationReplace">
                                            <xpath>Defs/RoyalTitleDef[@ParentName="DukeBase" or defName = "VFEE_Archcount" or @ParentName="ConsulBase" or defName = "VFEE_Marquess" or defName = "VFEE_Archduke" or defName = "VFEE_Magister" or defName = "VFEE_Despot" or defName = "VFEE_HighStellarch"]/bedroomRequirements/li[@Class="RoomRequirement_Thing"][thingDef="Dresser"]/things</xpath>
                                            <value>
                                                <li Class="RoomRequirement_Thing">
                                                    <things>
                                                        <li>Dresser</li>
                                                    </things>
                                                </li>
                                            </value>
                                        </li>
                                        <li Class="PatchOperationAdd">
                                            <xpath>/Defs/RoyalTitleDef[@ParentName="DukeBase" or defName = "VFEE_Archcount" or @ParentName="ConsulBase or defName = "VFEE_Marquess" or defName = "VFEE_Archduke" or defName = "VFEE_Magister" or defName = "VFEE_Despot" or defName = "VFEE_HighStellarch"]/bedroomRequirements/li[@Class="RoomRequirement_Thing"][disablingPrecepts/li="SlabBed_Preferred"]/things</xpath>
                                            <value>
                                                <li>Bed_DoubleErgonomic</li>
                                                <li>Bed_Kingsize</li>
                                            </value>
                                        </li>
                                        <li Class="PatchOperationAdd">
                                            <xpath>/Defs/RoyalTitleDef[@ParentName="DukeBase" or defName = "VFEE_Archcount" or @ParentName="ConsulBase or defName = "VFEE_Marquess" or defName = "VFEE_Archduke" or defName = "VFEE_Magister" or defName = "VFEE_Despot" or defName = "VFEE_HighStellarch"]/bedroomRequirements/li[@Class="RoomRequirement_Thing"][thingDef="EndTable"]/things</xpath>
                                            <value>
                                                <li>Table_LightEndTable</li>
                                                <li>Table_RoyalEndTable</li>
                                            </value>
                                        </li>
                                        <li Class="PatchOperationAdd">
                                            <xpath>/Defs/RoyalTitleDef[@ParentName="DukeBase" or  defName = "VFEE_Archcount" or @ParentName="ConsulBase or defName = "VFEE_Marquess" or defName = "VFEE_Archduke" or defName = "VFEE_Magister" or defName = "VFEE_Despot" or defName = "VFEE_HighStellarch"]/bedroomRequirements/li[@Class="RoomRequirement_Thing"][thingDef="Dresser"]/things</xpath>
                                            <value>
                                                <li>Table_RoyalDresser</li>
                                            </value>
                                        </li>
                                    </operations>
                                </match>
                            </li>
                        </operations>
                    </nomatch>
                </li>
            </operations>
        </match>
    </Operation>
</Patch>

VFE_Empire.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Patch>
   <Operation Class="PatchOperationFindMod">
      <mods>
         <li>Vanilla Furniture Expanded</li>
      </mods>
      <match Class="PatchOperationSequence">
         <operations>
            <li Class="PatchOperationFindMod">
               <mods>
                  <li>Vanilla Factions Expanded - Empire</li>
               </mods>
               <match Class="PatchOperationSequence">
                  <operations>
                     <li Class="PatchOperationReplace">
                        <xpath>/Defs/RoyalTitleDef[defName = "VFEE_Archcount" or defName = "VFEE_Marquess" or defName = "VFEE_Archduke" or defName = "VFEE_Magister" or defName = "VFEE_Despot" or defName = "VFEE_HighStellarch"]/bedroomRequirements//li[@Class="RoomRequirement_ThingAnyOf"][things/li="EndTable"]</xpath>
                        <value>
                           <li Class="RoomRequirement_ThingAnyOf">
                              <things>
                                 <li>EndTable</li>
                              </things>
                           </li>
                        </value>
                     </li>
                     <li Class="PatchOperationReplace">
                        <xpath>/Defs/RoyalTitleDef[defName = "VFEE_Archcount" or defName = "VFEE_Marquess" or defName = "VFEE_Archduke" or defName = "VFEE_Magister" or defName = "VFEE_Despot" or defName = "VFEE_HighStellarch"]/bedroomRequirements//li[@Class="RoomRequirement_ThingAnyOf"][things/li="Dresser"]</xpath>
                        <value>
                           <li Class="RoomRequirement_ThingAnyOf">
                              <things>
                                 <li>Dresser</li>
                              </things>
                           </li>
                        </value>
                     </li>
                     <li Class="PatchOperationAdd">
                        <xpath>/Defs/RoyalTitleDef[defName = "VFEE_Archcount" or defName = "VFEE_Marquess" or defName = "VFEE_Archduke" or defName = "VFEE_Magister" or defName = "VFEE_Despot" or defName = "VFEE_HighStellarch"]/bedroomRequirements/li[@Class="RoomRequirement_ThingAnyOf"][disablingPrecepts/li="SlabBed_Preferred"]/things</xpath>
                        <value>
                           <li>Bed_Kingsize</li>
                           <li>Bed_DoubleErgonomic</li>
                        </value>
                     </li>
                     <li Class="PatchOperationAdd">
                        <xpath>/Defs/RoyalTitleDef[defName = "VFEE_Archcount" or defName = "VFEE_Marquess" or defName = "VFEE_Archduke" or defName = "VFEE_Magister" or defName = "VFEE_Despot" or defName = "VFEE_HighStellarch"]/bedroomRequirements/li[@Class="RoomRequirement_ThingAnyOf"][things/li="EndTable"]/things</xpath>
                        <value>
                           <li>Table_LightEndTable</li>
                           <li>Table_RoyalEndTable</li>
                        </value>
                     </li>
                     <li Class="PatchOperationAdd">
                        <xpath>/Defs/RoyalTitleDef[defName = "VFEE_Archcount" or defName = "VFEE_Marquess" or defName = "VFEE_Archduke" or defName = "VFEE_Magister" or defName = "VFEE_Despot" or defName = "VFEE_HighStellarch"]/bedroomRequirements/li[@Class="RoomRequirement_ThingAnyOf"][things/li="Dresser"]/things</xpath>
                        <value>
                           <li>Table_RoyalDresser</li>
                        </value>
                     </li>
                  </operations>
               </match>
            </li>
         </operations>
      </match>
   </Operation>
</Patch>
hcribeiro commented 1 year ago

Note that this requires that VFESpacer_Empire.xml load before VFE_Empire.xml. Idk how you guys enforce load order, but that may be necessary.