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.
Warning
If you have the original MDK (version 1) installed, you should uninstall it. MDK² works quite differently, and keeping the original around may cause conflicts.
Creating a New Project
Open Visual Studio.
Click "Create a new project" (or
File→New→Project).Search for "MDK" in the template search box.
Select "Programmable Block Script (MDK2)".
The URL shown in the screenshot (https://github.com/malware-dev/MDK-SE) is outdated. The current repository is https://github.com/malforge/mdk2.
Choose a name and location for your project, then click "Create".
Note
Make sure you select the Script project template, not the Mixin project. Mixin projects are for advanced shared code libraries.
Tip
Having trouble? If you can't find the MDK templates or encounter issues creating a project, you can use the Hub to create projects instead. Just click "New Project" in the Hub dashboard.
Building Your Script
- Make your code changes in
Program.csor add new.csfiles as needed. - Build the project (
Ctrl+Shift+BorBuild→Build Solution). - MDK will automatically:
- Combine all your
.csfiles 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)
- Combine all your
Your compiled script will be available in Space Engineers under Programmable Block → Edit → Browse Scripts (the folder icon).
Next Steps
- Configure your project - Adjust minification levels, ignore patterns, and more
- Control file order - Manage how your files are combined
- Preserve code during minification - Keep specific types/methods unminified