RimWorld

RimWorld

Vanometric Cell Combining
Gariba 8 Jan, 2021 @ 12:49pm
Error at startup
I'm getting this error at startup (using Royalty, VFE - Power, VFE - Mechanoids and Save Our Ship 2:

XML error: Duplicate XML node name researchPrerequisites in this XML block: <ThingDef ParentName="BuildingBase"><defName>VanometricPowerCell</defName><label>vanometric power cell</label><description>Generates free energy, forever, without using fuel. This technology is developed by archotechs, and is beyond even most glitterworld societies. While nobody knows exactly how it works, scholars believe it somehow extracts energy directly from fluctuations in the quantum foam.</description><graphicData><texPath>Things/Building/Special/VanometricPowerCell</texPath><graphicClass>Graphic_Multi</graphicClass><drawSize>(2, 3)</drawSize><damageData><cornerTL>Damage/Corner</cornerTL><cornerTR>Damage/Corner</cornerTR><cornerBL>Damage/Corner</cornerBL><cornerBR>Damage/Corner</cornerBR></damageData></graphicData><altitudeLayer>Building</altitudeLayer><pathCost>42</pathCost><fillPercent>0.4</fillPercent><passability>PassThroughOnly</passability><leaveResourcesWhenKilled>false</leaveResourcesWhenKilled><canOverlapZones>false</canOverlapZones><castEdgeShadows>true</castEdgeShadows><staticSunShadowHeight>0.5</staticSunShadowHeight><terrainAffordanceNeeded>Medium</terrainAffordanceNeeded><thingCategories><li>BuildingsSpecial</li></thingCategories><statBases><MarketValue>1200</MarketValue><MaxHitPoints>200</MaxHitPoints><Flammability>0</Flammability><Mass>15</Mass></statBases><tickerType>Normal</tickerType><size>(1, 2)</size><costList><Steel>100</Steel><ComponentSpacer>6</ComponentSpacer><ArchotechExoticParticles>4</ArchotechExoticParticles><VanometricPowerCore>2</VanometricPowerCore></costList><comps><li Class="CompProperties_Power"><compClass>CompPowerPlant</compClass><basePowerConsumption>-1000</basePowerConsumption><transmitsPower>true</transmitsPower></li><li Class="CompProperties_Glower"><glowRadius>3</glowRadius><glowColor>(227,233,168,0)</glowColor></li></comps><thingSetMakerTags><li>RewardStandardHighFreq</li><li>RewardStandardArtifact</li></thingSetMakerTags><minifiedDef>MinifiedThing</minifiedDef><tradeability>Sellable</tradeability><tradeTags><li>ExoticBuilding</li></tradeTags><researchPrerequisites><li>ArchotechVanometrics</li></researchPrerequisites><designationCategory>Power</designationCategory><researchPrerequisites><li>VanometricTinkering</li></researchPrerequisites><designationCategory>Power</designationCategory></ThingDef> Verse.Log:Verse.Log.Error_Patch2(String, Boolean) Verse.XmlInheritance:CheckForDuplicateNodes(XmlNode, XmlNode) Verse.XmlInheritance:ResolveXmlNodeFor(XmlInheritanceNode) Verse.XmlInheritance:ResolveXmlNodesRecursively(XmlInheritanceNode) Verse.XmlInheritance:ResolveXmlNodesRecursively(XmlInheritanceNode) Verse.XmlInheritance:ResolveXmlNodes() Verse.XmlInheritance:Resolve() Verse.LoadedModManager:ParseAndProcessXML(XmlDocument, Dictionary`2) Verse.LoadedModManager:LoadAllActiveMods() Verse.PlayDataLoader:DoPlayLoad() Verse.PlayDataLoader:LoadAllPlayData(Boolean) Verse.<>c:<Start>b__6_1() Verse.LongEventHandler:RunEventFromAnotherThread(Action) Verse.<>c:<UpdateCurrentAsynchronousEvent>b__27_0() System.Threading.ThreadHelper:ThreadStart_Context(Object) System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean) System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object, Boolean) System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object) System.Threading.ThreadHelper:ThreadStart()
< >
Showing 1-3 of 3 comments
esev  [developer] 8 Jan, 2021 @ 4:03pm 
its because sos 2 and my mod both define which research 2x1 vanometric cells are unlocked at. my mod changes it to after SOS2s research. does nothing else
Kayedon 8 Jan, 2021 @ 8:00pm 
As an idea, you could do a match/nomatch for SOS2, and move all research there. So:

<Operation Class="PatchOperationFindMod">
<mods><li>Save Our Ship 2</li></mods>
<match Class="PatchOperationReplace">
<xpath>/Defs/ThingDef[defName="VanometricPowerCell"]/researchPrerequisites</xpath>
<value><researchPrerequisites><li>VanometricTinkering</li></researchPrerequisites>
</match>

<nomatch Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[defName="VanometricPowerCell"]</xpath>
<value><researchPrerequisites><li>VanometricTinkering</li></researchPrerequisites></value>
</nomatch>

Or a PatchOperationConditional could also do the trick, and check if research prereq already exists, if so replace, if not add.

Same with designation category.
Profligate 19 May, 2021 @ 5:25pm 
<Operation Class="PatchOperationConditional">
<xpath>/Defs/ThingDef[defName="VanometricPowerCell"]/researchPrerequisites</xpath>

<match Class="PatchOperationReplace">
<xpath>/Defs/ThingDef[defName="VanometricPowerCell"]/researchPrerequisites</xpath>
<value><researchPrerequisites><li>VanometricTinkering</li></researchPrerequisites></value>
</match>

<nomatch Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[defName="VanometricPowerCell"]</xpath>
<value><researchPrerequisites><li>VanometricTinkering</li></researchPrerequisites></value>
</nomatch>

</Operation>


<Operation Class="PatchOperationConditional">
<xpath>/Defs/ThingDef[defName="VanometricPowerCell"]/designationCategory</xpath>

<match Class="PatchOperationReplace">
<xpath>/Defs/ThingDef[defName="VanometricPowerCell"]/designationCategory</xpath>
<value><designationCategory>Power</designationCategory></value>
</match>

<nomatch Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[defName="VanometricPowerCell"]</xpath>
<value><designationCategory>Power</designationCategory></value>
</nomatch>

</Operation>

You'll want to replace your own patches in the Vanilla.xml file with these or the patches will cause duplication errors if anything else adds a category and researchprereq.
Last edited by Profligate; 19 May, 2021 @ 5:57pm
< >
Showing 1-3 of 3 comments
Per page: 1530 50