<li Class="PatchOperationFindMod"> doesn't work

Started by alexiltabaccaio, October 19, 2019, 06:16:36 AM

Previous topic - Next topic

alexiltabaccaio

Hi guys.
I'm trying to ask to rimworld to add a research prerequisite to TableBasicProsthetic but only if Medical System Expansion mod is not active.
It doens't work. why?

<?xml version="1.0" encoding="utf-8" ?>
<Patch>
   <Operation Class="PatchOperationFindMod">
      <mods>
         <li>Expanded Prosthetics and Organ Engineering</li>
      </mods>
      <match Class="PatchOperationSequence">
         <success>Always</success>
            <operations>
         
      <!--Change Tab>-->

      <!--BasicProsthetics-->

             <li Class="PatchOperationReplace">
               <xpath>Defs/ResearchProjectDef[defName="BasicProsthetics"]/tab</xpath>
                 <value>
                   <tab>AiT_tab_Prosthetics</tab>
                 </value>
            </li>

      <!--Prosthetics-->

             <li Class="PatchOperationReplace">
               <xpath>Defs/ResearchProjectDef[defName="Prosthetics"]/tab</xpath>
                 <value>
                   <tab>AiT_tab_Prosthetics</tab>
                 </value>
            </li>

      <!--Bionics-->

             <li Class="PatchOperationReplace">
               <xpath>Defs/ResearchProjectDef[defName="Bionics"]/tab</xpath>
                 <value>
                   <tab>AiT_tab_Prosthetics</tab>
                 </value>
            </li>

      <!--SurrogateOrgans-->

             <li Class="PatchOperationReplace">
               <xpath>Defs/ResearchProjectDef[defName="SurrogateOrgans"]/tab</xpath>
                 <value>
                   <tab>AiT_tab_Prosthetics</tab>
                 </value>
            </li>

      <!--RibReplacements-->

             <li Class="PatchOperationReplace">
               <xpath>Defs/ResearchProjectDef[defName="RibReplacements"]/tab</xpath>
                 <value>
                   <tab>AiT_tab_Prosthetics</tab>
                 </value>
            </li>

      <!--AdvancedBionics-->

             <li Class="PatchOperationReplace">
               <xpath>Defs/ResearchProjectDef[defName="AdvancedBionics"]/tab</xpath>
                 <value>
                   <tab>AiT_tab_Prosthetics</tab>
                 </value>
            </li>

      <!--SyntheticOrgans-->

             <li Class="PatchOperationReplace">
               <xpath>Defs/ResearchProjectDef[defName="SyntheticOrgans"]/tab</xpath>
                 <value>
                   <tab>AiT_tab_Prosthetics</tab>
                 </value>
            </li>

      <!--BrainSurgery-->

             <li Class="PatchOperationReplace">
               <xpath>Defs/ResearchProjectDef[defName="BrainSurgery"]/tab</xpath>
                 <value>
                   <tab>AiT_tab_Prosthetics</tab>
                 </value>
            </li>

      <!--END Change Tab-->

      <!--Empty Old Tab Removed-->

             <li Class="PatchOperationRemove">
               <xpath>Defs/ResearchTabDef[defName="EPOE"]</xpath>
            </li>

        <!--Empty Basic prosthetics Fix-->

               <li Class="PatchOperationFindMod">
                <mods>
                 <li>Medical System Expansion</li>
                </mods>
                <match Class="PatchOperationSequence">
                 <success>Invert</success> <!--See EPOE MSE for Info-->
                    <operations>
                  <li Class="PatchOperationAdd">
                   <xpath>Defs/ThingDef[defName="TableBasicProsthetic"]</xpath>
                     <value>
                      <researchPrerequisites><li>BasicProsthetics</li></researchPrerequisites>
                    </value>     
                  </li>
               </operations>
              </match>
            </li>

         </operations>      
      </match>
   </Operation>
</Patch>

alexiltabaccaio

guys, my fault.

I replaced match with nomatch and Invert with Always. Now everything is okay!