Quick XML question

Started by schmick, March 09, 2022, 08:18:41 AM

Previous topic - Next topic

schmick

I wrote a patch which changes the <mass> of the ThingDef RawPotatoes, but as <mass> is defined by its parent I had to do a PatchOperationAdd instead of PatchOperationReplace. It works but when it inherits the original <mass> after the patch, the game throws an error in console.

I was just wondering if anyone knows generally of an alternative, cleaner way of doing it (without defining a competely new abstract class just for RawPotatoes). Or tell me if I'm committing some horrific XML mistake.
Thanks

schmick

Follow up unrelated question bc I don't want to spam the board:
I want to patch the abstract class TreeBase to extend lifespanDaysPerGrowDays. I've read that tweaking the Base Defs is a terrible idea, but is it just manually changing values or are PatchOperations on Base Defs a bad move too?