Jump to content

How to develop mods on Linux?


peteletroll

Recommended Posts

I'm getting a little confused with .NET version, Mono version, monodevelop version... I'm pretty good with Linux and programming, but I have no experience with the .NET/C# world. I was able a couple years ago to write a very small mod to show FPS. Now I want to try writing something more serious:

 

I use Debian. monodevelop from www.monodevelop.com allows me to compile a dll, but the dll can't be loaded by KSP (I'm trying to write a PartModule). It's probably the wrong .NET version... Much of the information I've been able to google looks outdated or incomplete.

Is there any linux-er here who can give me a few pointers?

 

Link to comment
Share on other sites

Getting your build environment figured out is much easier if you start with someone else's already-working project rather than trying to get a new DLL working at the same time (fewer variables and all that). I'd recommend picking your favorite plugin-based mod and compiling it first, and then you can compare your own new project to the one that you know works.

Try installing these packages though:

  • mono-complete
  • mono-tools-devel
  • mono-reference-assemblies-2.0
  • mono-reference-assemblies-3.5
  • mono-reference-assemblies-4.0

(Apologies in advance if any of these have different names on Debian vs Ubuntu, I don't feel like booting up my Stretch VM at the moment.)

Link to comment
Share on other sites

Progress (?) report:

* Tried to find an older version from monodevelop.com to install via flatpak, failed miserably;

* Tried to install monodevelop from oldstable, ended up with a nice dependency mess, tried to manage it and failed, rolled back;

* Started thinking about recompiling from source...

Main problem now is finding a monodevelop version that can compile for .NET 3.5. Looks like Unity development environment is only available for Windows and Mac. Gee, I want to try writing that mod... :-(

 

Link to comment
Share on other sites

3 hours ago, peteletroll said:

Progress (?) report:

* Tried to find an older version from monodevelop.com to install via flatpak, failed miserably;

* Tried to install monodevelop from oldstable, ended up with a nice dependency mess, tried to manage it and failed, rolled back;

* Started thinking about recompiling from source...

Main problem now is finding a monodevelop version that can compile for .NET 3.5. Looks like Unity development environment is only available for Windows and Mac. Gee, I want to try writing that mod... :-(

You can use current monodevelop; many folks, including myself, write mods on Linux. Did you try the packages I listed?

Link to comment
Share on other sites

17 hours ago, HebaruSan said:

many folks, including myself, write mods on Linux.

Thanks @HebaruSan for the encouragement, I found a way out!

It took me a while though. The state of monodevelop in Debian stable looks less than optimal. The IDE crashes soon after any "Open file" dialog, including the new project generation procedure. So I copied another project, and changed the name in the files.

Then I managed to make the IDE recognize .NET 3.5: mono-reference-assemblies-3.5 depends upon mono-reference-assemblies-2.0, but contains just 5 dll files, while mono-reference-assemblies-2.0 has 91. So I tried symlinking the missing DLLs from /usr/lib/mono/2.0-api/ to /usr/lib/mono/3.5-api/, and now the IDE shows .NET 3.5 as available. (Yes, I know, it's an ugly hack...)

Now I can compile my project and make OnAwake() work in my new PartModule. The adventure begins!

Edited by peteletroll
Link to comment
Share on other sites

  • 2 years later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...