Skip to content
This repository was archived by the owner on Dec 13, 2025. It is now read-only.

The Program Wrapper And Why You Need It

Malware edited this page Dec 13, 2025 · 2 revisions

DEPRECATION NOTICE

This documentation is out of date and no longer maintained.

Please visit the new documentation at: https://spaceengineers.wiki.gg/wiki/Scripting

Again let's look at the program wrapper used in MDK projects.

namespace IngameScript
{
    partial class Program : MyGridProgram
    {
        // Your Script Goes Here
    }
}

This wrapper class has two purposes: Firstly to provide access to the game specific constructs like GridTerminalSystem and Echo. Secondly it's here to simulate the environment your script executes in when the programmable block is running your script.

All your code, even classes and other types, should be wrapped this way to make sure that Visual Studio behaves the same way the Programmable Block will. If you don't, you risk getting compiler errors in Visual Studio that will not happen in the programmable block, and vice versa. The only exception to this wrapping rule are the officially sanctioned "exploit" that are extension classes.

Clone this wiki locally