Removing a def with merged patch

Started by Fafn1r, December 07, 2016, 02:10:27 PM

Previous topic - Next topic

Fafn1r

Is it possible to override a def in a way that removes it from the game? I'm working on compatibility patches and want to remove duplicate items.

I tried to gray out the code, just leaving defName, but I get a missing label and in case of FashionRIMsta, it didn't remove the item/recipe at all.

1000101

Once it's defined it can't be undefined.  However, you can use certain tricks to make it inaccessible such as assigning buildings (ThingDefs) to the "None" designation category (see the AncientCrytosleep),  setting ResearchProjectDefs to have themselves as prerequisites (although, they will still be visible in the research menu), removing recipeUsers from RecipeDefs, etc.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

Fafn1r

Damn. And here I though I can make a mod pack without touching mod folders, just adding a merged patch. ::)

RawCode

you can remove def from database via CLI\c#\DLL, but this won't magically update references and hashmaps, results are unpredictable, especially if hosting mod rely on such defs internally (in code), like core game, that rely on many defs and removal result in spiral of issues.

if you really want to remove def, just remove it's entry from database, cross fingers and run game.