RimWorld

RimWorld

ReplaceLib
67 Comments
Phonicmas 28 Jul @ 4:18am 
Or a DefModExtension to be able to selectively ignore certain recipes from being deleted
Phonicmas 28 Jul @ 2:56am 
While this might be specific to my mod, when two recipes doesnt share the same ingredients, but most of the other things, they still get caught as duplicates as neither Utils.AreRecipesDuplicate or Utils.RecipeUsersAreSame checks for this.
In my case i hide the recipe when the "newer/cheaper" one is researched. While this might be a more specific problem to what i'm doing i was
wondering if you'd implement the ingredient check aswell, its as simple as replacing "return true;" in the method AreRecipesDuplicate() with:

HashSet<IngredientCount> usersA = new HashSet<IngredientCount>(recipeA.ingredients);
HashSet<IngredientCount> usersB = new HashSet<IngredientCount>(recipeB.ingredients);
return usersA.SetEquals(usersB);

If not then i can manually harmony patch it myself just fine, just wanted to check in here first.
FelipeGames2000 14 Jul @ 3:40pm 
So, I’ve run into a strange interaction with Expanded Materials - Metals

I noticed that a few of EM-Metals' component recipes disappear when ReplaceLib is also enabled. Due to it's nature as an "overlap patcher", I suspect ReplaceLib got confused with EM-Metals's additional component recipes and removed them

Unfortunately, my player log doesn’t seem to mention anything about either mod, so I don’t have specific error messages to share.

I’m posting this on both mod pages so either dev (or anyone else familiar with the issue) might be able to help. If anyone else has run into the same problem, I hope this helps point you to the possible cause.
ferny  [author] 14 Jul @ 12:07am 
v8 - fixed seed packing spot issue in prog agriculture
ferny  [author] 11 Jul @ 3:51am 
v7 - added mod icon
«PeGaS» 8 Jul @ 3:56am 
Hello, me again with another report.
Utils.AreRecipesDuplicate && Utils.RecipeUsersAreSame is not working properly sometimes. Example - manual and electric versions of the same recipe on different benches, but links not in the recipe users, but in the bench.recipes.
ferny  [author] 29 Jun @ 5:34pm 
v6 - progress towards diagnosing and fixing stuff, 1.6 version is back
ferny  [author] 27 Jun @ 2:35pm 
anyone reading this, ive rolled it back to just 1.5 for a bit holup im fixing it
ClothingLotus 27 Jun @ 9:35am 
@Tinda I AM NOT ALONE
ClothingLotus 27 Jun @ 9:34am 
@carni I THOUGHT I WAS GOING CRAZY
Tinda 26 Jun @ 11:07am 
Oh that explains it.
I've been redownloadning it like 5 times lol
ferny  [author] 26 Jun @ 5:14am 
@carni Yeah working on it, had to roll back a bit
carni 26 Jun @ 5:08am 
After the last update the mod doesn't display compatibility with 1.6 anymore.
ferny  [author] 23 Jun @ 4:47pm 
@«PeGaS» Really? Oh shit, lemme look into this
«PeGaS» 23 Jun @ 12:15pm 
Hmm, there are changes after all, I checked the dll itself and its way smaller mow, without extra harmony patches.
«PeGaS» 23 Jun @ 12:09pm 
@ferny Thank you, I really have no idea why this is the case, as Im a modder myself (for custom project) and have no clues why this update would do such a thing, as there are no changes for 1.5, so I guessed maybe you can tell me.
ferny  [author] 23 Jun @ 10:50am 
@«PeGaS» I've got thousands of folks in my server nobody's said a word on this, but I'll look into it regardless
«PeGaS» 23 Jun @ 10:44am 
Really dunno why though, I double-checked mod folder, tried load folder file to point to the 1.5 assembly, nothing.
«PeGaS» 23 Jun @ 10:41am 
I'm sure, all my patches just died the moment I started the game after 10 days off, restart didn't fix it, but the older version (from March) is working fine.
ferny  [author] 23 Jun @ 10:12am 
Just double checked, haven't modified ReplaceLib.dll since February first which was last update
ferny  [author] 23 Jun @ 10:11am 
@«PeGaS» Are you absolutely sure of that? Nothing has changed about the 1.5 version
«PeGaS» 23 Jun @ 10:10am 
After the latest update, all patches now broken on 1.5, had to download older version before update
ferny  [author] 14 Jun @ 10:24am 
v4 - updated to 1.6
ferny  [author] 10 Apr @ 7:49am 
@Polat Alemdar My friend the removal of the rustic table is intentional, it has been ported to the new Old-World style. As for the errors, they're from recent updates to other mods, they're all harmless but will be fixed soon.
Polat Alemdar 10 Apr @ 7:40am 
ok my bad problem wasnt replaceLib but it was:
Progression: Aesthetics https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3294950875

here is a screenshot in game:
https://prnt.sc/MrZdtSbpB6wd

red lines:
https://prnt.sc/ZC-Ywi5LVYP_

logs:
https://justpaste.it/cjzu8

modlist:
https://prnt.sc/JhNVCpIZCxra
ferny  [author] 10 Apr @ 3:04am 
@Polat Alemdar Nope
Polat Alemdar 9 Apr @ 10:38pm 
There is an issue with medieval overhaul, this mod removes option to build some of furniture, for example rustic table (1x2)
bradson 24 Mar @ 9:03am 
@Ferret With A Cat Hat Patch Operation Collection has a DefNameLink operation that does include a defType field to work with all def kinds. That can achieve the same effect, wouldn't need dependencies either.
Stuffable floors simply generates more terrain defs through C#. It doesn't remove them
Ferret With A Cat Hat 24 Mar @ 5:40am 
Is there any way to make this work with terrain? I've made a mod that unifies the stone types using this but this mod can't unify anything other than things and whilst i felt removing the other stone block recipes would be fine removing the other floors would probably lead to all sorts of issues

do i just use stuffed floors or smth
ferny  [author] 20 Mar @ 1:13pm 
@Vulkandrache Probably not?
Vulkandrache 20 Mar @ 1:12pm 
Is this likely going to cause problems with mod like
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2542931556
and
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=2591816333
that change large amounts of thingdef already?
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
LikewiseHH 8 Feb @ 3:45am 
I must be stupid. How can I replace defs from the core game with my custom ones? Does "Core" go into the defName at the top?
M0rr1s0n 3 Feb @ 9:16am 
@PeGaS release please :D
«PeGaS» 2 Feb @ 2:50pm 
Tested with urban ruins mod to unify all my guns mods - perfect. Thank you.
TurtleShroom 1 Feb @ 6:23pm 
I don't understand what that means, Bradson. I don't know how this works.
bradson 1 Feb @ 6:20pm 
DefNameLink.Operation from Patch Operation Collection has a <defType> field to target other types of defs
ferny  [author] 1 Feb @ 3:31pm 
@TurtleShroom I'm not sure actually
TurtleShroom 1 Feb @ 2:56pm 
That's awesome. Can I also replace things like Research Project Defs and such, or does it only work with Thing Defs?
ferny  [author] 1 Feb @ 2:51pm 
@TurtleShroom Removes the def as well
TurtleShroom 1 Feb @ 2:49pm 
Does making a Replacement Def remove the object being replaced, or does it just add this one?
«PeGaS» 1 Feb @ 2:21pm 
Can I use it to patch custom defs? Will it work with maps layout defs with thousands of li tags?
TurtleShroom 1 Feb @ 11:47am 
Does this only replace Thing Defs?