seobongzu

1.
Fridge folder Open [sbz] Fridge folder.
(.../SteamLibrary/steamapps/workshop/content/294100/3486264784)


2.
Version folder Open your version folder.
(ex: 1.5)


3.
Patches folder Open the Patches folder.


4.
Template file Copy and paste Template.xml,
then rename the copied file to whatever you want.
I changed it to seobongzu.xml.
(Don't change Template.xml directly)


5.

<?xml version="1.0" encoding="utf-8"?>
<Patch>
	<!--Template-->
	<!--
	<Operation Class="PatchOperationFindMod">
		<mods>
			<li>ModName</li>
		</mods>
		<match Class="PatchOperationSequence">
			<success>Always</success>
			<operations>			

				<li Class="PatchOperationAdd">
					<xpath>Defs/ThingDef[@Name = "sbzFridgeBase"]/building/fixedStorageSettings/filter/categories</xpath>
					<value>
						<li>ThingCategoryDef</li>
					</value>
				</li>

				<li Class="PatchOperationAdd">
					<xpath>Defs/ThingDef[@Name = "sbzFridgeBase"]/building/fixedStorageSettings/filter/thingDefs</xpath>
					<value>
						<li>ThingDef</li>
					</value>
				</li>

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

When you open seobongzu.xml with a text editor, you'll see this content.


6.

<?xml version="1.0" encoding="utf-8"?>
<Patch>
	<Operation Class="PatchOperationFindMod">
		<mods>
			<li>ModName</li>
		</mods>
		<match Class="PatchOperationSequence">
			<success>Always</success>
			<operations>			

				<li Class="PatchOperationAdd">
					<xpath>Defs/ThingDef[@Name = "sbzFridgeBase"]/building/fixedStorageSettings/filter/categories</xpath>
					<value>
						<li>ThingCategoryDef</li>
					</value>
				</li>

				<li Class="PatchOperationAdd">
					<xpath>Defs/ThingDef[@Name = "sbzFridgeBase"]/building/fixedStorageSettings/filter/thingDefs</xpath>
					<value>
						<li>ThingDef</li>
					</value>
				</li>

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

First, remove the comments.
If you don't know how, just copy what I do.


7.
To find the mod details you need, open the folder of the mod you want.
(.../SteamLibrary/steamapps/workshop/content/294100/modNumber)
I'll use [sbz] Mechanoid Bench 3 as an example.


8.
Mod Name Open About.xml in the About folder.
Enter the name between <name> and </name> into ModName.


9.
defName Find the defName of the ThingCategoryDef or ThingDef you want. I'll find and add Mecha Minigun as an example.


10.

<?xml version="1.0" encoding="utf-8"?>
<Patch>
	<Operation Class="PatchOperationFindMod">
		<mods>
			<li>[sbz] Mechanoid Bench 3</li>
		</mods>
		<match Class="PatchOperationSequence">
			<success>Always</success>
			<operations>			

				<li Class="PatchOperationAdd">
					<xpath>Defs/ThingDef[@Name = "sbzFridgeBase"]/building/fixedStorageSettings/filter/thingDefs</xpath>
					<value>
						<li>Gun_MechaMinigun</li>
					</value>
				</li>

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

The completed code will look like this.
In this example, I'm not adding ThingCategoryDef, so I deleted that part.


11.
Applied image It's working well.


12.
If you want to learn more about patches,
check out Rimworldwiki!

← Back