Getting TypeLoadException when trying to replace door code

Started by VapidLinus, December 24, 2014, 11:11:24 PM

Previous topic - Next topic

VapidLinus

I'm trying to replace the main door in the game, so I simply override the door by putting this in my /defs folder folder:
https://gist.github.com/VapidLinus/ff8ba5a9a8984b3c5bdf

As you can see on line 5, I'm replacing the door class with my own custom class:
<thingClass>VBuilding_Door</thingClass>

So, I've called my custom door class VBuilding_Door. It's identical to the one that comes in the /Source folder, except for formatting and that I'm forcing isOpen to true on the Tick() method.
Here's the source for VBuilding_Door in case you need it:
https://gist.github.com/VapidLinus/1f3fbc288cff6860d83d

However, when loading my mode, I get this error:


I'm guessing it has something to do with the overriden (as in the source of the door) GetCommands<T> method. But I don't understand what or why. It simply says it couldn't load  the type, as you can see in the error.

Any help or thoughts would be appreciated!

JuliaEllie

when you use your own classes you have to use <thingClass>namespace.classname</thingClass>

VapidLinus

Quote from: JuliaEllie on December 25, 2014, 01:51:39 AM
when you use your own classes you have to use <thingClass>namespace.classname</thingClass>
My mod files were in the default RimWorld namespace, so I moved my code to my own new namespace and did what you said. Still didn't work, however. But I found the solution on my own, I had to change the compile version of .NET to 3.5 instead of 4.0. This was a bit of a hassle to do on Windows 8, but I eventually got it to work.