• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Wumpus

First Lieutenant
4 Badges
Apr 24, 2018
228
0
  • Stellaris
  • BATTLETECH - Initiate of the Order
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
Hi all, just wondering if anyone is successfully building mod .dlls for battletech under linux? All the instructions I can find assume MS Visual blah blah tools. I have past development experience but I'm not up to date on current C# tools for linux so I don't really know where to start. If anyone could point me at a quickstart guide, that would be super awesome. Thanks in advance!
 
I can confirm it is possible as I do it. I don't know of any guide as I just worked it out on my own. So there may be a better way but my way works. For my way you'll probably have to modify a *.csproj file and need to have "msbuild" installed unless you want to fight with hand-crafting your own makefiles. Depending on your Linux distro, it may not provide a version of msbuild with the various mono C# tools. You can get packages for it and current mono from the mono project.

If you grab the source for CBTMovementCore from github, you can see under the CBTMovement directory a CBTMovement.csproj file and a CBTMovement.csproj.linux file. The CBTMovement.csproj.linux file is a modified version of the original CBTMovement.csproj file tweaked so that I can build CBTMovementCore on my Linux system. The main thing was just changing the hint locations to tell msbuild where to find the battletech C# code. "msbuild CBTMovement.csproj.linux" is then capable of building the mod on my Linux system. If you try and build it, you may have to tweak the paths in CBTMovement.csproj.linux if your directory locations don't match mine.

So that's my method. Copy an *.csproj file created by the windows tools and then tweak it so that msbuild can use it on a Linux system.
 
C# is not compiled to native code most of time. No need cross compiling. Bytecode will be interpreted by mono in linux. Just use monodevelop. Using it you can build your C# project from IDE. And modify source with code completion and navigation. msbuild provided by mono though.