Lot of changes (Update to MDK2)
This commit is contained in:
parent
6b3ee666d6
commit
93b3689567
48 changed files with 706 additions and 1005 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,6 +1,8 @@
|
||||||
## Ignore Visual Studio temporary files, build results, and
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
## files generated by popular Visual Studio add-ons.
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
|
||||||
|
*backup*
|
||||||
|
|
||||||
.vs
|
.vs
|
||||||
|
|
||||||
# User-specific files
|
# User-specific files
|
||||||
|
|
|
||||||
|
|
@ -1,59 +1,31 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<PropertyGroup>
|
||||||
<PropertyGroup>
|
<TargetFramework>netframework48</TargetFramework>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<RootNamespace>IngameScript</RootNamespace>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<LangVersion>6</LangVersion>
|
||||||
<ProjectGuid>{141E1804-F644-48F8-A3D8-BEFEEE66ECBA}</ProjectGuid>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
<OutputType>Exe</OutputType>
|
<Configurations>Release;Debug</Configurations>
|
||||||
<RootNamespace>IngameScript</RootNamespace>
|
<Platforms>x64</Platforms>
|
||||||
<AssemblyName>AutoPilot</AssemblyName>
|
</PropertyGroup>
|
||||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
<ItemGroup>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<PackageReference Include="Mal.Mdk2.PbAnalyzers" Version="2.1.9">
|
||||||
<TargetFrameworkProfile />
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PropertyGroup>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
</PackageReference>
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<PackageReference Include="Mal.Mdk2.PbPackager" Version="2.0.6">
|
||||||
<OutputPath>bin\</OutputPath>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<DebugType>full</DebugType>
|
</PackageReference>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PackageReference Include="Mal.Mdk2.References" Version="2.2.2" />
|
||||||
<ErrorReport>prompt</ErrorReport>
|
</ItemGroup>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<Prefer32Bit>true</Prefer32Bit>
|
<ItemGroup>
|
||||||
<LangVersion>6</LangVersion>
|
<None Remove="Instructions.readme" />
|
||||||
</PropertyGroup>
|
<AdditionalFiles Include="Instructions.readme" />
|
||||||
<ItemGroup>
|
</ItemGroup>
|
||||||
<Reference Include="netstandard" />
|
|
||||||
<Reference Include="System" />
|
<Import Project="..\SECommon\SECommon.projitems" Label="Shared" />
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
</Project>
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="MDK/MDK.options.props" />
|
|
||||||
<Import Project="MDK/MDK.paths.props" Condition="exists('MDK/MDK.paths.props')" />
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="MDK\Bootstrapper.cs" />
|
|
||||||
<AdditionalFiles Include="MDK\MDK.options.props">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</AdditionalFiles>
|
|
||||||
<AdditionalFiles Include="MDK\MDK.paths.props">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</AdditionalFiles>
|
|
||||||
<Compile Include="Program.cs" />
|
|
||||||
<AdditionalFiles Include="Instructions.readme" />
|
|
||||||
<AdditionalFiles Include="thumb.png" />
|
|
||||||
<AdditionalFiles Include="MDK\whitelist.cache" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="..\SECommon\SECommon.projitems" Label="Shared" />
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
<Copy SourceFiles="MDK\MDK.options.props" DestinationFolder="$(TargetDir)\MDK" />
|
|
||||||
<Copy SourceFiles="MDK\MDK.paths.props" DestinationFolder="$(TargetDir)\MDK" />
|
|
||||||
</Target>
|
|
||||||
</Project>
|
|
||||||
|
|
|
||||||
22
AutoPilot/AutoPilot.mdk.ini
Normal file
22
AutoPilot/AutoPilot.mdk.ini
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
; This file is project specific and should be checked in to source control.
|
||||||
|
|
||||||
|
[mdk]
|
||||||
|
; This is a programmable block script project.
|
||||||
|
; You should not change this.
|
||||||
|
type=programmableblock
|
||||||
|
|
||||||
|
; Toggle trace (on|off) (verbose output)
|
||||||
|
trace=off
|
||||||
|
|
||||||
|
; What type of minification to use (none|trim|stripcomments|lite|full)
|
||||||
|
; none: No minification
|
||||||
|
; trim: Removes unused types (NOT members).
|
||||||
|
; stripcomments: trim + removes comments.
|
||||||
|
; lite: stripcomments + removes leading/trailing whitespace.
|
||||||
|
; full: lite + renames identifiers to shorter names.
|
||||||
|
minify=none
|
||||||
|
|
||||||
|
; A list of files and folder to ignore when creating the script.
|
||||||
|
; This is a comma separated list of glob patterns.
|
||||||
|
; See https://code.visualstudio.com/docs/editor/glob-patterns
|
||||||
|
ignores=obj/**/*,MDK/**/*,**/*.debug.cs
|
||||||
7
AutoPilot/AutoPilot.mdk.local.ini
Normal file
7
AutoPilot/AutoPilot.mdk.local.ini
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
; This file is _local_ to your machine and should not be checked in to source control.
|
||||||
|
|
||||||
|
[mdk]
|
||||||
|
; Where to output the script to (auto|specific path)
|
||||||
|
output=auto
|
||||||
|
; Override the default binary path (auto|specific path)
|
||||||
|
binarypath=auto
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
using Malware.MDKUtilities;
|
|
||||||
|
|
||||||
namespace IngameScript.MDK
|
|
||||||
{
|
|
||||||
public class TestBootstrapper
|
|
||||||
{
|
|
||||||
// All the files in this folder, as well as all files containing the file ".debug.", will be excluded
|
|
||||||
// from the build process. You can use this to create utilites for testing your scripts directly in
|
|
||||||
// Visual Studio.
|
|
||||||
|
|
||||||
static TestBootstrapper()
|
|
||||||
{
|
|
||||||
// Initialize the MDK utility framework
|
|
||||||
MDKUtilityFramework.Load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Main()
|
|
||||||
{
|
|
||||||
// In order for your program to actually run, you will need to provide a mockup of all the facilities
|
|
||||||
// your script uses from the game, since they're not available outside of the game.
|
|
||||||
|
|
||||||
// Create and configure the desired program.
|
|
||||||
var program = MDKFactory.CreateProgram<Program>();
|
|
||||||
MDKFactory.Run(program);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<!--
|
|
||||||
Contains basic settings that should be included in code repositories
|
|
||||||
-->
|
|
||||||
<MDKVersion>1.5.17</MDKVersion>
|
|
||||||
<MDKTrimTypes>
|
|
||||||
<Enabled>no</Enabled>
|
|
||||||
</MDKTrimTypes>
|
|
||||||
<MDKMinify>
|
|
||||||
<Level>None</Level>
|
|
||||||
</MDKMinify>
|
|
||||||
<MDKIgnore>
|
|
||||||
<Folder>mdk</Folder>
|
|
||||||
</MDKIgnore>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<!--
|
|
||||||
You can safely exclude this file from code repositories and use different
|
|
||||||
user settings per machine.
|
|
||||||
-->
|
|
||||||
<MDKVersion>1.4.14</MDKVersion>
|
|
||||||
<MDKUseGameBinPath>no</MDKUseGameBinPath>
|
|
||||||
<MDKGameBinPath>G:\SteamLibrary\SteamApps\common\SpaceEngineers\Bin64</MDKGameBinPath>
|
|
||||||
<MDKInstallPath>c:\users\lyssmetal\appdata\local\microsoft\visualstudio\17.0_6c02a30d\extensions\twejjmj5.r1e</MDKInstallPath>
|
|
||||||
<MDKOutputPath>C:\Users\LyssMetal\AppData\Roaming\SpaceEngineers\IngameScripts\local</MDKOutputPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Sandbox.Common">
|
|
||||||
<HintPath>$(MDKGameBinPath)\Sandbox.Common.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Sandbox.Game">
|
|
||||||
<HintPath>$(MDKGameBinPath)\Sandbox.Game.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Sandbox.Graphics">
|
|
||||||
<HintPath>$(MDKGameBinPath)\Sandbox.Graphics.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SpaceEngineers.Game">
|
|
||||||
<HintPath>$(MDKGameBinPath)\SpaceEngineers.Game.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SpaceEngineers.ObjectBuilders">
|
|
||||||
<HintPath>$(MDKGameBinPath)\SpaceEngineers.ObjectBuilders.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Audio">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Audio.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Game">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Game.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Input">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Input.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Library">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Library.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Math">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Math.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Render">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Render.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Render11">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Render11.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Scripting">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Scripting.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="MDKUtilities">
|
|
||||||
<HintPath>$(MDKInstallPath)\MDKUtilities.dll</HintPath>
|
|
||||||
<Private>true</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Collections.Immutable">
|
|
||||||
<HintPath>$(MDKGameBinPath)\System.Collections.Immutable.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Analyzer Include="$(MDKInstallPath)\Analyzers\MDKAnalyzer.dll" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
4
AutoPilot/packages.config
Normal file
4
AutoPilot/packages.config
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Mal.Mdk2.PbPackager" version="2.0.0-alpha073" targetFramework="net48" />
|
||||||
|
</packages>
|
||||||
31
BaseMiner/BaseMiner.csproj
Normal file
31
BaseMiner/BaseMiner.csproj
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netframework48</TargetFramework>
|
||||||
|
<RootNamespace>IngameScript</RootNamespace>
|
||||||
|
<LangVersion>6</LangVersion>
|
||||||
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
|
<Configurations>Release;Debug</Configurations>
|
||||||
|
<Platforms>x64</Platforms>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Mal.Mdk2.PbAnalyzers" Version="2.1.9">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Mal.Mdk2.PbPackager" Version="2.0.6">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Mal.Mdk2.References" Version="2.2.2" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="Instructions.readme" />
|
||||||
|
<AdditionalFiles Include="Instructions.readme" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Import Project="..\SECommon\SECommon.projitems" Label="Shared" />
|
||||||
|
|
||||||
|
</Project>
|
||||||
22
BaseMiner/BaseMiner.mdk.ini
Normal file
22
BaseMiner/BaseMiner.mdk.ini
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
; This file is project specific and should be checked in to source control.
|
||||||
|
|
||||||
|
[mdk]
|
||||||
|
; This is a programmable block script project.
|
||||||
|
; You should not change this.
|
||||||
|
type=programmableblock
|
||||||
|
|
||||||
|
; Toggle trace (on|off) (verbose output)
|
||||||
|
trace=off
|
||||||
|
|
||||||
|
; What type of minification to use (none|trim|stripcomments|lite|full)
|
||||||
|
; none: No minification
|
||||||
|
; trim: Removes unused types (NOT members).
|
||||||
|
; stripcomments: trim + removes comments.
|
||||||
|
; lite: stripcomments + removes leading/trailing whitespace.
|
||||||
|
; full: lite + renames identifiers to shorter names.
|
||||||
|
minify=none
|
||||||
|
|
||||||
|
; A list of files and folder to ignore when creating the script.
|
||||||
|
; This is a comma separated list of glob patterns.
|
||||||
|
; See https://code.visualstudio.com/docs/editor/glob-patterns
|
||||||
|
ignores=obj/**/*,MDK/**/*,**/*.debug.cs
|
||||||
7
BaseMiner/BaseMiner.mdk.local.ini
Normal file
7
BaseMiner/BaseMiner.mdk.local.ini
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
; This file is _local_ to your machine and should not be checked in to source control.
|
||||||
|
|
||||||
|
[mdk]
|
||||||
|
; Where to output the script to (auto|specific path)
|
||||||
|
output=auto
|
||||||
|
; Override the default binary path (auto|specific path)
|
||||||
|
binarypath=auto
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
using Malware.MDKUtilities;
|
|
||||||
|
|
||||||
namespace IngameScript.MDK
|
|
||||||
{
|
|
||||||
public class TestBootstrapper
|
|
||||||
{
|
|
||||||
// All the files in this folder, as well as all files containing the file ".debug.", will be excluded
|
|
||||||
// from the build process. You can use this to create utilites for testing your scripts directly in
|
|
||||||
// Visual Studio.
|
|
||||||
|
|
||||||
static TestBootstrapper()
|
|
||||||
{
|
|
||||||
// Initialize the MDK utility framework
|
|
||||||
MDKUtilityFramework.Load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Main()
|
|
||||||
{
|
|
||||||
// In order for your program to actually run, you will need to provide a mockup of all the facilities
|
|
||||||
// your script uses from the game, since they're not available outside of the game.
|
|
||||||
|
|
||||||
// Create and configure the desired program.
|
|
||||||
var program = MDKFactory.CreateProgram<Program>();
|
|
||||||
MDKFactory.Run(program);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<!--
|
|
||||||
Contains basic settings that should be included in code repositories
|
|
||||||
-->
|
|
||||||
<MDKVersion>1.5.17</MDKVersion>
|
|
||||||
<MDKTrimTypes>
|
|
||||||
<Enabled>no</Enabled>
|
|
||||||
</MDKTrimTypes>
|
|
||||||
<MDKMinify>
|
|
||||||
<Level>None</Level>
|
|
||||||
</MDKMinify>
|
|
||||||
<MDKIgnore>
|
|
||||||
<Folder>mdk</Folder>
|
|
||||||
</MDKIgnore>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<!--
|
|
||||||
You can safely exclude this file from code repositories and use different
|
|
||||||
user settings per machine.
|
|
||||||
-->
|
|
||||||
<MDKVersion>1.4.14</MDKVersion>
|
|
||||||
<MDKUseGameBinPath>no</MDKUseGameBinPath>
|
|
||||||
<MDKGameBinPath>G:\SteamLibrary\SteamApps\common\SpaceEngineers\Bin64</MDKGameBinPath>
|
|
||||||
<MDKInstallPath>c:\users\lyssmetal\appdata\local\microsoft\visualstudio\17.0_6c02a30d\extensions\twejjmj5.r1e</MDKInstallPath>
|
|
||||||
<MDKOutputPath>C:\Users\LyssMetal\AppData\Roaming\SpaceEngineers\IngameScripts\local</MDKOutputPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Sandbox.Common">
|
|
||||||
<HintPath>$(MDKGameBinPath)\Sandbox.Common.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Sandbox.Game">
|
|
||||||
<HintPath>$(MDKGameBinPath)\Sandbox.Game.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Sandbox.Graphics">
|
|
||||||
<HintPath>$(MDKGameBinPath)\Sandbox.Graphics.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SpaceEngineers.Game">
|
|
||||||
<HintPath>$(MDKGameBinPath)\SpaceEngineers.Game.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SpaceEngineers.ObjectBuilders">
|
|
||||||
<HintPath>$(MDKGameBinPath)\SpaceEngineers.ObjectBuilders.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Audio">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Audio.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Game">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Game.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Input">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Input.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Library">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Library.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Math">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Math.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Render">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Render.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Render11">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Render11.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Scripting">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Scripting.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="MDKUtilities">
|
|
||||||
<HintPath>$(MDKInstallPath)\MDKUtilities.dll</HintPath>
|
|
||||||
<Private>true</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Collections.Immutable">
|
|
||||||
<HintPath>$(MDKGameBinPath)\System.Collections.Immutable.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Analyzer Include="$(MDKInstallPath)\Analyzers\MDKAnalyzer.dll" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
|
|
@ -61,7 +61,7 @@ namespace IngameScript
|
||||||
this.output.Print("Base system starting...");
|
this.output.Print("Base system starting...");
|
||||||
|
|
||||||
this.InitMiningSystem();
|
this.InitMiningSystem();
|
||||||
|
|
||||||
this.minerConnector = this.GridTerminalSystem.GetBlockWithName("[Base] Connector Miner") as IMyShipConnector;
|
this.minerConnector = this.GridTerminalSystem.GetBlockWithName("[Base] Connector Miner") as IMyShipConnector;
|
||||||
if (this.minerConnector == null)
|
if (this.minerConnector == null)
|
||||||
this.output.Print($"Error: miner connector not found");
|
this.output.Print($"Error: miner connector not found");
|
||||||
|
|
|
||||||
4
BaseMiner/packages.config
Normal file
4
BaseMiner/packages.config
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Mal.Mdk2.PbPackager" version="2.0.0-alpha073" targetFramework="net48" />
|
||||||
|
</packages>
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
using Malware.MDKUtilities;
|
|
||||||
|
|
||||||
namespace IngameScript.MDK
|
|
||||||
{
|
|
||||||
public class TestBootstrapper
|
|
||||||
{
|
|
||||||
// All the files in this folder, as well as all files containing the file ".debug.", will be excluded
|
|
||||||
// from the build process. You can use this to create utilites for testing your scripts directly in
|
|
||||||
// Visual Studio.
|
|
||||||
|
|
||||||
static TestBootstrapper()
|
|
||||||
{
|
|
||||||
// Initialize the MDK utility framework
|
|
||||||
MDKUtilityFramework.Load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Main()
|
|
||||||
{
|
|
||||||
// In order for your program to actually run, you will need to provide a mockup of all the facilities
|
|
||||||
// your script uses from the game, since they're not available outside of the game.
|
|
||||||
|
|
||||||
// Create and configure the desired program.
|
|
||||||
var program = MDKFactory.CreateProgram<Program>();
|
|
||||||
MDKFactory.Run(program);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<!--
|
|
||||||
Contains basic settings that should be included in code repositories
|
|
||||||
-->
|
|
||||||
<MDKVersion>1.5.17</MDKVersion>
|
|
||||||
<MDKTrimTypes>
|
|
||||||
<Enabled>no</Enabled>
|
|
||||||
</MDKTrimTypes>
|
|
||||||
<MDKMinify>
|
|
||||||
<Level>None</Level>
|
|
||||||
</MDKMinify>
|
|
||||||
<MDKIgnore>
|
|
||||||
<Folder>mdk</Folder>
|
|
||||||
</MDKIgnore>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<!--
|
|
||||||
You can safely exclude this file from code repositories and use different
|
|
||||||
user settings per machine.
|
|
||||||
-->
|
|
||||||
<MDKVersion>1.4.14</MDKVersion>
|
|
||||||
<MDKUseGameBinPath>no</MDKUseGameBinPath>
|
|
||||||
<MDKGameBinPath>G:\SteamLibrary\SteamApps\common\SpaceEngineers\Bin64</MDKGameBinPath>
|
|
||||||
<MDKInstallPath>c:\users\lyssmetal\appdata\local\microsoft\visualstudio\17.0_6c02a30d\extensions\twejjmj5.r1e</MDKInstallPath>
|
|
||||||
<MDKOutputPath>C:\Users\LyssMetal\AppData\Roaming\SpaceEngineers\IngameScripts\local</MDKOutputPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Sandbox.Common">
|
|
||||||
<HintPath>$(MDKGameBinPath)\Sandbox.Common.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Sandbox.Game">
|
|
||||||
<HintPath>$(MDKGameBinPath)\Sandbox.Game.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Sandbox.Graphics">
|
|
||||||
<HintPath>$(MDKGameBinPath)\Sandbox.Graphics.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SpaceEngineers.Game">
|
|
||||||
<HintPath>$(MDKGameBinPath)\SpaceEngineers.Game.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SpaceEngineers.ObjectBuilders">
|
|
||||||
<HintPath>$(MDKGameBinPath)\SpaceEngineers.ObjectBuilders.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Audio">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Audio.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Game">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Game.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Input">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Input.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Library">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Library.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Math">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Math.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Render">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Render.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Render11">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Render11.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Scripting">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Scripting.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="MDKUtilities">
|
|
||||||
<HintPath>$(MDKInstallPath)\MDKUtilities.dll</HintPath>
|
|
||||||
<Private>true</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Collections.Immutable">
|
|
||||||
<HintPath>$(MDKGameBinPath)\System.Collections.Immutable.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Analyzer Include="$(MDKInstallPath)\Analyzers\MDKAnalyzer.dll" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,85 +1,31 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<PropertyGroup>
|
||||||
<PropertyGroup>
|
<TargetFramework>netframework48</TargetFramework>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<RootNamespace>IngameScript</RootNamespace>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<LangVersion>6</LangVersion>
|
||||||
<ProjectGuid>{DBCD62FE-F7AA-4A03-9241-0A4BE6952664}</ProjectGuid>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
<OutputType>Exe</OutputType>
|
<Configurations>Release;Debug</Configurations>
|
||||||
<RootNamespace>IngameScript</RootNamespace>
|
<Platforms>x64</Platforms>
|
||||||
<AssemblyName>MiningRover</AssemblyName>
|
</PropertyGroup>
|
||||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
<ItemGroup>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<PackageReference Include="Mal.Mdk2.PbAnalyzers" Version="2.1.9">
|
||||||
<TargetFrameworkProfile />
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<PublishUrl>publish\</PublishUrl>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<Install>true</Install>
|
</PackageReference>
|
||||||
<InstallFrom>Disk</InstallFrom>
|
<PackageReference Include="Mal.Mdk2.PbPackager" Version="2.0.6">
|
||||||
<UpdateEnabled>false</UpdateEnabled>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<UpdateMode>Foreground</UpdateMode>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<UpdateInterval>7</UpdateInterval>
|
</PackageReference>
|
||||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
<PackageReference Include="Mal.Mdk2.References" Version="2.2.2" />
|
||||||
<UpdatePeriodically>false</UpdatePeriodically>
|
</ItemGroup>
|
||||||
<UpdateRequired>false</UpdateRequired>
|
|
||||||
<MapFileExtensions>true</MapFileExtensions>
|
<ItemGroup>
|
||||||
<ApplicationRevision>0</ApplicationRevision>
|
<None Remove="Instructions.readme" />
|
||||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
<AdditionalFiles Include="Instructions.readme" />
|
||||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
</ItemGroup>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
|
||||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
<Import Project="..\SECommon\SECommon.projitems" Label="Shared" />
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
</Project>
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<OutputPath>bin\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<Prefer32Bit>true</Prefer32Bit>
|
|
||||||
<LangVersion>6</LangVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="netstandard" />
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="MDK/MDK.options.props" />
|
|
||||||
<Import Project="MDK/MDK.paths.props" Condition="exists('MDK/MDK.paths.props')" />
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="MDK\Bootstrapper.cs" />
|
|
||||||
<AdditionalFiles Include="MDK\MDK.options.props">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</AdditionalFiles>
|
|
||||||
<AdditionalFiles Include="MDK\MDK.paths.props">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</AdditionalFiles>
|
|
||||||
<Compile Include="Program.cs" />
|
|
||||||
<AdditionalFiles Include="Instructions.readme" />
|
|
||||||
<AdditionalFiles Include="thumb.png" />
|
|
||||||
<AdditionalFiles Include="MDK\whitelist.cache" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName>
|
|
||||||
<Install>true</Install>
|
|
||||||
</BootstrapperPackage>
|
|
||||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
|
||||||
<Install>false</Install>
|
|
||||||
</BootstrapperPackage>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
<Copy SourceFiles="MDK\MDK.options.props" DestinationFolder="$(TargetDir)\MDK" />
|
|
||||||
<Copy SourceFiles="MDK\MDK.paths.props" DestinationFolder="$(TargetDir)\MDK" />
|
|
||||||
</Target>
|
|
||||||
</Project>
|
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,35 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="..\packages\Mal.Mdk2.PbPackager.2.0.0-alpha073\build\Mal.Mdk2.PbPackager.props" Condition="Exists('..\packages\Mal.Mdk2.PbPackager.2.0.0-alpha073\build\Mal.Mdk2.PbPackager.props')" />
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProjectGuid>{22A83955-FE9B-4EBA-8980-D9DE01353C4C}</ProjectGuid>
|
<ProjectGuid>{DBCD62FE-F7AA-4A03-9241-0A4BE6952664}</ProjectGuid>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<RootNamespace>IngameScript</RootNamespace>
|
<RootNamespace>IngameScript</RootNamespace>
|
||||||
<AssemblyName>BaseApp</AssemblyName>
|
<AssemblyName>MiningRover</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<TargetFrameworkProfile />
|
<TargetFrameworkProfile />
|
||||||
|
<PublishUrl>publish\</PublishUrl>
|
||||||
|
<Install>true</Install>
|
||||||
|
<InstallFrom>Disk</InstallFrom>
|
||||||
|
<UpdateEnabled>false</UpdateEnabled>
|
||||||
|
<UpdateMode>Foreground</UpdateMode>
|
||||||
|
<UpdateInterval>7</UpdateInterval>
|
||||||
|
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||||
|
<UpdatePeriodically>false</UpdatePeriodically>
|
||||||
|
<UpdateRequired>false</UpdateRequired>
|
||||||
|
<MapFileExtensions>true</MapFileExtensions>
|
||||||
|
<ApplicationRevision>0</ApplicationRevision>
|
||||||
|
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||||
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
|
<NuGetPackageImportStamp>
|
||||||
|
</NuGetPackageImportStamp>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
|
@ -46,12 +64,34 @@
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</AdditionalFiles>
|
</AdditionalFiles>
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
|
<AdditionalFiles Include="Instructions.readme" />
|
||||||
|
<AdditionalFiles Include="thumb.png" />
|
||||||
<AdditionalFiles Include="MDK\whitelist.cache" />
|
<AdditionalFiles Include="MDK\whitelist.cache" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="..\SECommon\SECommon.projitems" Label="Shared" />
|
<ItemGroup>
|
||||||
|
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>Microsoft .NET Framework 4.8 %28x86 and x64%29</ProductName>
|
||||||
|
<Install>true</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||||
|
<Visible>False</Visible>
|
||||||
|
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||||
|
<Install>false</Install>
|
||||||
|
</BootstrapperPackage>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<Target Name="AfterBuild">
|
<Target Name="AfterBuild">
|
||||||
<Copy SourceFiles="MDK\MDK.options.props" DestinationFolder="$(TargetDir)\MDK" />
|
<Copy SourceFiles="MDK\MDK.options.props" DestinationFolder="$(TargetDir)\MDK" />
|
||||||
<Copy SourceFiles="MDK\MDK.paths.props" DestinationFolder="$(TargetDir)\MDK" />
|
<Copy SourceFiles="MDK\MDK.paths.props" DestinationFolder="$(TargetDir)\MDK" />
|
||||||
</Target>
|
</Target>
|
||||||
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('..\packages\Mal.Mdk2.PbPackager.2.0.0-alpha073\build\Mal.Mdk2.PbPackager.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Mal.Mdk2.PbPackager.2.0.0-alpha073\build\Mal.Mdk2.PbPackager.props'))" />
|
||||||
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
22
MiningRover/MiningRover.mdk.ini
Normal file
22
MiningRover/MiningRover.mdk.ini
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
; This file is project specific and should be checked in to source control.
|
||||||
|
|
||||||
|
[mdk]
|
||||||
|
; This is a programmable block script project.
|
||||||
|
; You should not change this.
|
||||||
|
type=programmableblock
|
||||||
|
|
||||||
|
; Toggle trace (on|off) (verbose output)
|
||||||
|
trace=off
|
||||||
|
|
||||||
|
; What type of minification to use (none|trim|stripcomments|lite|full)
|
||||||
|
; none: No minification
|
||||||
|
; trim: Removes unused types (NOT members).
|
||||||
|
; stripcomments: trim + removes comments.
|
||||||
|
; lite: stripcomments + removes leading/trailing whitespace.
|
||||||
|
; full: lite + renames identifiers to shorter names.
|
||||||
|
minify=none
|
||||||
|
|
||||||
|
; A list of files and folder to ignore when creating the script.
|
||||||
|
; This is a comma separated list of glob patterns.
|
||||||
|
; See https://code.visualstudio.com/docs/editor/glob-patterns
|
||||||
|
ignores=obj/**/*,MDK/**/*,**/*.debug.cs
|
||||||
7
MiningRover/MiningRover.mdk.local.ini
Normal file
7
MiningRover/MiningRover.mdk.local.ini
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
; This file is _local_ to your machine and should not be checked in to source control.
|
||||||
|
|
||||||
|
[mdk]
|
||||||
|
; Where to output the script to (auto|specific path)
|
||||||
|
output=auto
|
||||||
|
; Override the default binary path (auto|specific path)
|
||||||
|
binarypath=auto
|
||||||
4
MiningRover/packages.config
Normal file
4
MiningRover/packages.config
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Mal.Mdk2.PbPackager" version="2.0.0-alpha073" targetFramework="net48" />
|
||||||
|
</packages>
|
||||||
2
MissileController/.gitignore
vendored
Normal file
2
MissileController/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
# MDK
|
||||||
|
MissileController.csproj.mdk.local.ini
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
using Malware.MDKUtilities;
|
|
||||||
|
|
||||||
namespace IngameScript.MDK
|
|
||||||
{
|
|
||||||
public class TestBootstrapper
|
|
||||||
{
|
|
||||||
// All the files in this folder, as well as all files containing the file ".debug.", will be excluded
|
|
||||||
// from the build process. You can use this to create utilites for testing your scripts directly in
|
|
||||||
// Visual Studio.
|
|
||||||
|
|
||||||
static TestBootstrapper()
|
|
||||||
{
|
|
||||||
// Initialize the MDK utility framework
|
|
||||||
MDKUtilityFramework.Load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Main()
|
|
||||||
{
|
|
||||||
// In order for your program to actually run, you will need to provide a mockup of all the facilities
|
|
||||||
// your script uses from the game, since they're not available outside of the game.
|
|
||||||
|
|
||||||
// Create and configure the desired program.
|
|
||||||
var program = MDKFactory.CreateProgram<Program>();
|
|
||||||
MDKFactory.Run(program);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<!--
|
|
||||||
Contains basic settings that should be included in code repositories
|
|
||||||
-->
|
|
||||||
<MDKVersion>1.5.17</MDKVersion>
|
|
||||||
<MDKTrimTypes>
|
|
||||||
<Enabled>no</Enabled>
|
|
||||||
</MDKTrimTypes>
|
|
||||||
<MDKMinify>
|
|
||||||
<Level>None</Level>
|
|
||||||
</MDKMinify>
|
|
||||||
<MDKIgnore>
|
|
||||||
<Folder>mdk</Folder>
|
|
||||||
</MDKIgnore>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<!--
|
|
||||||
You can safely exclude this file from code repositories and use different
|
|
||||||
user settings per machine.
|
|
||||||
-->
|
|
||||||
<MDKVersion>1.4.14</MDKVersion>
|
|
||||||
<MDKUseGameBinPath>no</MDKUseGameBinPath>
|
|
||||||
<MDKGameBinPath>G:\SteamLibrary\SteamApps\common\SpaceEngineers\Bin64</MDKGameBinPath>
|
|
||||||
<MDKInstallPath>c:\users\lyssmetal\appdata\local\microsoft\visualstudio\17.0_6c02a30d\extensions\twejjmj5.r1e</MDKInstallPath>
|
|
||||||
<MDKOutputPath>C:\Users\LyssMetal\AppData\Roaming\SpaceEngineers\IngameScripts\local</MDKOutputPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Sandbox.Common">
|
|
||||||
<HintPath>$(MDKGameBinPath)\Sandbox.Common.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Sandbox.Game">
|
|
||||||
<HintPath>$(MDKGameBinPath)\Sandbox.Game.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Sandbox.Graphics">
|
|
||||||
<HintPath>$(MDKGameBinPath)\Sandbox.Graphics.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SpaceEngineers.Game">
|
|
||||||
<HintPath>$(MDKGameBinPath)\SpaceEngineers.Game.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SpaceEngineers.ObjectBuilders">
|
|
||||||
<HintPath>$(MDKGameBinPath)\SpaceEngineers.ObjectBuilders.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Audio">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Audio.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Game">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Game.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Input">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Input.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Library">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Library.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Math">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Math.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Render">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Render.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Render11">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Render11.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Scripting">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Scripting.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="MDKUtilities">
|
|
||||||
<HintPath>$(MDKInstallPath)\MDKUtilities.dll</HintPath>
|
|
||||||
<Private>true</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Collections.Immutable">
|
|
||||||
<HintPath>$(MDKGameBinPath)\System.Collections.Immutable.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Analyzer Include="$(MDKInstallPath)\Analyzers\MDKAnalyzer.dll" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,59 +1,31 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<PropertyGroup>
|
||||||
<PropertyGroup>
|
<TargetFramework>netframework48</TargetFramework>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<RootNamespace>IngameScript</RootNamespace>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<LangVersion>6</LangVersion>
|
||||||
<ProjectGuid>{F902E413-8F1A-423D-98A5-F26B684E28BA}</ProjectGuid>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
<OutputType>Exe</OutputType>
|
<Configurations>Release;Debug</Configurations>
|
||||||
<RootNamespace>IngameScript</RootNamespace>
|
<Platforms>x64</Platforms>
|
||||||
<AssemblyName>MissileController</AssemblyName>
|
</PropertyGroup>
|
||||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
<ItemGroup>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<PackageReference Include="Mal.Mdk2.PbAnalyzers" Version="2.1.9">
|
||||||
<TargetFrameworkProfile />
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PropertyGroup>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
</PackageReference>
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<PackageReference Include="Mal.Mdk2.PbPackager" Version="2.0.6">
|
||||||
<OutputPath>bin\</OutputPath>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<DebugType>full</DebugType>
|
</PackageReference>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PackageReference Include="Mal.Mdk2.References" Version="2.2.2" />
|
||||||
<ErrorReport>prompt</ErrorReport>
|
</ItemGroup>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<Prefer32Bit>true</Prefer32Bit>
|
<ItemGroup>
|
||||||
<LangVersion>6</LangVersion>
|
<None Remove="Instructions.readme" />
|
||||||
</PropertyGroup>
|
<AdditionalFiles Include="Instructions.readme" />
|
||||||
<ItemGroup>
|
</ItemGroup>
|
||||||
<Reference Include="netstandard" />
|
|
||||||
<Reference Include="System" />
|
<Import Project="..\SECommon\SECommon.projitems" Label="Shared" />
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
</Project>
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="MDK/MDK.options.props" />
|
|
||||||
<Import Project="MDK/MDK.paths.props" Condition="exists('MDK/MDK.paths.props')" />
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="MDK\Bootstrapper.cs" />
|
|
||||||
<AdditionalFiles Include="MDK\MDK.options.props">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</AdditionalFiles>
|
|
||||||
<AdditionalFiles Include="MDK\MDK.paths.props">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</AdditionalFiles>
|
|
||||||
<Compile Include="Program.cs" />
|
|
||||||
<AdditionalFiles Include="Instructions.readme" />
|
|
||||||
<AdditionalFiles Include="thumb.png" />
|
|
||||||
<AdditionalFiles Include="MDK\whitelist.cache" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="..\SECommon\SECommon.projitems" Label="Shared" />
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
<Copy SourceFiles="MDK\MDK.options.props" DestinationFolder="$(TargetDir)\MDK" />
|
|
||||||
<Copy SourceFiles="MDK\MDK.paths.props" DestinationFolder="$(TargetDir)\MDK" />
|
|
||||||
</Target>
|
|
||||||
</Project>
|
|
||||||
|
|
|
||||||
22
MissileController/MissileController.mdk.ini
Normal file
22
MissileController/MissileController.mdk.ini
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
; This file is project specific and should be checked in to source control.
|
||||||
|
|
||||||
|
[mdk]
|
||||||
|
; This is a programmable block script project.
|
||||||
|
; You should not change this.
|
||||||
|
type=programmableblock
|
||||||
|
|
||||||
|
; Toggle trace (on|off) (verbose output)
|
||||||
|
trace=off
|
||||||
|
|
||||||
|
; What type of minification to use (none|trim|stripcomments|lite|full)
|
||||||
|
; none: No minification
|
||||||
|
; trim: Removes unused types (NOT members).
|
||||||
|
; stripcomments: trim + removes comments.
|
||||||
|
; lite: stripcomments + removes leading/trailing whitespace.
|
||||||
|
; full: lite + renames identifiers to shorter names.
|
||||||
|
minify=none
|
||||||
|
|
||||||
|
; A list of files and folder to ignore when creating the script.
|
||||||
|
; This is a comma separated list of glob patterns.
|
||||||
|
; See https://code.visualstudio.com/docs/editor/glob-patterns
|
||||||
|
ignores=obj/**/*,MDK/**/*,**/*.debug.cs
|
||||||
7
MissileController/MissileController.mdk.local.ini
Normal file
7
MissileController/MissileController.mdk.local.ini
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
; This file is _local_ to your machine and should not be checked in to source control.
|
||||||
|
|
||||||
|
[mdk]
|
||||||
|
; Where to output the script to (auto|specific path)
|
||||||
|
output=auto
|
||||||
|
; Override the default binary path (auto|specific path)
|
||||||
|
binarypath=auto
|
||||||
|
|
@ -34,7 +34,7 @@ namespace IngameScript
|
||||||
|
|
||||||
const float EPSILON = 0.05f;
|
const float EPSILON = 0.05f;
|
||||||
const double DELAY_BEFORE_TRAVELLING_MODE = 3000; // [ms].
|
const double DELAY_BEFORE_TRAVELLING_MODE = 3000; // [ms].
|
||||||
const double AUTO_DESTRUCTION_AFTER = 60000; // [ms] (1 min).
|
const double AUTO_DESTRUCTION_AFTER = 60000; // [ms] (1 min). Or if the hydrogen tank is empty.
|
||||||
|
|
||||||
|
|
||||||
enum State
|
enum State
|
||||||
|
|
|
||||||
4
MissileController/packages.config
Normal file
4
MissileController/packages.config
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Mal.Mdk2.PbPackager" version="2.0.0-alpha073" targetFramework="net48" />
|
||||||
|
</packages>
|
||||||
2
MissileLauncher/.gitignore
vendored
Normal file
2
MissileLauncher/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
# MDK
|
||||||
|
MissileLauncher.csproj.mdk.local.ini
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
using Malware.MDKUtilities;
|
|
||||||
|
|
||||||
namespace IngameScript.MDK
|
|
||||||
{
|
|
||||||
public class TestBootstrapper
|
|
||||||
{
|
|
||||||
// All the files in this folder, as well as all files containing the file ".debug.", will be excluded
|
|
||||||
// from the build process. You can use this to create utilites for testing your scripts directly in
|
|
||||||
// Visual Studio.
|
|
||||||
|
|
||||||
static TestBootstrapper()
|
|
||||||
{
|
|
||||||
// Initialize the MDK utility framework
|
|
||||||
MDKUtilityFramework.Load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void Main()
|
|
||||||
{
|
|
||||||
// In order for your program to actually run, you will need to provide a mockup of all the facilities
|
|
||||||
// your script uses from the game, since they're not available outside of the game.
|
|
||||||
|
|
||||||
// Create and configure the desired program.
|
|
||||||
var program = MDKFactory.CreateProgram<Program>();
|
|
||||||
MDKFactory.Run(program);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<!--
|
|
||||||
Contains basic settings that should be included in code repositories
|
|
||||||
-->
|
|
||||||
<MDKVersion>1.5.17</MDKVersion>
|
|
||||||
<MDKTrimTypes>
|
|
||||||
<Enabled>no</Enabled>
|
|
||||||
</MDKTrimTypes>
|
|
||||||
<MDKMinify>
|
|
||||||
<Level>None</Level>
|
|
||||||
</MDKMinify>
|
|
||||||
<MDKIgnore>
|
|
||||||
<Folder>mdk</Folder>
|
|
||||||
</MDKIgnore>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<!--
|
|
||||||
You can safely exclude this file from code repositories and use different
|
|
||||||
user settings per machine.
|
|
||||||
-->
|
|
||||||
<MDKVersion>1.4.14</MDKVersion>
|
|
||||||
<MDKUseGameBinPath>no</MDKUseGameBinPath>
|
|
||||||
<MDKGameBinPath>G:\SteamLibrary\SteamApps\common\SpaceEngineers\Bin64</MDKGameBinPath>
|
|
||||||
<MDKInstallPath>c:\users\lyssmetal\appdata\local\microsoft\visualstudio\17.0_6c02a30d\extensions\twejjmj5.r1e</MDKInstallPath>
|
|
||||||
<MDKOutputPath>C:\Users\LyssMetal\AppData\Roaming\SpaceEngineers\IngameScripts\local</MDKOutputPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Sandbox.Common">
|
|
||||||
<HintPath>$(MDKGameBinPath)\Sandbox.Common.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Sandbox.Game">
|
|
||||||
<HintPath>$(MDKGameBinPath)\Sandbox.Game.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Sandbox.Graphics">
|
|
||||||
<HintPath>$(MDKGameBinPath)\Sandbox.Graphics.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SpaceEngineers.Game">
|
|
||||||
<HintPath>$(MDKGameBinPath)\SpaceEngineers.Game.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SpaceEngineers.ObjectBuilders">
|
|
||||||
<HintPath>$(MDKGameBinPath)\SpaceEngineers.ObjectBuilders.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Audio">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Audio.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Game">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Game.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Input">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Input.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Library">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Library.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Math">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Math.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Render">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Render.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Render11">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Render11.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="VRage.Scripting">
|
|
||||||
<HintPath>$(MDKGameBinPath)\VRage.Scripting.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="MDKUtilities">
|
|
||||||
<HintPath>$(MDKInstallPath)\MDKUtilities.dll</HintPath>
|
|
||||||
<Private>true</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Collections.Immutable">
|
|
||||||
<HintPath>$(MDKGameBinPath)\System.Collections.Immutable.dll</HintPath>
|
|
||||||
<Private>false</Private>
|
|
||||||
</Reference>
|
|
||||||
<Analyzer Include="$(MDKInstallPath)\Analyzers\MDKAnalyzer.dll" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
|
|
@ -1,59 +1,34 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<PropertyGroup>
|
||||||
<PropertyGroup>
|
<TargetFramework>netframework48</TargetFramework>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<RootNamespace>IngameScript</RootNamespace>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<LangVersion>6</LangVersion>
|
||||||
<ProjectGuid>{761F968E-CE71-404B-A20A-7C1458D6C014}</ProjectGuid>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
<OutputType>Exe</OutputType>
|
<Configurations>Release;Debug</Configurations>
|
||||||
<RootNamespace>IngameScript</RootNamespace>
|
<Platforms>x64</Platforms>
|
||||||
<AssemblyName>MissileLauncher</AssemblyName>
|
</PropertyGroup>
|
||||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
<ItemGroup>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<None Remove="Instructions.readme" />
|
||||||
<TargetFrameworkProfile />
|
</ItemGroup>
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
<ItemGroup>
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<AdditionalFiles Include="Instructions.readme" />
|
||||||
<OutputPath>bin\</OutputPath>
|
</ItemGroup>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<DebugType>full</DebugType>
|
<ItemGroup>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PackageReference Include="Mal.Mdk2.PbAnalyzers" Version="2.1.9">
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<Prefer32Bit>true</Prefer32Bit>
|
</PackageReference>
|
||||||
<LangVersion>6</LangVersion>
|
<PackageReference Include="Mal.Mdk2.PbPackager" Version="2.0.6">
|
||||||
</PropertyGroup>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<ItemGroup>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<Reference Include="netstandard" />
|
</PackageReference>
|
||||||
<Reference Include="System" />
|
<PackageReference Include="Mal.Mdk2.References" Version="2.2.2" />
|
||||||
<Reference Include="System.Core" />
|
</ItemGroup>
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Import Project="..\SECommon\SECommon.projitems" Label="Shared" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
</Project>
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="MDK/MDK.options.props" />
|
|
||||||
<Import Project="MDK/MDK.paths.props" Condition="exists('MDK/MDK.paths.props')" />
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="MDK\Bootstrapper.cs" />
|
|
||||||
<AdditionalFiles Include="MDK\MDK.options.props">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</AdditionalFiles>
|
|
||||||
<AdditionalFiles Include="MDK\MDK.paths.props">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</AdditionalFiles>
|
|
||||||
<Compile Include="Program.cs" />
|
|
||||||
<AdditionalFiles Include="Instructions.readme" />
|
|
||||||
<AdditionalFiles Include="thumb.png" />
|
|
||||||
<AdditionalFiles Include="MDK\whitelist.cache" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="..\SECommon\SECommon.projitems" Label="Shared" />
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
<Copy SourceFiles="MDK\MDK.options.props" DestinationFolder="$(TargetDir)\MDK" />
|
|
||||||
<Copy SourceFiles="MDK\MDK.paths.props" DestinationFolder="$(TargetDir)\MDK" />
|
|
||||||
</Target>
|
|
||||||
</Project>
|
|
||||||
|
|
|
||||||
22
MissileLauncher/MissileLauncher.mdk.ini
Normal file
22
MissileLauncher/MissileLauncher.mdk.ini
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
; This file is project specific and should be checked in to source control.
|
||||||
|
|
||||||
|
[mdk]
|
||||||
|
; This is a programmable block script project.
|
||||||
|
; You should not change this.
|
||||||
|
type=programmableblock
|
||||||
|
|
||||||
|
; Toggle trace (on|off) (verbose output)
|
||||||
|
trace=off
|
||||||
|
|
||||||
|
; What type of minification to use (none|trim|stripcomments|lite|full)
|
||||||
|
; none: No minification
|
||||||
|
; trim: Removes unused types (NOT members).
|
||||||
|
; stripcomments: trim + removes comments.
|
||||||
|
; lite: stripcomments + removes leading/trailing whitespace.
|
||||||
|
; full: lite + renames identifiers to shorter names.
|
||||||
|
minify=none
|
||||||
|
|
||||||
|
; A list of files and folder to ignore when creating the script.
|
||||||
|
; This is a comma separated list of glob patterns.
|
||||||
|
; See https://code.visualstudio.com/docs/editor/glob-patterns
|
||||||
|
ignores=obj/**/*,MDK/**/*,**/*.debug.cs
|
||||||
7
MissileLauncher/MissileLauncher.mdk.local.ini
Normal file
7
MissileLauncher/MissileLauncher.mdk.local.ini
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
; This file is _local_ to your machine and should not be checked in to source control.
|
||||||
|
|
||||||
|
[mdk]
|
||||||
|
; Where to output the script to (auto|specific path)
|
||||||
|
output=auto
|
||||||
|
; Override the default binary path (auto|specific path)
|
||||||
|
binarypath=auto
|
||||||
|
|
@ -4,6 +4,7 @@ using Sandbox.Game.GameSystems;
|
||||||
using Sandbox.ModAPI.Ingame;
|
using Sandbox.ModAPI.Ingame;
|
||||||
using Sandbox.ModAPI.Interfaces;
|
using Sandbox.ModAPI.Interfaces;
|
||||||
|
|
||||||
|
using SpaceEngineers.Game.Entities.Blocks;
|
||||||
using SpaceEngineers.Game.ModAPI.Ingame;
|
using SpaceEngineers.Game.ModAPI.Ingame;
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -21,141 +22,290 @@ using VRage.Game.GUI.TextPanel;
|
||||||
using VRage.Game.ModAPI.Ingame;
|
using VRage.Game.ModAPI.Ingame;
|
||||||
using VRage.Game.ModAPI.Ingame.Utilities;
|
using VRage.Game.ModAPI.Ingame.Utilities;
|
||||||
using VRage.Game.ObjectBuilders.Definitions;
|
using VRage.Game.ObjectBuilders.Definitions;
|
||||||
|
using VRage.GameServices;
|
||||||
|
|
||||||
using VRageMath;
|
using VRageMath;
|
||||||
|
|
||||||
using static VRageRender.Utils.MyWingedEdgeMesh;
|
// using static VRageRender.Utils.MyWingedEdgeMesh;
|
||||||
|
|
||||||
namespace IngameScript
|
namespace IngameScript
|
||||||
{
|
{
|
||||||
enum State
|
|
||||||
{
|
|
||||||
NORMAL,
|
|
||||||
STARTING_SEQUENCE,
|
|
||||||
FILLING_TANK,
|
|
||||||
LAUNCHING,
|
|
||||||
}
|
|
||||||
|
|
||||||
class Missile
|
class Missile
|
||||||
{
|
{
|
||||||
string prefix;
|
//string prefix;
|
||||||
readonly string tankName = "Hydrogen Tank";
|
//readonly string tankName = "Hydrogen Tank";
|
||||||
readonly string connectorName = "Connector";
|
//readonly string connectorName = "Connector";
|
||||||
readonly string mergeBlockName = "Merge Block";
|
//readonly string mergeBlockName = "Merge Block";
|
||||||
readonly string programmableBlockName = "Programmable Block";
|
//readonly string programmableBlockName = "Programmable Block";
|
||||||
|
|
||||||
State currentState = State.NORMAL;
|
//State currentState = State.NOMINAL;
|
||||||
|
|
||||||
IMyGridTerminalSystem gridTerminalSystem;
|
//IMyGridTerminalSystem gridTerminalSystem;
|
||||||
|
|
||||||
IMyGasTank tank = null;
|
public IMyGasTank Tank { get; }
|
||||||
IMyShipConnector connector = null;
|
public IMyShipConnector Connector { get; }
|
||||||
IMyShipMergeBlock mergeBlock = null;
|
public IMyShipMergeBlock MergeBlock { get; }
|
||||||
IMyProgrammableBlock programmableBlock = null;
|
public IMyProgrammableBlock ProgrammableBlock { get; }
|
||||||
|
|
||||||
// bool loop = false; // Not used for the moment.
|
public Missile(IMyGasTank tank, IMyShipConnector connector, IMyShipMergeBlock mergeBlock, IMyProgrammableBlock programmableBlock)
|
||||||
public Missile(string prefix, IMyGridTerminalSystem gridTerminalSystem)
|
|
||||||
{
|
{
|
||||||
this.prefix = prefix;
|
this.Tank = tank;
|
||||||
this.gridTerminalSystem = gridTerminalSystem;
|
this.Connector = connector;
|
||||||
|
this.MergeBlock = mergeBlock;
|
||||||
|
this.ProgrammableBlock = programmableBlock;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Launcher
|
||||||
|
{
|
||||||
|
enum State
|
||||||
|
{
|
||||||
|
NOMINAL,
|
||||||
|
STARTING_SEQUENCE,
|
||||||
|
FILLING_TANK,
|
||||||
|
LAUNCHING,
|
||||||
|
}
|
||||||
|
|
||||||
|
int number;
|
||||||
|
IMyCubeGrid grid;
|
||||||
|
Output output;
|
||||||
|
|
||||||
|
Missile missile;
|
||||||
|
|
||||||
|
State currentState = State.NOMINAL;
|
||||||
|
|
||||||
|
IMyGridTerminalSystem gridTerminal;
|
||||||
|
IMyShipConnector connector;
|
||||||
|
|
||||||
|
//IReadOnlyList<IMyShipWelder> welders;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="number"></param>
|
||||||
|
/// <param name="gridTerminal"></param>
|
||||||
|
/// <param name="grid"></param>
|
||||||
|
/// <param name="output">To output some text</param>
|
||||||
|
/// <param name="connector">Connector of the launcher (not the missile)</param>
|
||||||
|
public Launcher(int number, IMyGridTerminalSystem gridTerminal, IMyCubeGrid grid, Output output, IMyShipConnector connector)
|
||||||
|
{
|
||||||
|
this.number = number;
|
||||||
|
this.grid = grid;
|
||||||
|
this.gridTerminal = gridTerminal;
|
||||||
|
this.output = output;
|
||||||
|
this.connector = connector;
|
||||||
|
|
||||||
|
//this.connector = this.gridTerminal.GetBlockWithName(String.Format("{0} {1}", Program.GRID_PREFIX, String.Format(LAUNCHER_SMALL_CONNECTOR_NAME, number))) as IMyShipConnector;
|
||||||
|
//output.Print($"{this.connector}");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Launch()
|
||||||
|
{
|
||||||
|
if (this.currentState == State.NOMINAL)
|
||||||
|
this.currentState = State.STARTING_SEQUENCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Print(string message)
|
||||||
|
{
|
||||||
|
this.output.Print(String.Format("{0:00} {1}", this.number, message));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateState()
|
||||||
|
{
|
||||||
|
switch (this.currentState)
|
||||||
|
{
|
||||||
|
case State.STARTING_SEQUENCE:
|
||||||
|
var missileConnector = this.connector.OtherConnector;
|
||||||
|
if (missileConnector == null)
|
||||||
|
{
|
||||||
|
this.Print("Cannot find the missile connector");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
var missileGrid = missileConnector.CubeGrid;
|
||||||
|
|
||||||
|
IMyGasTank tank = this.gridTerminal.GetBlock<IMyGasTank>("[PM] Hydrogen Tank", missileGrid); //Utils.GetBlock( this.gridTerminal.GetBlockWithName("[PM] Hydrogen Tank") as IMyGasTank;
|
||||||
|
this.output.Print($"tank: {tank}");
|
||||||
|
if (tank == null)
|
||||||
|
{
|
||||||
|
this.Print("Cannot find the missile hydrogen tank");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
IMyShipMergeBlock mergeBlock = this.gridTerminal.GetBlock<IMyShipMergeBlock>("[PM] Merge Block", missileGrid);
|
||||||
|
if (mergeBlock == null)
|
||||||
|
{
|
||||||
|
this.Print("Cannot find the missile merge block");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
IMyProgrammableBlock programmableBlock = this.gridTerminal.GetBlock<IMyProgrammableBlock>("[PM] Programmable Block", missileGrid);
|
||||||
|
|
||||||
|
if (programmableBlock == null)
|
||||||
|
{
|
||||||
|
this.Print("Cannot find the missile programmable block");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
tank.Stockpile = true;
|
||||||
|
|
||||||
|
this.missile = new Missile(tank, connector, mergeBlock, programmableBlock);
|
||||||
|
|
||||||
|
this.currentState = State.FILLING_TANK;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case State.FILLING_TANK:
|
||||||
|
this.Print("Waiting missile tank filled...");
|
||||||
|
|
||||||
|
if (this.missile.Tank.FilledRatio >= Program.HYDRO_TANK_FILLED_PERCENT / 100)
|
||||||
|
{
|
||||||
|
this.missile.Tank.Stockpile = false;
|
||||||
|
this.currentState = State.LAUNCHING;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case State.LAUNCHING:
|
||||||
|
this.Print("Launching missile...");
|
||||||
|
|
||||||
|
if (this.missile.ProgrammableBlock.TryRun("START"))
|
||||||
|
this.Print("Missile launched!");
|
||||||
|
else
|
||||||
|
this.Print("ERROR: Can't send START command to missile");
|
||||||
|
|
||||||
|
this.missile.MergeBlock.Enabled = false;
|
||||||
|
this.connector.Disconnect();
|
||||||
|
this.currentState = State.NOMINAL;
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case State.NOMINAL:
|
||||||
|
break; // Nothing;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
partial class Program : MyGridProgram
|
partial class Program : MyGridProgram
|
||||||
{
|
{
|
||||||
const string GRID_PREFIX = "[PML]";
|
enum State
|
||||||
const string MISSILE_GRID_PREFIX = "[PM]";
|
{
|
||||||
const double HYDRO_TANK_FILLED_PERCENT = 20;
|
NOMINAL,
|
||||||
|
LAUNCHING_ONE,
|
||||||
|
LAUNCHING_ALL,
|
||||||
|
LAUNCHING_CONTINUOUS,
|
||||||
|
}
|
||||||
|
|
||||||
|
public const string GRID_PREFIX = "[PML]";
|
||||||
|
public const string MISSILE_GRID_PREFIX = "[PM]";
|
||||||
|
public const double HYDRO_TANK_FILLED_PERCENT = 20;
|
||||||
|
|
||||||
|
const string LAUNCHER_GRID_NAME = "Launcher"; // Following by a number: "01", "02", etc.
|
||||||
|
const string LAUNCHER_SMALL_CONNECTOR_NAME = "Connector Launcher"; // Following by a number: "01", "02", etc.
|
||||||
|
//const string WELDER_NAME_GROUP = "Welder {0:00}"; // Example for group 1: ["Welder 01A", "Welder 01B", "Welder 01C"].
|
||||||
|
|
||||||
const float EPSILON = 0.05f;
|
const float EPSILON = 0.05f;
|
||||||
|
|
||||||
readonly Output output;
|
readonly Output output;
|
||||||
|
|
||||||
|
IMyCubeGrid grid;
|
||||||
|
|
||||||
|
List<Launcher> launchers = new List<Launcher>();
|
||||||
|
int nbLaunched = 0;
|
||||||
|
int nextToLaunch = 0;
|
||||||
|
|
||||||
|
State currentState = State.NOMINAL;
|
||||||
|
|
||||||
|
//bool continuous_launching = false;
|
||||||
|
|
||||||
public Program()
|
public Program()
|
||||||
{
|
{
|
||||||
var output = this.Me.GetSurface(0);
|
var output = this.Me.GetSurface(0);
|
||||||
this.output = new Output(output);
|
this.output = new Output(output);
|
||||||
this.output.Print("Missile launcher system starting...");
|
this.output.Print("Missile launcher system starting...");
|
||||||
|
|
||||||
this.Runtime.UpdateFrequency = UpdateFrequency.Update100;
|
this.grid = this.Me.CubeGrid;
|
||||||
|
|
||||||
|
var connectorNamePrefix = String.Format("{0} {1} ", GRID_PREFIX, LAUNCHER_SMALL_CONNECTOR_NAME);
|
||||||
|
|
||||||
|
// Find all launcher sub-grid and create the associated launcher.
|
||||||
|
var launcherConnectors = new List<IMyShipConnector>();
|
||||||
|
this.GridTerminalSystem.GetBlocksOfType(
|
||||||
|
launcherConnectors,
|
||||||
|
(IMyShipConnector connector) => connector.CustomName.StartsWith(connectorNamePrefix)
|
||||||
|
);
|
||||||
|
|
||||||
|
this.output.Print($"launcherConnectors.Count = {launcherConnectors.Count}");
|
||||||
|
|
||||||
|
foreach (var connector in launcherConnectors)
|
||||||
|
//for (int i = 0; i < launcherConnectors.Count; i++)
|
||||||
|
{
|
||||||
|
var n = int.Parse(connector.CustomName.Substring(connectorNamePrefix.Length));
|
||||||
|
this.output.Print($"n = {n}");
|
||||||
|
|
||||||
|
//var n = i + 1;
|
||||||
|
//var connector = launcherConnectors[i];
|
||||||
|
|
||||||
|
// Find associated welders.
|
||||||
|
//var welders = new List<IMyShipWelder>();
|
||||||
|
//this.GridTerminalSystem.GetBlocksOfType(
|
||||||
|
// welders,
|
||||||
|
// (IMyShipWelder welder) => welder.CustomName.StartsWith(String.Format("{0} {1}", GRID_PREFIX, String.Format(WELDER_NAME_GROUP, n)))
|
||||||
|
//);
|
||||||
|
|
||||||
|
this.launchers.Add(new Launcher(n, this.GridTerminalSystem, connector.CubeGrid, this.output, connector));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Runtime.UpdateFrequency = UpdateFrequency.Update100;
|
||||||
|
|
||||||
this.output.Print("Missile launcher system started");
|
this.output.Print("Missile launcher system started");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LaunchNext()
|
||||||
|
{
|
||||||
|
if (this.launchers.Count > 0)
|
||||||
|
{
|
||||||
|
this.launchers[this.nextToLaunch].Launch();
|
||||||
|
this.nextToLaunch = (this.nextToLaunch + 1) % this.launchers.Count;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Reset()
|
||||||
|
{
|
||||||
|
this.nbLaunched = 0;
|
||||||
|
this.currentState = State.NOMINAL;
|
||||||
|
}
|
||||||
|
|
||||||
void UpdateState()
|
void UpdateState()
|
||||||
{
|
{
|
||||||
switch (this.currentState)
|
switch (this.currentState)
|
||||||
{
|
{
|
||||||
case State.STARTING_SEQUENCE:
|
case State.LAUNCHING_ONE:
|
||||||
this.tank = this.GridTerminalSystem.GetBlockWithName("[PM] Hydrogen Tank") as IMyGasTank;
|
this.LaunchNext();
|
||||||
if (this.tank == null)
|
this.Reset();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case State.LAUNCHING_ALL:
|
||||||
|
if (this.nbLaunched >= launchers.Count)
|
||||||
{
|
{
|
||||||
this.output.Print("Cannot find the missile hydrogen tank");
|
this.Reset();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
this.connector = this.GridTerminalSystem.GetBlockWithName("[PM] Connector") as IMyShipConnector;
|
|
||||||
if (this.connector == null)
|
|
||||||
{
|
{
|
||||||
this.output.Print("Cannot find the missile connector");
|
this.LaunchNext();
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.mergeBlock = this.GridTerminalSystem.GetBlockWithName("[PM] Merge Block") as IMyShipMergeBlock;
|
|
||||||
if (this.mergeBlock == null)
|
|
||||||
{
|
|
||||||
this.output.Print("Cannot find the missile merge block");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.programmableBlock = this.GridTerminalSystem.GetBlockWithName("[PM] Programmable Block") as IMyProgrammableBlock;
|
|
||||||
if (this.programmableBlock == null)
|
|
||||||
{
|
|
||||||
this.output.Print("Cannot find the missile programmable block");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.tank.Stockpile = true;
|
|
||||||
this.connector.Connect();
|
|
||||||
|
|
||||||
this.currentState = State.FILLING_TANK;
|
|
||||||
break; ;
|
|
||||||
|
|
||||||
case State.FILLING_TANK:
|
|
||||||
this.output.Print("Waiting missile tank filled...");
|
|
||||||
if (this.tank.FilledRatio >= HYDRO_TANK_FILLED_PERCENT / 100)
|
|
||||||
{
|
|
||||||
this.tank.Stockpile = false;
|
|
||||||
this.currentState = State.LAUNCHING;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case State.LAUNCHING:
|
case State.LAUNCHING_CONTINUOUS:
|
||||||
this.output.Print("Launching missile...");
|
this.LaunchNext();
|
||||||
|
|
||||||
if (this.programmableBlock.TryRun("START"))
|
|
||||||
this.output.Print("Missile launched!");
|
|
||||||
else
|
|
||||||
this.output.Print("ERROR: Can't send START command to missile");
|
|
||||||
|
|
||||||
this.mergeBlock.Enabled = false;
|
|
||||||
this.connector.Disconnect();
|
|
||||||
|
|
||||||
if (this.loop)
|
|
||||||
this.currentState = State.STARTING_SEQUENCE;
|
|
||||||
else
|
|
||||||
this.currentState = State.NORMAL;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case State.NORMAL:
|
|
||||||
break; // Nothing;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var launcher in this.launchers)
|
||||||
|
launcher.UpdateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Save()
|
public void Save()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Main(string argument, UpdateType updateSource)
|
public void Main(string argument, UpdateType updateSource)
|
||||||
|
|
@ -164,23 +314,28 @@ namespace IngameScript
|
||||||
{
|
{
|
||||||
this.UpdateState();
|
this.UpdateState();
|
||||||
}
|
}
|
||||||
else if ((updateSource & (UpdateType.Terminal | UpdateType.Trigger)) != 0)
|
else if ((updateSource & (UpdateType.Terminal | UpdateType.Trigger)) != 0)
|
||||||
{
|
{
|
||||||
switch (argument)
|
switch (argument)
|
||||||
{
|
{
|
||||||
case "LAUNCH ONE":
|
case "LAUNCH ONE":
|
||||||
this.loop = false;
|
this.output.Print("Launching one missile...");
|
||||||
this.currentState = State.STARTING_SEQUENCE;
|
this.currentState = State.LAUNCHING_ONE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "LAUNCH SOME":
|
case "LAUNCH ALL":
|
||||||
this.loop = true;
|
this.output.Print("Launching all missiles...");
|
||||||
this.currentState = State.STARTING_SEQUENCE;
|
this.currentState = State.LAUNCHING_ALL;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "LAUNCH CONTINUOUS":
|
||||||
|
this.output.Print("Launching missiles in continous...");
|
||||||
|
this.currentState = State.LAUNCHING_CONTINUOUS;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "STOP":
|
case "STOP":
|
||||||
this.loop = false;
|
this.output.Print("Stopping lauching...");
|
||||||
this.currentState = State.NORMAL;
|
this.currentState = State.NOMINAL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
2
MissileLauncher/README.md
Normal file
2
MissileLauncher/README.md
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Missile launcher
|
||||||
|
|
||||||
4
MissileLauncher/packages.config
Normal file
4
MissileLauncher/packages.config
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="Mal.Mdk2.PbPackager" version="2.0.0-alpha073" targetFramework="net48" />
|
||||||
|
</packages>
|
||||||
17
README.md
Normal file
17
README.md
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
# SDK for Space Engineers scripts
|
||||||
|
* https://github.com/malforge/mdk2
|
||||||
|
* Wiki: https://github.com/malforge/mdk2/wiki
|
||||||
|
* API Doc: https://github.com/malware-dev/MDK-SE/wiki/Namespace-Index
|
||||||
|
|
||||||
|
# Modules
|
||||||
|
|
||||||
|
AutoPilot: Automatic control of piloting on planet.
|
||||||
|
SSPifou: The main control for the spaceship SSPifou.
|
||||||
|
MissileController: Run in the missile computer to pilot it to its target.
|
||||||
|
MissileLauncher: Can launch multiple missiles.
|
||||||
|
|
||||||
|
# MissileController
|
||||||
|
|
||||||
|
## Elements
|
||||||
|
|
||||||
|
*
|
||||||
|
|
@ -10,5 +10,6 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Output.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Output.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)Utils.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
24
SECommon/Utils.cs
Normal file
24
SECommon/Utils.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
|
||||||
|
using Sandbox.ModAPI.Ingame;
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
using VRage.Game.ModAPI.Ingame;
|
||||||
|
|
||||||
|
namespace IngameScript
|
||||||
|
{
|
||||||
|
static class Utils
|
||||||
|
{
|
||||||
|
public static T GetBlock<T>(this IMyGridTerminalSystem gridTerminal, string name, IMyCubeGrid grid)
|
||||||
|
where T: class, IMyTerminalBlock
|
||||||
|
{
|
||||||
|
var l = new List<T>();
|
||||||
|
gridTerminal.GetBlocksOfType<T>(l, (T block) => block.CustomName == name && block.CubeGrid == grid);
|
||||||
|
if (l.Count > 0)
|
||||||
|
return l.First();
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,39 +3,51 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 17
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 17.7.34024.191
|
VisualStudioVersion = 17.7.34024.191
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaseApp", "BaseMiner\BaseApp.csproj", "{22A83955-FE9B-4EBA-8980-D9DE01353C4C}"
|
|
||||||
EndProject
|
|
||||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SECommon", "SECommon\SECommon.shproj", "{9E97399C-4FE6-495B-AA87-ACC2213647CD}"
|
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SECommon", "SECommon\SECommon.shproj", "{9E97399C-4FE6-495B-AA87-ACC2213647CD}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoPilot", "AutoPilot\AutoPilot.csproj", "{141E1804-F644-48F8-A3D8-BEFEEE66ECBA}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoPilot", "AutoPilot\AutoPilot.csproj", "{141E1804-F644-48F8-A3D8-BEFEEE66ECBA}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiningRover", "MiningRover\MiningRover.csproj", "{DBCD62FE-F7AA-4A03-9241-0A4BE6952664}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MiningRover", "MiningRover\MiningRover.csproj", "{DBCD62FE-F7AA-4A03-9241-0A4BE6952664}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A3A0A2EE-BB1F-426A-80EA-3B19273EDCCD}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A3A0A2EE-BB1F-426A-80EA-3B19273EDCCD}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
.gitignore = .gitignore
|
.gitignore = .gitignore
|
||||||
|
README.md = README.md
|
||||||
TODO.md = TODO.md
|
TODO.md = TODO.md
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MissileController", "MissileController\MissileController.csproj", "{F902E413-8F1A-423D-98A5-F26B684E28BA}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MissileController", "MissileController\MissileController.csproj", "{F902E413-8F1A-423D-98A5-F26B684E28BA}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MissileLauncher", "MissileLauncher\MissileLauncher.csproj", "{761F968E-CE71-404B-A20A-7C1458D6C014}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MissileLauncher", "MissileLauncher\MissileLauncher.csproj", "{761F968E-CE71-404B-A20A-7C1458D6C014}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaseMiner", "BaseMiner\BaseMiner.csproj", "{1C2F7DB3-26AD-4C5E-B6C5-D6715B3CFB36}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|x64 = Debug|x64
|
Debug|x64 = Debug|x64
|
||||||
|
Release|x64 = Release|x64
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{22A83955-FE9B-4EBA-8980-D9DE01353C4C}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{22A83955-FE9B-4EBA-8980-D9DE01353C4C}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{141E1804-F644-48F8-A3D8-BEFEEE66ECBA}.Debug|x64.ActiveCfg = Debug|x64
|
{141E1804-F644-48F8-A3D8-BEFEEE66ECBA}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{141E1804-F644-48F8-A3D8-BEFEEE66ECBA}.Debug|x64.Build.0 = Debug|x64
|
{141E1804-F644-48F8-A3D8-BEFEEE66ECBA}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{141E1804-F644-48F8-A3D8-BEFEEE66ECBA}.Release|x64.ActiveCfg = Debug|x64
|
||||||
|
{141E1804-F644-48F8-A3D8-BEFEEE66ECBA}.Release|x64.Build.0 = Debug|x64
|
||||||
{DBCD62FE-F7AA-4A03-9241-0A4BE6952664}.Debug|x64.ActiveCfg = Debug|x64
|
{DBCD62FE-F7AA-4A03-9241-0A4BE6952664}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{DBCD62FE-F7AA-4A03-9241-0A4BE6952664}.Debug|x64.Build.0 = Debug|x64
|
{DBCD62FE-F7AA-4A03-9241-0A4BE6952664}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{DBCD62FE-F7AA-4A03-9241-0A4BE6952664}.Release|x64.ActiveCfg = Debug|x64
|
||||||
|
{DBCD62FE-F7AA-4A03-9241-0A4BE6952664}.Release|x64.Build.0 = Debug|x64
|
||||||
{F902E413-8F1A-423D-98A5-F26B684E28BA}.Debug|x64.ActiveCfg = Debug|x64
|
{F902E413-8F1A-423D-98A5-F26B684E28BA}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{F902E413-8F1A-423D-98A5-F26B684E28BA}.Debug|x64.Build.0 = Debug|x64
|
{F902E413-8F1A-423D-98A5-F26B684E28BA}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{F902E413-8F1A-423D-98A5-F26B684E28BA}.Release|x64.ActiveCfg = Debug|x64
|
||||||
|
{F902E413-8F1A-423D-98A5-F26B684E28BA}.Release|x64.Build.0 = Debug|x64
|
||||||
{761F968E-CE71-404B-A20A-7C1458D6C014}.Debug|x64.ActiveCfg = Debug|x64
|
{761F968E-CE71-404B-A20A-7C1458D6C014}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{761F968E-CE71-404B-A20A-7C1458D6C014}.Debug|x64.Build.0 = Debug|x64
|
{761F968E-CE71-404B-A20A-7C1458D6C014}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{761F968E-CE71-404B-A20A-7C1458D6C014}.Release|x64.ActiveCfg = Debug|x64
|
||||||
|
{761F968E-CE71-404B-A20A-7C1458D6C014}.Release|x64.Build.0 = Debug|x64
|
||||||
|
{1C2F7DB3-26AD-4C5E-B6C5-D6715B3CFB36}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{1C2F7DB3-26AD-4C5E-B6C5-D6715B3CFB36}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{1C2F7DB3-26AD-4C5E-B6C5-D6715B3CFB36}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{1C2F7DB3-26AD-4C5E-B6C5-D6715B3CFB36}.Release|x64.Build.0 = Release|x64
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
@ -44,10 +56,11 @@ Global
|
||||||
SolutionGuid = {F4600B8D-80EE-4075-8A61-BE8847A00BD7}
|
SolutionGuid = {F4600B8D-80EE-4075-8A61-BE8847A00BD7}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||||
SECommon\SECommon.projitems*{141e1804-f644-48f8-a3d8-befeee66ecba}*SharedItemsImports = 4
|
SECommon\SECommon.projitems*{141e1804-f644-48f8-a3d8-befeee66ecba}*SharedItemsImports = 5
|
||||||
SECommon\SECommon.projitems*{22a83955-fe9b-4eba-8980-d9de01353c4c}*SharedItemsImports = 4
|
SECommon\SECommon.projitems*{1c2f7db3-26ad-4c5e-b6c5-d6715b3cfb36}*SharedItemsImports = 5
|
||||||
SECommon\SECommon.projitems*{761f968e-ce71-404b-a20a-7c1458d6c014}*SharedItemsImports = 4
|
SECommon\SECommon.projitems*{761f968e-ce71-404b-a20a-7c1458d6c014}*SharedItemsImports = 5
|
||||||
SECommon\SECommon.projitems*{9e97399c-4fe6-495b-aa87-acc2213647cd}*SharedItemsImports = 13
|
SECommon\SECommon.projitems*{9e97399c-4fe6-495b-aa87-acc2213647cd}*SharedItemsImports = 13
|
||||||
SECommon\SECommon.projitems*{f902e413-8f1a-423d-98a5-f26b684e28ba}*SharedItemsImports = 4
|
SECommon\SECommon.projitems*{dbcd62fe-f7aa-4a03-9241-0a4be6952664}*SharedItemsImports = 5
|
||||||
|
SECommon\SECommon.projitems*{f902e413-8f1a-423d-98a5-f26b684e28ba}*SharedItemsImports = 5
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|
|
||||||
18
TODO.md
18
TODO.md
|
|
@ -1,3 +1,15 @@
|
||||||
* Make procedure to deploy tank + button
|
# Active
|
||||||
* Make procedure to pack tank + button
|
## SSPifou
|
||||||
* Security system for Loir: Can't
|
|
||||||
|
* Missile autodestruction (after 1min or when tank empty)
|
||||||
|
* Finish missile launchers
|
||||||
|
* Add external lights + commands
|
||||||
|
* Command to stop thrusters
|
||||||
|
* Add weapons rack
|
||||||
|
* Embedded computer:
|
||||||
|
* Auto landing + auto stabilization
|
||||||
|
* Display of ore, ingot, ammo status
|
||||||
|
* Autocraft of some element: ammo + components
|
||||||
|
|
||||||
|
|
||||||
|
# Finished
|
||||||
Loading…
Add table
Add a link
Reference in a new issue