RimWorld

RimWorld

Thinking Spot
 This topic has been pinned, so it's probably important
User Made Patches
So, I've made a patch for Rim Cuisine 2. I'm posting it here so that PartyCowboy can make use of it. It might also be of use to anyone who is wondering how to patch a mod into Thinking Spot. The process itself is reasonably straight forward, so you may be able to get an idea of what to do just by looking at the following .xml files. If it's too scary for you, you could always post a request in this thread for a specific mod and if I or someone else sees it we might take a look at it if we are in a good mood and/or have spare time on our hands! ;)

The following three posts in this discussion will be their own separate .xml files in a folder called [1.0, 1.1] RimCuisine 2 Core under patches/Other mods. The fourth post will contain two changes to files that Party Cowboy used to do their initial patch (which is now out of date as Rim Cuisine's name changed slightly).

Edit: I'm just about to add a patch for Fertile Fields [1.1] on this topic. Three xml files again in a folder named Fertile Fields [1.1]. (Incidentally, FF also works on 1.2, the person maintaining it is just keeping that as the name so that other mods (like this one) don't have to constantly update itself to compensate.)
Last edited by afterthought.btw; 3 Dec, 2020 @ 12:18pm
< >
Showing 1-12 of 12 comments
afterthought.btw 24 Sep, 2020 @ 12:29pm 
File name: RC2_buildings.xml

File contents:

<?xml version="1.0" encoding="utf-8" ?>
<!-- Adding research prereqs to all buildings which don't otherwise have a prereq and replacing those which rely on Pemmican with TS_PrimitiveCooking (as Pemmican is not in Thinking Spot's research tree)-->
<Patch>

<Operation Class="PatchOperationFindMod">
<mods>
<li>[1.0, 1.1] RimCuisine 2 Core</li>
</mods>
<match Class="PatchOperationSequence">
<operations>
<li Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[defName = "RC2_FoodPrepSpot"]</xpath>
<value>
<researchPrerequisites>
<li>TS_PrimitiveCooking</li>
</researchPrerequisites>
</value>
</li>
<li Class="PatchOperationReplace">
<xpath>/Defs/ThingDef[defName = "RC2_MeatDryingRack"]/researchPrerequisites</xpath>
<value>
<researchPrerequisites>
<li>TS_PrimitiveCooking</li>
</researchPrerequisites>
</value>
</li>
<li Class="PatchOperationReplace">
<xpath>/Defs/ThingDef[defName = "RC2_FruitDryingRack"]/researchPrerequisites</xpath>
<value>
<researchPrerequisites>
<li>TS_PrimitiveCooking</li>
</researchPrerequisites>
</value>
</li>
<li Class="PatchOperationReplace">
<xpath>/Defs/ThingDef[defName = "RC2_PicklingBarrel"]/researchPrerequisites</xpath>
<value>
<researchPrerequisites>
<li>TS_PrimitiveCooking</li>
</researchPrerequisites>
</value>
</li>
</operations>
</match>
</Operation>

</Patch>
afterthought.btw 24 Sep, 2020 @ 12:30pm 
File name: RC2_recipes.xml

File contents:

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

<!-- Replacing research prereq 'Pemmican' with the prereq 'TS_PrimitiveCooking' in all relevant cases as Pemmican is not in Thinking Spot's research tree-->

<Patch>

