Jump to content

Getting started with MonoDevelop (in 2020) and I have questions


Recommended Posts

I am going to try and edit/personalize an existing mod for the coming year.
So I've installed MonoDevelop (as per outdated wiki instructions) and have opened the 'solution' of the mod that I'd like to toy with.
But now I'm stuck dealing with dependencies, I think...:

- The option  'Project > Edit References' is greyed out unless I have selected something that IS NOT a 'solution'.
-  I tried to find the KSP.app in the 'Kerbal Space Program'-directory, didn't find it, but found seemingly a perfect directory named 'KSP_Data/Managed' that has contents that are named 'Assembly-CSharp.dll', 'Assembly-CSharp-firstpass.dll', 'KSPAssets.dll' and 'UnityEngine.dll'.
-  The current project doesn't like those 'new .dll's and still demands that I provide it with the 'proper versions' of those .dlls.
-  I will eventually have to turn this code into a .dll, and not a .exe (as most monoDevelop tutorials explain). How do I set that?

Other info:
Doing this on Ubuntu, so sometimes things aren't were one would go looking for them in Windows. But I don't know when or which times that is an issue.
I've set the 'project/solution'-Options-General-'target framework' to '.NET Framework 4'. I don't know what means, but is was 'very required' according to a post on this forum I can't find anymore.

Edited by The-Grim-Sleeper
Link to comment
Share on other sites

Yes, KSP_Data/Managed is where you find the libraries to reference for your own library. You need those four, but there are also other Unity libraries that have been included that you will have to pull from if you implement any of those methods. The four that you mentioned are the _minimum_.

You might also want to grab the mscorlib.dll, I"m not sure though. Try without first and then if you're having problems just grab it so you have another thing in common with KSP.

EDIT: You don't need mscorlib.dll from KSP.

----------------

I set my Monodevelop to the "Design" setting (under the View tab), and that shows all the files on the left and some other stuff on the right side that I personally don't find helpful. Once you run a build the build output should show up underneath.

----------------

To edit references: either copy the relevant .dlls to a new, easier to access folder on your desktop/home folder or just use the hidden steam folder.

Then click the arrows next to the solution to uncollapse it, letting you see the .csproj file and then the references link and all the folders and files of the actual project.

Double click the references link, which should open an "edit references" pop-up.

Choose the .Net Assembly tab (last one for me), and then click "Browse" near the lower right corner.

Then find your .dlls that you're referencing and select them, and click "Open" once you have the relevant ones selected.

----------------

You can also delete the references to their old .dlls because you're providing the new ones, but it's still looking for them in a place that doesn't exist on your computer.

----------------

You don't need to worry about the target (library vs executable) if you're loading someone else's KSP mod. It will already be set to output a .dll in either the solution or the project file.

If you're making your own mod from scratch, you need to choose the .NET Library option when creating the project.

---------------

The .NET framework just describes what classes and methods there are provided by Microsoft. KSP is now able to use .NET 4.x with 1.8.1, so using that is pretty good idea, as there have been some major improvements to C# in this time.

Edited by Benjamin Kerman
Link to comment
Share on other sites

On 12/23/2019 at 5:26 PM, Benjamin Kerman said:

Good stuff

Thank you for the reply.

I tried to build the project and was required to add some more .dll's but I got a whole boat-load of errors relating to imports.
The only thing or it was to import every single .dll in 'KSP_Data/Managed' and making an explicit reference to a class that was made by the mod author, that somehow fails to import (is 'using' a technical term?)

I have successfully build the .dll that belongs to this mod.
Can I just drop that in place of the existing .dll in the /Game_Data/<ModDirectory>/<whatevers> to test it in KSP?
Are there any convenient ways to test things without haveing to (re-)launch KSP?

Link to comment
Share on other sites

2 hours ago, The-Grim-Sleeper said:

Are there any convenient ways to test things without haveing to (re-)launch KSP?

Unfortunately if you make a change to the dll you have to relaunch KSP. I personally have a minimal install just for development, and use Post Build Events to automatically copy the dll to that installation and launch KSP for me.

Link to comment
Share on other sites

2 hours ago, The-Grim-Sleeper said:

Can I just drop that in place of the existing .dll in the /Game_Data/<ModDirectory>/<whatevers> to test it in KSP?
Are there any convenient ways to test things without haveing to (re-)launch KSP?

Yes, you just drop it in, however KSP has already loaded the old .dll if it's open so you'll have to restart. One thing you can do if you don't have a very fast disk or are just very interested in fast loading times is to go through your gamedata folder and chop a lot of the parts out (just delete them). You'll have to be careful, there are some parts that the game will not load without (like the potatoroid), but many of the other ones are disposable. 

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