How to compile LMP

Thygrrr edited this page Oct 4, 2018 · 16 revisions
  1. Download and install Visual Studio 2017 to write and build the dll. Any version will work.
    You can get the community version here

  2. Make sure that the .NET framework 4.7 development tools is installed in your VS2017. You can do it by selecting the .NET desktop development workload in the visual studio installer and then selecting the .NET framework 4.7 development tools component in the right panel

  3. Make sure that the Tools for Unity is installed in your VS2017. You can do it by selecting the Game development with Unity workload in the visual studio installer, also you can uncheck the Unity XXXX 64-bit Editor in the right panel to save some space

  4. Now that you've got the necessary tools, use git to checkout and pull the latest copy of the LunaMultiplayer project.

  5. Go to the main folder and double click the LunaMultiPlayer.sln file, opening it in Visual Studio.

  6. Adjust the Scripts\SetDirectories.bat file with the correct KSP Directory.
    The line to edit is: SET KSPPATH=C:\Kerbal Space Program

  7. Copy the Assembly-CSharp.dll, UnityEngine.dll and UnityEngine.Ui.dll files from C:\Kerbal Space Program\KSP_x64_Data\Managed to External/KSPLibraries. You MUST repeat this process every time KSP is updated.

  8. Make sure you have Debug mode set in Visual studio at the top.
    Do not use Release mode as developers only test with Debug.

  9. Compile in visual studio by going to build->rebuild project

  10. Once built, the plugin should automatically be updated in your Kerbal Space Program plugins folder. You will need to restart Kerbal Space Program, if it's open.

Analytics

Tips & Troubleshooting

If you use git via WSL (Windows Subsystem for Linux), chances are your File Systems are Case Sensitive. The codebase and build files are not built with that in mind, so there can be errors about missing source files, e.g. KspCompatible.cs vs. KSPCompatible.cs

One approach is to turn it off per-directory, or to turn it off wholesale by editing or creating a /etc/wsl.conf:

[automount]
enabled = true
root = /
options = "metadata,umask=22,fmask=11,case=off"
mountFsTab = false
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.