Developing mods on Linux with Mono (from the command line)

Started by llunak, July 25, 2021, 09:59:05 AM

Previous topic - Next topic

llunak

The Linux-related tutorials recommend using MonoDevelop, which nowadays appears to be unmaintained. The openSUSE page on MonoDevelop says it works only in a container, and even the flatpak does not work anymore. However, I've found out that it's possible to use Mono alone to develop RimWorld mods, using only text editor or IDE one wants:

Setup for building a mod:
- Install Mono (refer to your distro's instructions if needed).
- It seems people usually develop mods using .csproj files , for building those the 'dotnet' tool is needed, from the NET SDK. Install it from https://dotnet.microsoft.com/download or refer to your distro's instructions (e.g. https://en.opensuse.org/DotNet for openSUSE).
- For building use a command like the following:
FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.7.2-api/ dotnet build <project file>.csproj /property:Configuration=Release
- If you get errors, it is necessary to edit the .csproj file, usually to fix the paths (point them to .dll files in RimWorld/RimWorldLinux_Data/Managed).
- That's it.
- See https://rimworldwiki.com/wiki/Modding_Tutorials/Setting_up_a_solution for how it's done with other setups (may be useful when editing .csproj files).

Decompiling RimWorld source code:

- Get ILSpy (https://github.com/icsharpcode/ILSpy).
- Follow the build instructions there (although in my case a release tarball worked, no need to do a git checkout, and I needed NET Core 3.1 too).
- When built, find the 'ilspycmd' tool (should be in ICSharpCode.Decompiler.Console/bin/Release/netcoreapp3.1).
- Run something like the following command: ilspycmd RimWorld/RimWorldLinux_Data/Managed/Assembly-CSharp.dll -p -o <output directory>
- That's it, you should have decompiled sources in the output directory.

PS: I suppose this should preferably be added to the wiki, but it appears I cannot edit https://rimworldwiki.com/wiki/Modding_Tutorials/Setting_up_a_solution .


llunak

Eh what? Just because something still has a webpage doesn't mean it's still maintained.


RawCode

\what exactly issue you have with monodevelop, probably some error, lack of feature, or anything similar?

lack of updates is not issue on it's own, you can run software not updated in DECADES just fine (and your PC won't turn into pumpkin if you run windowsXP)

Canute

from the website
© 2021 MonoDevelop Project
I think that can indicate that the website is still uptodate.

llunak

Wikipedia lists the last stable release as almost 3 years ago, and its github activity apparently died January 2020. Plus as I said https://en.opensuse.org/MonoDevelop basically warns against it and the steps there error out.
If it works for you, fine. This is for whoever will have a problem with MonoDevelop, or simply will not want to use it (my case, actually, even if it worked).


RawCode

you should not promote your personal preferences for no reason.

it's okay to say something like:
Software X lack feature Y but software Z have all features.

But absolutely not okay to say:
Software X is old do not use it because i don't like it.

llunak

Every single sentence I wrote is factually correct. If you have nothing useful to say, at least do not misinterpret what I wrote.