<Operation Class="PatchOperationFindMod">
<mods>
<li>[1.0, 1.1] RimCuisine 2 Core</li>
</mods>
<match Class="PatchOperationSequence">
<operations>
<li Class="PatchOperationReplace">
<xpath>/Defs/RecipeDef[defName = "RC2_MakeHardtack"]/researchPrerequisite</xpath>
<value>
<researchPrerequisite>TS_PrimitiveCooking</researchPrerequisite>
</value>
</li>
<li Class="PatchOperationReplace">
<xpath>/Defs/RecipeDef[defName = "RC2_TrimMeat"]/researchPrerequisite</xpath>
<value>
<researchPrerequisite>TS_PrimitiveCooking</researchPrerequisite>
</value>
</li>
<li Class="PatchOperationReplace">
<xpath>/Defs/RecipeDef[defName = "RC2_TrimMeatBulk"]/researchPrerequisite</xpath>
<value>
<researchPrerequisite>TS_PrimitiveCooking</researchPrerequisite>
</value>
</li>
<li Class="PatchOperationReplace">
<xpath>/Defs/RecipeDef[defName = "RC2_PrepareFruit"]/researchPrerequisite</xpath>
<value>
<researchPrerequisite>TS_PrimitiveCooking</researchPrerequisite>
</value>
</li>
<li Class="PatchOperationReplace">
<xpath>/Defs/RecipeDef[defName = "RC2_PrepareFruitBulk"]/researchPrerequisite</xpath>
<value>
<researchPrerequisite>TS_PrimitiveCooking</researchPrerequisite>
</value>
</li>
<li Class="PatchOperationReplace">
<xpath>/Defs/RecipeDef[defName = "RC2_BrineVegetables"]/researchPrerequisite</xpath>
<value>
<researchPrerequisite>TS_PrimitiveCooking</researchPrerequisite>
</value>
</li>
<li Class="PatchOperationReplace">
<xpath>/Defs/RecipeDef[defName = "RC2_BrineVegetablesBulk"]/researchPrerequisite</xpath>
<value>
<researchPrerequisite>TS_PrimitiveCooking</researchPrerequisite>
</value>
</li>
</operations>
</match>
</Operation>

</Patch>
afterthought.btw 24 Sep, 2020 @ 12:33pm 
File name: RC2_research.xml

File contents:

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

<Patch>
<!--Removing 'Pemmican' from research Prerequisites as it no longer exists in Thinking Spot-->
<Operation Class="PatchOperationFindMod">
<mods>
<li>[1.0, 1.1] RimCuisine 2 Core</li>
</mods>
<match Class="PatchOperationReplace">
<!--Didn't immediately see an obvious way to just remove a single prereq so am simply replacing all prereqs, and adding back in all but Pemmican-->
<!--Pemmican's replacement in the tech tree is already a prereq before you can research NutrientPaste so need to add that replacement-->
<xpath>/Defs/ResearchProjectDef[defName="PackagedSurvivalMeal"]/prerequisites</xpath>
<value>
<prerequisites>
<li>NutrientPaste</li>
</prerequisites>
</value>
</match>
</Operation>
</Patch>
afterthought.btw 24 Sep, 2020 @ 1:06pm 
There are two fixes here, the first one is for the plant 'strawberry' in plants.xml which should add support for all mods which give the plant a prereq themselves, and not just for Rim Cuisine. This should work just fine for Vegetable Garden too (and any other unknown mods that add prereqs for strawberries), so I don't think you need to keep the Vegetable Garden nomatch check either.

The second one, for research.xml, sadly can't use the same trick as TreeSowing exists in Vanilla, and so I'm still trying to think of a way to strip out the Rim Cuisine specific bit and put it in the Rim Cuisine folder. If anyone has any bright ideas let me know, I'm a complete novice with xml files and modding in general. Essentially all the second fix is is changing the name of the previous version of Rim Cuisine for the new one, but I've included the entire body of xml that deals with Rim Cuisine's issue just for simplicity's sake.

You should be able to just delete the bit of code that deals with Rim Cuisine and replace it with these ones.

Fix for plants.xml

<!-- check for sow research prereqs for strawberries and if none, add in Thinking Spot's prereq-->
<Operation Class="PatchOperationSequence">
<success>Always</success>
<operations>
<li Class="PatchOperationTest">
<xpath>/Defs/ThingDef[defName="Plant_Strawberry"]/plant/sowResearchPrerequisites</xpath>
<success>Invert</success>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[defName="Plant_Strawberry"]/plant</xpath>
<value>
<sowResearchPrerequisites>
<li>TS_DomHerb</li>
</sowResearchPrerequisites>
</value>
</li>
</operations>
</Operation>

Fix for Research.xml

<Operation Class="PatchOperationFindMod">
<mods>
<li>[1.0, 1.1] RimCuisine 2 Core</li>
</mods>
<nomatch Class="PatchOperationAdd">
<xpath>/Defs/ResearchProjectDef[defName="TreeSowing"]</xpath>
<value>
<prerequisites>
<li>TS_DomHerb</li>
</prerequisites>
</value>
</nomatch>
Last edited by afterthought.btw; 24 Sep, 2020 @ 1:07pm
afterthought.btw 29 Sep, 2020 @ 3:31am 
A couple more patches here, First a quick and simple patch of RazzleDazzle! (Continued) to put the Stage behind the art pre-req. That was the only thing that I could see that needed patching.

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

