-
Notifications
You must be signed in to change notification settings - Fork 123
Deploying Your Script to Space Engineers
When you want to test your script, you will need to deploy it to Space Engineers. This process will combine all your utility and extension classes together and create one complete script ready for Space Engineers to use.
There are a couple of ways to deploy your script, depending on your requirements. Usually you'll want to deploy just one single script project. In fact, most of you will probably have just a single script project in your solution. To deploy a single project, you right-click the project in question in the Solution Explorer, then select Deploy MDK Script.
If you have a solution with many projects, you may want to deploy all of them at once. You can do that by right-clicking on the topmost solution node instead of the individual project node.
You can put deployment time information into your script automatically using certain macros. In order to both try to save a little time and to make sure these macros don't mess up any code, they only work inside special code regions.
You can put deployment time information into your script automatically using certain macros. In order to both try to save a little time and to make sure these macros don't mess up any code, they only work inside special code regions.
#region mdk macros
// This script was deployed at $MDK_DATETIME$
const string Deployment = "$MDK_DATE$, $MDK_TIME$"
#endregion
MDK deployment works by taking all your .cs files and packing them into a single file that Space Engineers understands. You can control where each individual .cs files are placed in relation to each other by adding
// <mdk sortorder="100" />
at the very top of the code files you wish to control, even above the using
statements. The sortorder number will be used to determine the orders of the files. You can also use negative sortorders to force files above the Program class. Of course, certain rules will be above even the sortorder: The readme.cs
file will always be on top no matter what, and classes that is not inside a partial class Program
will by necessity have to be at the bottom simply due to how such classes work.
The Programmable Block only allows for 100'000 characters. if your script goes above this, the Minifier will reduce your character count for you without impeding the development of your script.
Do you have questions, comments, suggestions for improvements? Is there something I can do better? Did I make a mistake? Please add an issue here, and prefix your issue title with Wiki. Thank you, your help will be very appreciated!