RimWorld

RimWorld

104 ratings
ReplaceLib
   
Award
Favorite
Favorited
Unfavorite
Mod, 1.5
File Size
Posted
Updated
192.906 KB
30 Jan @ 2:11am
1 Feb @ 1:10am
3 Change Notes ( view )

Subscribe to download
ReplaceLib

In 1 collection by ferny
Ferny's Progression Modpack (1.5 ANOMALY)
863 items
Description
What does this do?
This is a tool for modders, mainly for use in making overlap patches. Similar to Resource Dictionary, except in the hands of the modder. You can create ReplacerDefs which allow you to completely replace a thingDef with another def, which is very helpful for a guy like me.



Example
In this example, all instances of the mentioned crops would be entirely replaced. Even in deep places like meal recipes, all instances of the crop would be replaced by their VE counterpart.

How do I use this as a modder?
Make this mod a dependency on your mod, then just make a ReplacerDef.

Credits
  • Taranchuk - Lots of lovely C#



[discord.gg]
38 Comments
ferny  [author] 20 Mar @ 1:13pm 
@Vulkandrache Probably not?
ferny  [author] 1 Mar @ 2:32pm 
@furel87 This is for ThingDefs
furel87 1 Mar @ 4:52am 
Does this work with memes and precepts? I did a substitution as Def and as Patch and neither of them seem to work. Precepts seems to not recognize the substitution and asks for the overridden meme
ferny  [author] 9 Feb @ 12:38pm 
@LikewiseHH Look at the patch i did for Medieval Overhaul in my mod Progression Agriculture, that's a functioning one that you can look at for example
LikewiseHH 9 Feb @ 12:32pm 
Thanks for your help. Still could not manage to get it to work though. Is there a github repo or so with examples from which I can learn?
ferny  [author] 8 Feb @ 4:07pm 
@LikewiseHH You are going to want to make this a def. Put it in your defs folder, not your patches. If you want you can make it a patch by doing a patchoperationadd def, but just use the defs folder for this I think it looks simple.
LikewiseHH 8 Feb @ 12:40pm 
Hmm still struggling @ferny. Don't wanna hijack this for troubleshooting but maybe you can quickly help out:
I have my own mod adding some armor. I declared your mod as a dependency. In my mod I added a 'patch_replace_defs.xml' file with this content:

<?xml version="1.0" encoding="UTF-8"?>
<ReplaceLib.ReplacerDef>
<defName>TestReplacy</defName>
<replacers>
<li>
<replace>Apparel_AdvancedHelmet</replace>
<with>T2_Helmet</with>
</li>
</replacers>
</ReplaceLib.ReplacerDef>

I would expect now not to find the Apparel_AdvancedHelmet def in the game at all anymore but it's still there. Or am I misunderstanding what the mod does?
Thanks!
ferny  [author] 8 Feb @ 4:02am 
@LikewiseHH Defname is irrelevant, just is a codename you designate for your replacer. The only thing that matters it the "replace" field and the "with" field which you fill with the corresponding defs