Prerequisites

Note

Before following this guide, make sure you've installed and set up MDK Hub. The Hub handles .NET SDK installation, template setup, and project management for you.

Creating a New Project

Option 1: Using Rider's Template UI

  1. Open JetBrains Rider.

  2. Click "New Solution".

    new-solution

  3. In the template list, find and select "Programmable Block Script (MDK2)".

    templates

  4. Choose a name and location for your project, then click "Create".

Option 2: Using the Command Line

Open a terminal and run:

dotnet new mdk2pbscript -n MyFirstScript -o MyFirstScript

Then open the project in Rider.

Option 3: Using MDK Hub

Click "New Project" in the Hub dashboard and let it create the project for you, then open it in Rider.

Note

Make sure you select the Script project template, not the Mixin project. Mixin projects are for advanced shared code libraries.

Building Your Script

  1. Make your code changes in Program.cs or add new .cs files as needed.
  2. Build the project (Ctrl+Shift+F9 or BuildBuild Solution).
  3. MDK will automatically:
    • Combine all your .cs files into a single script
    • Apply minification (if configured)
    • Deploy the script to your Space Engineers IngameScripts folder
    • Show a notification when complete (if Hub is running)

Your compiled script will be available in Space Engineers under Programmable BlockEditBrowse Scripts (the folder icon).

Next Steps


Note

A big thank you to @Drew-Chase who contributed to the Rider documentation.