Visual Studio Setup Guide

From Space Engineers Wiki
Jump to: navigation, search

This page will walk you through how to install and set up Visual Studio 2015 to start programming in Space Engineers whether it's an ingame script or a mod. In order to use the SE assemblies you need Visual Studio 2015 or newer.

Installation

You can get Visual Studio 2015 from http://www.visualstudio.com. The Community edition is free and is all you need to program in Space Engineers.

The default installation requires 10 GB of free space but if you don't have the space you can perform a custom installation and only install the C#/.NET features.

Starting a Project

Starting a SE scripting project in Visual Studio is pretty simple.

  1. Open Visual Studio and at the top left of the window click File > New > Project or press Ctrl + Shift + N.
  2. In the dialog that appears, find the C# templates and select the "Class Library" template. Name the project if you want to and click OK.
  3. In the top left of VS, click Project > Add Reference and click Browse in the dialog that appears.
  4. Navigate to your SE installation directory, which is usually [Steam installation directory]\steamapps\common\SpaceEngineers\Bin64.
  5. Ctrl+click all of the .dll files that have "VRage," "Sandbox," or "SpaceEngineers" in the filename and click Add. Not all of these .dlls are necessary but it's quicker and more convenient to add them all.
  6. If you are creating a mod, this is all the setup you need to do. Refer back to the Modding Guide to continue.
  7. If you are creating an ingame script, replace the text in Class1.cs with this template: http://pastebin.com/eGe54p0U

Note

Not all types and methods can be used in scripts. Refer to the Scripting Whitelist for more information.