<Patch>

<Operation Class="PatchOperationFindMod">
<mods>
<li>RazzleDazzle! (Continued)</li>
</mods>
<!--adds Stage to prereq TS-Art.-->
<match Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[defName="StageDef"]</xpath>
<value>
<researchPrerequisites>
<li>TS_Art</li>
</researchPrerequisites>
</value>
</match>
</Operation>

</Patch>
Last edited by afterthought.btw; 29 Sep, 2020 @ 3:33am
afterthought.btw 29 Sep, 2020 @ 3:33am 
And another straight forward patch for [T] MoreFloors. After a bit of thought I decided to put Straw Flooring in indoor floors rather than make a new research simply because I didn't think the reward of straw floors was worth the expenditure of another research project.

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

<Patch>
<Operation Class="PatchOperationFindMod">
<mods>
<li>[T] MoreFloors</li>
</mods>
<match Class="PatchOperationSequence">
<operations>
<!--adding IndoorFlooring to all wood floors-->
<li Class="PatchOperationAdd">
<xpath>/Defs/TerrainDef[defName = "FloorWoodRustic"]</xpath>
<value>
<researchPrerequisites>
<li>TS_IndoorFlooring</li>
</researchPrerequisites>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/TerrainDef[defName = "FloorWoodWide"]</xpath>
<value>
<researchPrerequisites>
<li>TS_IndoorFlooring</li>
</researchPrerequisites>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/TerrainDef[defName = "FloorWoodLight"]</xpath>
<value>
<researchPrerequisites>
<li>TS_IndoorFlooring</li>
</researchPrerequisites>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/TerrainDef[defName = "FloorWoodMosaic"]</xpath>
<value>
<researchPrerequisites>
<li>TS_IndoorFlooring</li>
</researchPrerequisites>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/TerrainDef[defName = "FloorWoodVertical"]</xpath>
<value>
<researchPrerequisites>
<li>TS_IndoorFlooring</li>
</researchPrerequisites>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/TerrainDef[defName = "FloorWoodBarn"]</xpath>
<value>
<researchPrerequisites>
<li>TS_IndoorFlooring</li>
</researchPrerequisites>
</value>
</li>
<!-- ... and to Straw flooring-->
<li Class="PatchOperationAdd">
<xpath>/Defs/TerrainDef[defName = "FloorStraw"]</xpath>
<value>
<researchPrerequisites>
<li>TS_IndoorFlooring</li>
</researchPrerequisites>
</value>
</li>
</operations>
</match>
</Operation>

</Patch>
PartyCowboy  [developer] 29 Sep, 2020 @ 10:31am 
Thank you afterthought! I do have a tip though: if you have an operation that, for example, adds the same exact thing, only for different defNames, then you could put 'or' between the defNames, and only have to enter new defNames. Saves a lot of copying and pasting!
Last edited by PartyCowboy; 29 Sep, 2020 @ 10:40am
afterthought.btw 3 Dec, 2020 @ 12:19pm 
Fertile Fields patches follow.

Filename: research.xml

Text is as follows:

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

<Patch>

<Operation Class="PatchOperationFindMod">
<mods>
<li>Fertile Fields [1.1]</li>
</mods>
<match Class="PatchOperationSequence">
<operations>
<!-- adding new research project in order to learn how to terraform. Has a steep cost for its place in the tech tree but it's a powerful tech. Am open to other opinions.-->
<li Class="PatchOperationInsert">
<xpath>/Defs/ResearchProjectDef[defName = "TS_Walls"]</xpath>
<value>
<ResearchProjectDef>
<defName>TS_FF_Primitive_Terraforming</defName>
<label>Primitive Terraforming</label>
<description>Whilst absent mindedly gazing at the land before them, your researcher noticed a startling thing: different types of soil seem to grow plants at different rates! Fascinated by this discovery, they decided to see how they could turn one type of soil into another, or even remove all the goodness from the soil entirely!</description>
<techLevel>Neolithic</techLevel>
<baseCost>1000</baseCost>
<prerequisites>
<li>TS_Crafting</li>
</prerequisites>
</ResearchProjectDef>
</value>
</li>
<!-- adding new primitive terraforming tech as prereq for subsequent terraforming tech-->
<li Class="PatchOperationReplace">
<xpath>/Defs/ResearchProjectDef[defName="RFF_Terraforming"]/prerequisites</xpath>
<value>
<prerequisites>
<li>TS_FF_Primitive_Terraforming</li>
</prerequisites>
</value>
</li>
</operations>
</match>
</Operation>

