Mod compatibility handling throws an error that disables dev mode

Started by ethouiche, April 02, 2020, 07:02:46 AM

Previous topic - Next topic

ethouiche

Hello,

I have a clone bay mod that used to be compatible with my lighter than fast mod(aka LTF), back in 1.0.
The LTF has an hediff that allows to change the faction of a pawn. That's why I wanted to handle an exception/compatibility special case when players try to register a mind controlled pawn in the clone bay.

In 1.0, if LTF was not loaded, the clone bay would not care, and keep working.

Now that 1.1 is out, if the player does not have LTF loaded with the clone bay, it throws an ugly error that prevents opening the dev mode.
https://gist.github.com/HugsLibRecordKeeper/a5d49cdcbe07688cb5944f3294c11af5
https://www.reddit.com/r/RimWorld/comments/fmu23w/mods_have_disabled_dev_mode/
Exception filling window for Verse.ImmediateWindow: System.TypeLoadException: Could not resolve type

I have checked my target framework, it's 4.7.2 for both mods. I have removed and added the references dll again, recompiled. The same error keeps on poping.

It seems other people have had this problem :
https://steamcommunity.com/app/294100/discussions/0/1750149787517909015/
https://ludeon.com/forums/index.php?topic=50383.0

I am clueless on what to do.
Please send help  :)


LWM

Well, what does the type in question look like?  Does it have any attributes?

ethouiche

It has nothing really special in it afaik. Here is the definition :
https://github.com/goudaQuiche/LighterThanFast/blob/master/1.1/Source/LighterThanFast/LighterThanFast/HeDiffComp_LTF_FactionChange.cs

I have a function in the clone bay that returns that type :
https://github.com/goudaQuiche/LTF_CloneBay/blob/master/1.1/Source/RimWorld_ExampleProjectDLL/PawnTools.cs

Why would going from 1.0 to 1.1 would break it? If something was not supported anymore, it would not compile, right ?

I am working on a stand alone for the mind control bench that makes the clone bay fail. When i am done with it, I will try to remove the compatibility from clone bay with LTF, and add a compatibility with the stand alone. Maybe something will be different.

I have 2 other mods with :
1. a race that drains oxygen and also extinguishes fires by doing so
2. a campfire that can be extinguished (even when it has fuel in it)

I added a compatibility between these 2 mods and the same kind of dev mode blocking error occurs. Maybe my way to handle compatibility is wrong.

ethouiche

I forgot to catch an exception around some sensitive code. I also had methods that returned a type declared in another mod.
It's now fixed.