Skip to content

Building Telemachus Reborn

Brandon Frie edited this page Apr 15, 2020 · 1 revision

Prerequisites

Before you get started, you will need a few things:

  • Visual Studio 2015+ (or other similar IDE with a C# compiler)
    • .Net Desktop Environment is needed for Visual Studio 2017+
  • A git client for your platform

Step 1: Cloning

To get started, you will need to clone the repository to your local machine. First, you'll want to navigate into a directory where you'd like to download the code, for example:

cd ~/projects

Then, you'll want to download the code from Github. This will create a new directory called Telemachus-1 in whatever is your current working directory. You can do this by typing:

git clone [email protected]:TeleIO/Telemachus-1.git

Finally, change directories into the newly created project directory:

cd Telemachus-1

Step 2: Building

Now that you have the code, you can run a build. Start by opening the solution file in your IDE: <repository-root>/Telemachus.sln

Once the solution loads, you can choose between a debug build or a release build. To do this, simply switch the build configuration to the desired build using the Configuration Manager.

The main difference between a debug build and a release build is the amount of logging that occurs. Debug builds will have significantly more logging to assist with the development process.

After you've selected your desired build configuration, click Build -> Build Solution from the top menu.

The build process outputs build artifacts to the following directory:

  • <repository-root>/Telemachus/bin/Debug for debug releases
  • <repository-root>/Telemachus/bin/Release for production releases

Step 3: Post-build Actions

After the build process completes, some files need to be collected together to conform with the expected directory structure of a KSP plugin. To assist with this process, you will need to run a post-build batch file. You will need to take note of two key paths required to run this file:

  • TargetDir: The path where the build artifacts were output (usually bin/Debug or bin/Release)
  • ProjectDir: The project-level directory where the Telemachus.csproj file lives (usually Telemachus-1/Telemachus)

On Windows, you will want to run AfterBuild.bat, and on Linux/Mac, you'll want to run AfterBuild.sh. This script file will do several things:

  • create a publish directory at the repository root folder
  • create the correct plugin directory structure in the publish directory
  • copy in the required plugin DLLs from the TargetDir
  • copy in all the part files
  • download MKON and Houston from github and place them in the correct path

Step 4: Testing

Once the batch file completes, you should now have a complete plugin built and stored at <repository-root>/publish. To install this freshly-built copy, follow these steps:

  • delete any existing Telemachus install from <KSP-root>/GameData/
  • copy the complete folder Telemachus found under <repository-root>/publish/GameData/ into your KSP install under <KSP-root>/GameData/
  • start KSP
  • load a game
  • under command-control select 1 of the 2 telemachus antennas, put them on your vessel & fly/launch
  • right click on the telemachus-antenna
  • select 'open link' - your browser should open a webpage served by your telemachus-mod (e.g. http://127.0.0.1:8085/ )

Getting Help

If you're stuck and these instructions aren't getting it done for you, please feel free to join us on Discord.

Clone this wiki locally