Jump to content

Can you use other languages besides C# to write plugins for KSP?


Recommended Posts

You could probably use any .net language, but not C++. There are ways to call into C++ from C# - see http://stackoverflow.com/questions/18997672/calling-unmanaged-c-from-c-sharp - but you'd almost certainly be better off just working entirely in C#.

It's not that hard to pick up some C# for KSP modding. I'd suggest just going for it - or if you don't want to confuse your C++ habits, something like F#.

Link to comment
Share on other sites

You could probably use any .net language, but not C++. There are ways to call into C++ from C# - see http://stackoverflow.com/questions/18997672/calling-unmanaged-c-from-c-sharp - but you'd almost certainly be better off just working entirely in C#.

It's not that hard to pick up some C# for KSP modding. I'd suggest just going for it - or if you don't want to confuse your C++ habits, something like F#.

you can compile C++ to a .NET dll but you'll need to write managed C++

Link to comment
Share on other sites

Managed C++ is called c++/cli now for some reasons. It is important to note that afaik Mono can only handle pure .net assemblies (c++/cli allows some crazy .... with native libraries, but that's platform depended [=bad] and tricky to realize). That means you would have to exclusively rely on manged libraries, preferably the .NET Framework Class Library. That's like learning a new language, and thus not much harder to switch to c#. I think there were also some issues [though resolvable] with creating c++ assemblies for .net 3.5. Also pretty much all "reference" code (other mods) are in C#, so you should be able to read c# anyway.

tl;dr C++ KSP modding is not worth it. Use/learn C#.

Link to comment
Share on other sites

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...