</Patch>
Last edited by afterthought.btw; 9 Dec, 2020 @ 10:55am
afterthought.btw 3 Dec, 2020 @ 12:20pm 
Filename: buildings.xml

Text as follows:

<?xml version="1.0" encoding="utf-8" ?>
<Patch>
<Operation Class="PatchOperationFindMod">
<mods>
<li>Fertile Fields [1.1]</li>
</mods>
<!-- adding prereq to the parent Def all terraforming inherits from-->
<match Class="PatchOperationSequence">
<operations>
<li Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[@Name = "RFF_TerraformBase"]</xpath>
<value>
<researchPrerequisites>
<li>TS_FF_Primitive_Terraforming</li>
</researchPrerequisites>
</value>
</li>
<!-- adding wall prereq to Brick Wall and then indoor flooring prereq to brick floors-->
<li Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[defName = "BrickWall"]</xpath>
<value>
<researchPrerequisites>
<li>TS_Walls</li>
</researchPrerequisites>
</value>
</li>
<li Class="PatchOperationAdd">
<xpath>/Defs/TerrainDef[defName = "BrickFloor" or defName = "HBBrickFloor"]</xpath>
<value>
<researchPrerequisites>
<li>TS_IndoorFlooring</li>
</researchPrerequisites>
</value>
</li>
<!-- adding terraforming prereq to compost bin-->
<li Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[defName = "CompostBin"]</xpath>
<value>
<researchPrerequisites>
<li>TS_FF_Primitive_Terraforming</li>
</researchPrerequisites>
</value>
</li>
</operations>
</match>
</Operation>
</Patch>
afterthought.btw 3 Dec, 2020 @ 12:21pm 
Filename: recipes.xml

Text as follows:

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

<Operation Class="PatchOperationFindMod">
<mods>
<li>Fertile Fields [1.1]</li>
</mods>
<!-- adding prereq to recipes related to terraforming. Decided to throw in the composting techs in too rather than add it to another tech or make another new one-->
<match Class="PatchOperationAdd">
<xpath>/Defs/RecipeDef[defName = "SplitDirt" or defName = "SplitDirtBulk" or defName = "DirtToClay" or defName = "DirtToClayBulk" or defName = "MakeCrushedRocks" or defName = "MakeCrushedRocksBulk" or defName = "MakeCrushedRocksBlock" or defName = "MakeCrushedRocksBlockBulk" or defName = "MakeSand" or defName = "MakeSandBulk" or defName = "MakeClay" or defName = "MakeClayBulk" or defName = "MakeDirt" or defName = "MakeDirtBulk" or defName = "MakeCompost" or defName = "MakeCompost5" or defName = "CompostCorpse" or defName = "CompostCorpseCampfire"]</xpath>
<value>
<researchPrerequisites>
<li>TS_FF_Primitive_Terraforming</li>
</researchPrerequisites>
</value>
</match>
</Operation>
</Patch>
egoanditspwn 13 Feb, 2021 @ 9:53pm 
Got another for ya, this one gets rid of an error on startup when using VGP Garden Fabrics. I added it to the Research.xml in the Vegetable Garden + subs folder, but idk if you'd want to give it it's own file or what.

<Operation Class="PatchOperationFindMod">
<mods>
<li>VGP Garden Fabrics</li>
</mods>
<match Class="PatchOperationReplace">
<xpath>Defs/ResearchProjectDef[defName="VG_ClothI"]/prerequisites</xpath>
<value>
<prerequisites>
<li>TS_DomHerb</li>
<li>ComplexClothing</li>
</prerequisites>
</value>
</match>
</Operation>
egoanditspwn 15 Feb, 2021 @ 6:22pm 
Made an integration patch with Crash Landing mod, with versions of the scenarios it adds that feature a no starting tech colony, since trying to make a custom scenario in Rimworld itself seems to always make the initial Crash Landing event to fail.

https://pastebin.com/9DNKanEa
< >
Showing 1-12 of 12 comments
Per page: 1530 50