I spent the day doing some serious digging. And the result so far is... strange.TheLacus wrote: ↑Sat Jul 18, 2020 12:55 pm Your mod is relatively big so it's not easy to find out what exactly is causing this issue. I'd suggest to consider compiling most, if not all, of your mod using Visual Studio and load the assembly at run time from resulting .dll file, but I understand this might be overwhelming.
I took my C&C code and stripped it down to a few lines of code, then built it up piece by piece. For each bit of code, building a new dfmod file and running it in a clean version of 0.10.25a in the Unity editor, containing only the dfmod files of my mods.
Note: With the complete version of C&C, four "Index was outside the bounds of an array" errors would appear when loading it with my other mods.
With only a few lines of code, no errors occurred.
I built and built without anything happening. Until I only had the main methods left. Before I even got that far, the error occurred. But only one error, not four. So I stopped adding and started pruning the code to see what exact line caused it.
And I wound up with... no specific line. It is the LENGTH of the script that is the problem. I confirmed this by removing enough of the code to not get the error and then I added:
//error?
in an unimportant spot in the code. And then I got "Index was outside the bounds of an array" again.
I haven't tested it yet, but in theory, I could make this error happen by taking a mod without the error and just add enough commented out lines to it?