RimWorld

RimWorld

Early Times
This topic has been locked
sharkman 23 Jul, 2021 @ 10:54am
Research Patch fix
Instead of using only PatchOperationAdd please wrap it in PatchOperationConditional, e.g.:
in Patches\Vanilla.xml you have:
<li Class="PatchOperationAdd"> <xpath>/Defs/ResearchProjectDef[defName="Stonecutting"]</xpath> <value> <prerequisites> <li>FT_Stonecrushing</li> </prerequisites> </value> </li>
instead of that please replace it with:
<li Class="PatchOperationConditional"> <xpath>/Defs/ResearchProjectDef[defName="Stonecutting"]/prerequisites</xpath> <nomatch Class="PatchOperationAdd"> <xpath>/Defs/ResearchProjectDef[defName="Stonecutting"]</xpath> <value> <prerequisites> <li>FT_Stonecrushing</li> </prerequisites> </value> </nomatch> <match Class="PatchOperationAdd"> <xpath>/Defs/ResearchProjectDef[defName="Stonecutting"]/prerequisites</xpath> <value> <li>FT_Stonecrushing</li> </value> </match> </li>

this way it does not cause any duplicate xml tags exceptions on start.
< >
Showing 1-3 of 3 comments
vovann012347  [developer] 10 Aug, 2021 @ 11:01am 
I could not find FT_Stonecrushing, as for method - I already have that, this may be another mod doing thing you have mentioned since i cannot check for mods doing similar thing.
If you have errors with other research defs - i will sort them out.
If i use said checks everywhere then editing patches will be a pain, mod will load slower also it will delay me from adding useful stuff further (and hopefully not breakind existing stuff) - so i will sort out issues if you have any.
vovann012347  [developer] 10 Aug, 2021 @ 4:00pm 
That will be that way unless there will start to arise countless problems with compat so i will need to make more checks when patching which will probably be so.
sharkman 10 Aug, 2021 @ 5:33pm 
Oh, sorry about that, I think this patch is for another mod called Fortifications - Medieval - Materials, my bad.

I think you already did a great job in 1.1-1.3\Patches\CorePatches\MedTimes_Research_2_patch.xml for the same Stonecutting research prerequisites list.
< >
Showing 1-3 of 3 comments
Per page: 1530 50