RimWorld

RimWorld

Morphs Assorted: Unique and Rare Items
 This topic has been pinned, so it's probably important
Morphium  [developer] 1 May, 2021 @ 5:28pm
Patch Template
<?xml version="1.0" encoding="utf-8" ?>
<Patch>

<!-- Create a subfolder labeled 'Patches' Within th 1.2 folder of your mod
Drop this Patch into it and rename it after the Item you're patching
Example: Patch_Unique_CrownStellic

Enter your Items defName into the 3 marked areas and delete everything between each of the two ""
Example: <xpath>/Defs/ThingDef[defName = "Apparel_CrownStellic"]/comps</xpath>-->

<Operation Class="PatchOperationFindMod">
<mods>
<li><!--MODNAME--></li>

<!-- Enter the Name of the Mod you want to add an item from in the Space between <li> and </li> above this line
Example: <li>[CP] Rimmu-Nation - Clothing</li>
You find the modname in the About.xml of every mod. Be sure to copy the name perfectly!
-->
</mods>
<match Class="PatchOperationSequence">
<operations>
<li Class="PatchOperationConditional">
<xpath>/Defs/ThingDef[defName = "<!--YOUR ITEM GOES HERE-->"]/comps</xpath>
<success>Always</success>
<nomatch Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[defName = "<!--YOUR ITEM GOES HERE-->"]</xpath>
<value>
<comps />
</value>
</nomatch>
</li>
<li Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName = "<!--YOUR ITEM GOES HERE-->"]</xpath>
<comps>
<li Class="UniqueItems.CompProperties_UniqueItem">
<maxCount>1</maxCount>
<!-- You can change this number to define the maximal number your item is supposed to exist.
This is also toggable within the Modsettings ingame.
-->
<labelUniquePrefix>Unique </labelUniquePrefix>
<!-- The above line needed to add the Prefix 'Unique' to an Item.

-->
<labelRarePrefix>Rare </labelRarePrefix>
<!-- The above line is needed to add the Prefix 'Rare' to an Item.

-->
<artDescriptionPostfix>DM.UniqueGladiusArtPostfix</artDescriptionPostfix>
<!-- The above line adds the 'unique' line to the description of your Item if it is viable for artdescription.

-->

</li>
</comps>
</li>
</operations>
</match>
</Operation>

</Patch>
Last edited by Morphium; 1 May, 2021 @ 5:30pm
< >
Showing 1-2 of 2 comments
Morphium  [developer] 1 May, 2021 @ 5:29pm 
Create a xml dokument with a texteditor, copy the patch into it and follow the instructions
BlackFranky 11 Aug, 2021 @ 5:52am 
I had to change the template because i got XML errors:

As you will see i changed the last operation's path. The command needs a <value> tag to work.

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

<!-- Create a subfolder labeled 'Patches' Within th 1.2 folder of your mod
Drop this Patch into it and rename it after the Item you're patching
Example: Patch_Unique_CrownStellic

Enter your Items defName into the 3 marked areas and delete everything between each of the two ""
Example: <xpath>/Defs/ThingDef[defName = "Apparel_CrownStellic"]/comps</xpath>-->

<Operation Class="PatchOperationFindMod">
<mods>
<li>Nanotech Overpower</li>

<!-- Enter the Name of the Mod you want to add an item from in the Space between <li> and </li> above this line
Example: <li>[CP] Rimmu-Nation - Clothing</li>
You find the modname in the About.xml of every mod. Be sure to copy the name perfectly!
-->
</mods>
<match Class="PatchOperationSequence">
<operations>
<li Class="PatchOperationConditional">
<xpath>/Defs/ThingDef[defName = "Nanoblaster"]/comps</xpath>
<success>Always</success>
<nomatch Class="PatchOperationAdd">
<xpath>/Defs/ThingDef[defName = "Nanoblaster"]</xpath>
<value>
<comps />
</value>
</nomatch>
</li>
<li Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName = "Nanoblaster"]/comps</xpath>
<value>
<li Class="UniqueItems.CompProperties_UniqueItem">
<maxCount>1</maxCount>
<!-- You can change this number to define the maximal number your item is supposed to exist.
This is also toggable within the Modsettings ingame.
-->
<labelUniquePrefix>Unique </labelUniquePrefix>
<!-- The above line needed to add the Prefix 'Unique' to an Item.

-->
<labelRarePrefix>Rare </labelRarePrefix>
<!-- The above line is needed to add the Prefix 'Rare' to an Item.

-->
<artDescriptionPostfix>DM.UniqueGladiusArtPostfix</artDescriptionPostfix>
<!-- The above line adds the 'unique' line to the description of your Item if it is viable for artdescription.

-->

</li>
</value>
</li>
</operations>
</match>
</Operation>

</Patch>
< >
Showing 1-2 of 2 comments
Per page: 1530 50