-
Notifications
You must be signed in to change notification settings - Fork 11
Visual Studio Setup
First, get the tool from: visualstudio.microsoft.com.
The community edition is free, which requires a (also free) Microsoft account login to continue to work after 30 days, tiny price to pay for the huge amount of help this tool provides.
NOTE: "Visual Studio Code" is a completely different tool, this guide is for Visual Studio, 2019 community edition in particular.
Workloads: .NET Desktop development
Optional components must contain .NET Framework 4 - 4.6 development tools
Everything else is up to you.
- Create a new project, Class Library (.NET Framework) for C#, click Next, then pick Framework: .NET Framework 4.6.1
What folder you pick is up to you, it can go in the mod's root folder just fine as long as you don't publish that particular folder and copy to a clean one instead.
Once done, click Create.
-
Build > Configuration Manager then click top-right on "Active solution platform" and <New...>, then pick x64 platform and OK.
-
Project > Add Referrence, Browse, navigate to Space Engineers' Bin64 folder and add:
- netstandard.dll
- ProtoBuf.Net.Core.dll
- Sandbox.Common.dll
- Sandbox.Game.dll
- Sandbox.Graphics.dll
- SpaceEngineers.Game.dll
- SpaceEngineers.ObjectBuilders.dll
- VRage.dll
- VRage.Game.dll
- VRage.Input.dll
- VRage.Library.dll
- VRage.Math.dll
- VRage.Render.dll
- VRage.Render11.dll
-
Optional: Open the References in the solution explorers and select all of them (except Analyzers), right click > Properties then click the down arrow for Copy Local and set it to False.
The mod scripts obey a whitelist of types (and in some cases specific methods in types) so that they cannot access things outside of the game context or mess around with too many game internals...
The list is pretty complicated: from SEWhitelistDiagnostic's source
There's an analyzer for Visual Studio: https://github.com/WhitePhoera/SEWhitelistDiagnostic
Or you can use PhoBot in the Keen discord with ?wcheck TypeNameHere. It's only for types, do not ask it to check methods/fields/etc.
You can also private-message PhoBot#4124 with the command to not spam the public chat.
Gamelogic and Session examples
And in the same repo there's various other examples, explore away :}
For help finding your way around the API and other questions, ask in #modding-programming channel in Keen's discord.
You can see changes in N revisions under the title for this page or Wiki History for all changes.
-
Scripts/Programming
-
SBC