I'm not sure whats going wrong, there seems to be no way to activate patch related errors or logs of how the patch went through. Ive tried for two days now to try different things and nothing has worked so I give up and here I am. Personally I hate forums for communication, but I am not in any of the discords..
This is the item I am trying to add items to;
This is the patch file;
Essentially, I am trying to make it add those items to the shop list only if that person's mod is detected. The patch system is confusing to me, I'd rather use C# but I don't know how to code.
This is the item I am trying to add items to;
Code Select
<?xml version="1.0" encoding="utf-8"?>
<Defs>
<TraderKindDef>
<defName>Orbital_MedicalGoods</defName>
<label>medical supplier</label>
<commonality>1</commonality>
<orbital>true</orbital>
<stockGenerators>
<li Class="StockGenerator_SingleDef">
<thingDef>Silver</thingDef>
<countRange>
<min>2000</min>
<max>4000</max>
</countRange>
</li>
<li Class="StockGenerator_SingleDef">
<thingDef>Cloth</thingDef>
<countRange>
<min>50</min>
<max>200</max>
</countRange>
</li>
<li Class="StockGenerator_SingleDef">
<thingDef>MedicineIndustrial</thingDef>
<countRange>
<min>100</min>
<max>250</max>
</countRange>
</li>
<li Class="StockGenerator_SingleDef">
<thingDef>MedicineUltratech</thingDef>
<countRange>
<min>25</min>
<max>75</max>
</countRange>
</li>
<li Class="StockGenerator_SingleDef">
<thingDef>Neutroamine</thingDef>
<countRange>
<min>250</min>
<max>750</max>
</countRange>
</li>
<li Class="StockGenerator_SingleDef">
<thingDef>Luciferium</thingDef>
<countRange>
<min>50</min>
<max>200</max>
</countRange>
</li>
<li Class="StockGenerator_SingleDef">
<thingDef>Penoxycyline</thingDef>
<countRange>
<min>100</min>
<max>300</max>
</countRange>
</li>
</stockGenerators>
</TraderKindDef>
</Defs>
This is the patch file;
Code Select
<?xml version="1.0" encoding="utf-8" ?>
<Patch>
<Operation Class="PatchOperationSequence">
<success>Normal</success>
<operations>
<li Class="PatchOperationTest">
<xpath>/Defs/ThingDef[defName = "AntiparasiticalBooster"]</xpath> <!-- Test if this item exists -->
<success>Normal</success>
</li>
<li Class="PatchOperationAdd"> <!-- If the item above exists, add the below values to my trader's stock -->
<xpath>/Defs/TraderKindDef[defName = "Orbital_MedicalGoods"]/stockGenerators</xpath>
<value>
<li Class="StockGenerator_SingleDef">
<thingDef>AntiparasiticalBooster</thingDef>
<countRange>
<min>30</min>
<max>80</max>
</countRange>
</li>
</value>
</li>
</operations>
</Operation>
<Operation Class="PatchOperationSequence">
<success>Normal</success>
<operations>
<li Class="PatchOperationTest">
<xpath>/Defs/ThingDef[defName = "HerbalImmunityBooster"]</xpath> <!-- Test if this item exists -->
<success>Normal</success>
</li>
<li Class="PatchOperationAdd"> <!-- If the item above exists, add the below values to my trader's stock -->
<xpath>/Defs/TraderKindDef[defName = "Orbital_MedicalGoods"]/stockGenerators</xpath>
<value>
<li Class="StockGenerator_SingleDef">
<thingDef>HerbalImmunityBooster</thingDef>
<countRange>
<min>45</min>
<max>90</max>
</countRange>
</li>
</value>
</li>
</operations>
</Operation>
<Operation Class="PatchOperationSequence">
<success>Normal</success>
<operations>
<li Class="PatchOperationTest">
<xpath>/Defs/ThingDef[defName = "ConcentratedImmunityBooster"]</xpath> <!-- Test if this item exists -->
<success>Normal</success>
</li>
<li Class="PatchOperationAdd"> <!-- If the item above exists, add the below values to my trader's stock -->
<xpath>/Defs/TraderKindDef[defName = "Orbital_MedicalGoods"]/stockGenerators</xpath>
<value>
<li Class="StockGenerator_SingleDef">
<thingDef>ConcentratedImmunityBooster</thingDef>
<countRange>
<min>20</min>
<max>60</max>
</countRange>
</li>
</value>
</li>
</operations>
</Operation>
</Patch>
Essentially, I am trying to make it add those items to the shop list only if that person's mod is detected. The patch system is confusing to me, I'd rather use C# but I don't know how to code.