How to Install a Pull Request - KSP-RO/RP-1 GitHub Wiki

So, you want to download and install your favorite PR (Pull Request) because it's got some handy new features you want to try, but you can't bother to wait until the mod releases to try it out as intended. Be warned, not all pull requests are of good quality, and some might just break your game. (I should know)

There's 2 types of Pull Requests that we need to consider.


No compilation needed!

For the first type, let's take a look at the Early Lunar Habitation program PR for RP-1, merged in v4.4.0.0. Open up the "Files Changed" tab to see what this PR changes.

Now take a look at the left side of your screen to see what folders the changes take place in.

If all of the changes are contained within GameData (or, for RP-1, in Source/Tech Tree)*, then congratulations, you've got a GameData-only PR. All you need to do for this type of PR is retrieve the changed files in the repository/branch that the PR is pulling from. Find this repository by clicking the text where the arrow is pointing in the below screenshot.

*More specifically, if none of the changes include a change to a file ending with .dll, .cs, .csproj, and/or .sln. (assuming everything is in C#)

Now, you can follow the standard process of downloading a mod from the source code, being careful not to delete any .dll files present in your original install. If you're downloading multiple PRs and they edit the same file, try to combine them in the least destructive way possible, keeping attention to how the changes were structured originally. For RP-1, you can ignore any changes made to Source/Tech Tree, as they won't affect gameplay for you.

[!WARNING] Whenever you download a branch's entire repository zip and unzip it in your game folder, you are doing these possibly dangerous actions which could leave your install in a corrupted state:

  • The branch could be based on a state of the official repository which is either ahead or behind in changes from an official release. Unzipping and replacing files with a branch could in effect upgrade/downgrade your RP-1 version unexpectedly, or at least move it off of a numbered release.
  • This breaks CKAN's assumptions for how your game data is updated. CKAN tries to play nice with user-manually-installed data, but I think it doesn't handle changes within CKAN-installed mods' files. The next time CKAN updates your modified mod, it may still leave behind the additional files that you had added manually before updating. These files are not guaranteed to work with the new core mod behavior after the update.
  • If the PR has removed files, those removals will not be done by unzipping into your game folder.

A more reliable way to upgrade is to methodically go through the changed files in the PR and reapply those changes. This is rather easy when the only changes are a few added files. If you are very comfortable with git, you could make your own clone/fork of RP-1 and use git tools to merge PRs into your own copy. You will still need to manage its synchronization with the official repository as well; you might need to redo merges after retrieving the latest official release of the mod. Also, keep in mind that PRs for RP-1 also often depend on other PRs for RO, ROKerbalism, etc. These dependencies are usually linked in the PR description/comments. You will need to do the same process for those mods as well.


Compilation needed

For the second type, let's take a look at this PR for RP-1. If you open up the "Files Changed" tab, you'll notice that there are files changed that are not in GameData or Source/Tech Tree.

This means that simply copying the repository's source code won't work if the source code doesn't contain an updated .dll file. (it most likely won't for a PR)

You have three options from here.

If you see a release page in the PR's repository, then they've likely built the .dll for you. How nice!

Open the release page, follow its instructions, and download the mod through there.

If not, go back to the conversations tab of the PR.

If you see a message that contains a .zip file, then great! That will work perfectly fine as well, just download that normally.

If still not, then you're mostly out of luck at this point. You could try either building the source code yourself to generate the .dll files, or asking the PR author (nicely) to generate them for you.