Closed mheguy closed 7 years ago
See my comment in the other repo.
I finally found a new way to patch Rimworld code. With this, any number of mods can inject code that runs at the beginning or end of an existing method and even has the ability to skip the original code if necessary. I do it by creating dynamic code and compile it at runtime, then patch the routine to that new code. Side effect: everyone can use the lib to compile stuff at runtime for their own purpose.
Just fixing the last few quirks and adding some sort of importance factor to each patch so the lib can order them in a custom order that is independent of mod load order.
I will create a repo here that will allow everyone to contribute and drive this into a direction that everyone could benefit from.
Totally makes sense. Good job! Unfortunately, I cannot contribute, as I'm not supporting my mod anymore. Go on and promote this thing in the modding forums, but beware of the angry overprotective CCL authors.
Hi micktu. Not sure if you're interested but I think you might find it interesting that I have released a general c# patching library called "Harmony". Works with Unity mods (not Rimworld only) and is totally non-destructive. Check it out at https://github.com/pardeike/Harmony and feel free to contribute if you're into such a thing :-)
Cheers!
Rimworld version 0.14.1249 Achtung by @pardeike Version used: https://github.com/pardeike/RimWorld-Achtung-Mod/commit/8a237f92b2c3c0b9ab675a678d5f6f9dd9b592a8
Direct download: https://github.com/pardeike/RimWorld-Achtung-Mod/archive/8a237f92b2c3c0b9ab675a678d5f6f9dd9b592a8.zip
BuildProductive by @micktu Version used: https://github.com/micktu/RimWorld-BuildProductive/tree/0.30
Direct download: https://github.com/micktu/RimWorld-BuildProductive/releases/download/0.30/BuildProductive-0.30.zip
Replication steps: Attempt to start a new colony with both mods enabled (mod order and/or presence of CCL or other mods has no discernible effect).
Error log:
These next 2 lines repeat 599 times in the error log.
Ref: https://github.com/micktu/RimWorld-BuildProductive/issues/1