From baa26769b79dd57313aff4b7acdf3976b63c33d5 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 19 Dec 2019 16:28:50 -0500 Subject: [PATCH] Create basic python scripting implementation --- GamecraftModdingAPI.dll | Bin 0 -> 33792 bytes GamecraftScripting.sln | 25 + .../Commands/DebugCommandEngine.cs | 38 ++ .../Commands/PythonRunnerCommandEngine.cs | 52 ++ GamecraftScripting/GamecraftScripting.csproj | 546 ++++++++++++++++++ GamecraftScripting/Plugin.cs | 52 ++ README.md | 13 +- 7 files changed, 725 insertions(+), 1 deletion(-) create mode 100644 GamecraftModdingAPI.dll create mode 100644 GamecraftScripting.sln create mode 100644 GamecraftScripting/Commands/DebugCommandEngine.cs create mode 100644 GamecraftScripting/Commands/PythonRunnerCommandEngine.cs create mode 100644 GamecraftScripting/GamecraftScripting.csproj create mode 100644 GamecraftScripting/Plugin.cs diff --git a/GamecraftModdingAPI.dll b/GamecraftModdingAPI.dll new file mode 100644 index 0000000000000000000000000000000000000000..927d0a18744da51823b95d26586bb9ea6c8fa544 GIT binary patch literal 33792 zcmeHwdwf*Ywf{P2X3k7rlg#A(00RgP0U`lGP(eZxAeulR0a3v)BtsZYX2Q$_t}Lv5{9tJc=`SFcz5`>wV3nMV@P_IH2%+&}K% zth2vst-bf!d#}CrKKq=BttVVa4kB{m`}e;S-H$7O770Bt8G_h*&;wrDm-Xy~`;C@o zCvj9jeXC%RX2a-PT0ZVmPSz zwug4xwY^Rgt8EW&Wr#zMVOD6*~e2)Hg)<%W2NVI0F92dq&xzsEAE-mRCUzkw=O7u# zC(6#Yq8O&^s1GFI2N~jmq%;K0uq}GUYemgS;RIMGnose8g6&J-EL`{Zbq_!(GqUZ zhA&fCZM+n^Ll{mcx)gotqRqGh`vPT<6uSJb*qJEFPl0maDSq-BfeM{61C^ZeoDbhM z@=6M=Y17<3>+9%W!|x1Ku`J7H`JAzvP(o}UNOT;S*ZHi{wS|_?^2~ZJOWJb~>csT$ ziJ}=852XNj*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EbzQr>&btmT?MLJ5#+dwL^6(BNa!3eS7YQW} zn>UtLZGZPhYF}1AYtCHKmdyGR57k^Om&)73W0yxRZQ zYQ^outNM+-y{-IaqWo+o6q1)EmGtlYBl?lul3CpUBHaW0cjOWO5#BSqMEx=vOT#EW z>n+1~?H>HSc-}YaPl4kwq}EV7e(AjiCxNSwYQ}Nxa^PlAKDy=451k)=&QFxsC)2M- z3&su6K ze*?fsmaoo9_*9i2m)WOAtY@Ekq)uGz5a`o225`N5%|L-bBg#R`HKT6?}_zbQeeZVd1!4W)`MVYv3 zrQQ{q&%Mmr_J}c3J@${*zfAhG4drt049LlDsx@D}AMux$(2mSe1hP l-q;6^P$x`Zln-6#l5 literal 0 HcmV?d00001 diff --git a/GamecraftScripting.sln b/GamecraftScripting.sln new file mode 100644 index 0000000..73fb25f --- /dev/null +++ b/GamecraftScripting.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29609.76 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GamecraftScripting", "GamecraftScripting\GamecraftScripting.csproj", "{E0EEA15D-AB3C-4C73-A000-C49B5AE9EA66}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E0EEA15D-AB3C-4C73-A000-C49B5AE9EA66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E0EEA15D-AB3C-4C73-A000-C49B5AE9EA66}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E0EEA15D-AB3C-4C73-A000-C49B5AE9EA66}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E0EEA15D-AB3C-4C73-A000-C49B5AE9EA66}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {588EB8B7-9ADA-4723-BAC9-04B676A88771} + EndGlobalSection +EndGlobal diff --git a/GamecraftScripting/Commands/DebugCommandEngine.cs b/GamecraftScripting/Commands/DebugCommandEngine.cs new file mode 100644 index 0000000..e5e48a4 --- /dev/null +++ b/GamecraftScripting/Commands/DebugCommandEngine.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using GamecraftModdingAPI.Commands; +using GamecraftModdingAPI.Utility; +using Svelto.ECS; + +using IronPython; + +namespace GamecraftScripting.Commands +{ + class DebugCommandEngine : ICustomCommandEngine + { + public string Description { get; } = ""; + + public string Name { get; } = ""; + + public IEntitiesDB entitiesDB { set; private get; } + + public void Dispose() + { + CommandRegistrationHelper.Unregister("IronPythonInfo"); + } + + public void Ready() + { + CommandRegistrationHelper.Register("PythonInfo", ironPythonInfo, "Display Python debug info"); + } + + private void ironPythonInfo() + { + Logging.CommandLog(typeof(PythonOptions).Assembly.GetName().ToString()); + } + } +} diff --git a/GamecraftScripting/Commands/PythonRunnerCommandEngine.cs b/GamecraftScripting/Commands/PythonRunnerCommandEngine.cs new file mode 100644 index 0000000..8e34269 --- /dev/null +++ b/GamecraftScripting/Commands/PythonRunnerCommandEngine.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Numerics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using GamecraftModdingAPI.Commands; +using GamecraftModdingAPI.Utility; +using Svelto.ECS; + +using IronPython.Hosting; +using Microsoft.Scripting.Hosting; + +namespace GamecraftScripting.Commands +{ + class PythonRunnerCommandEngine : ICustomCommandEngine + { + public string Description { get; } = "Runs python scripts"; + + public string Name { get; } = "PythonRunner"; + + public IEntitiesDB entitiesDB { set; private get; } + + private ScriptEngine pythonEngine; + + private ScriptScope gameScope; + + public void Dispose() + { + CommandRegistrationHelper.Unregister("RunPythonScript"); + } + + public void Ready() + { + CommandRegistrationHelper.Register("RunPythonScript", RunPythonScript, "Run a python script stored on your computer"); + this.pythonEngine = Python.CreateEngine(); + this.gameScope = pythonEngine.CreateScope(); + } + + private void RunPythonScript(string scriptPath) + { + pythonEngine.ExecuteFile(scriptPath, gameScope); + } + + public PythonRunnerCommandEngine() + { + Logging.CommandLog($"cwd: {Directory.GetCurrentDirectory()}"); + } + } +} diff --git a/GamecraftScripting/GamecraftScripting.csproj b/GamecraftScripting/GamecraftScripting.csproj new file mode 100644 index 0000000..6fc5a51 --- /dev/null +++ b/GamecraftScripting/GamecraftScripting.csproj @@ -0,0 +1,546 @@ + + + + net48 + true + 0.0.1.0 + Exmods + GNU General Public Licence 3+ + https://git.exmods.org/SnakesOnAGame/GamecraftScripting + en-CA + + + + + + + + + + + + ..\GamecraftModdingAPI.dll + + + ..\..\ref\Gamecraft_Data\Managed\Analytics.dll + + + ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp-firstpass.dll + + + ..\..\ref\Gamecraft_Data\Managed\Assembly-CSharp.dll + + + ..\..\ref\Gamecraft_Data\Managed\Authentication.dll + + + ..\..\ref\Gamecraft_Data\Managed\BlockEntityFactory.dll + + + ..\..\ref\Gamecraft_Data\Managed\CommandLine.dll + + + ..\..\ref\Gamecraft_Data\Managed\DataLoader.dll + + + ..\..\ref\Gamecraft_Data\Managed\DDNA.dll + + + ..\..\ref\Gamecraft_Data\Managed\Facepunch.Steamworks.Win64.dll + + + ..\..\ref\Gamecraft_Data\Managed\FMOD.dll + + + ..\..\ref\Gamecraft_Data\Managed\FullGame.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Blocks.ConsoleBlock.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.Effects.dll + + + ..\..\ref\Gamecraft_Data\Managed\Gamecraft.GUI.ConsoleBlock.dll + + + ..\..\ref\Gamecraft_Data\Managed\GameState.dll + + + ..\..\ref\Gamecraft_Data\Managed\GPUInstancer.dll + + + ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.dll + + + ..\..\ref\Gamecraft_Data\Managed\Havok.Physics.Hybrid.dll + + + ..\..\ref\Gamecraft_Data\Managed\HdgRemoteDebugRuntime.dll + + + ..\..\ref\Gamecraft_Data\Managed\IllusionInjector.dll + + + ..\..\ref\Gamecraft_Data\Managed\IllusionPlugin.dll + + + ..\..\ref\Gamecraft_Data\Managed\JWT.dll + + + ..\..\ref\Gamecraft_Data\Managed\LZ4.dll + + + ..\..\ref\Gamecraft_Data\Managed\MultiplayerNetworking.dll + + + ..\..\ref\Gamecraft_Data\Managed\MultiplayerTest.dll + + + ..\..\ref\Gamecraft_Data\Managed\Newtonsoft.Json.dll + + + ..\..\ref\Gamecraft_Data\Managed\RCX.ScreenshotTaker.dll + + + ..\..\ref\Gamecraft_Data\Managed\Rewired_Core.dll + + + ..\..\ref\Gamecraft_Data\Managed\Rewired_Windows.dll + + + ..\..\ref\Gamecraft_Data\Managed\Robocraft.MainGame.AutoEnterSimulation.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.AccountPreferences.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Ghost.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Blocks.Triggers.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Character.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Common.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.ControlsScreen.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Crosshair.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.EntityStreamUtility.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.FrontEnd.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GameSignalHandling.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.DebugDisplay.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.RemoveBlock.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.ScaleGhost.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUI.SignalLabel.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.GUIs.WorkshopPrefabs.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Input.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Inventory.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MachineEditor.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainGame.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MainSimulation.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Multiplayer.NetworkEntityStream.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.MultiplayerInput.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Party.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PartyGui.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Physics.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.PilotSeat.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Player.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Priority.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Rendering.Mock.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveAndLoad.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SaveGameDialog.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Serializers.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.Services.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.SignalHandling.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX.StateSync.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX_SpawnPoints.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocraftX_TextBlock.dll + + + ..\..\ref\Gamecraft_Data\Managed\RobocratX.SimulationCompositionRoot.dll + + + ..\..\ref\Gamecraft_Data\Managed\StringFormatter.dll + + + ..\..\ref\Gamecraft_Data\Managed\Svelto.Common.dll + + + ..\..\ref\Gamecraft_Data\Managed\Svelto.ECS.Debugger.dll + + + ..\..\ref\Gamecraft_Data\Managed\Svelto.ECS.dll + + + ..\..\ref\Gamecraft_Data\Managed\Svelto.Services.dll + + + ..\..\ref\Gamecraft_Data\Managed\Svelto.Tasks.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Addressables.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Animation.Rigging.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Burst.Unsafe.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Cloud.UserReporting.Client.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Cloud.UserReporting.Plugin.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Collections.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.Hybrid.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.Properties.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Entities.StaticTypeRegistry.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Jobs.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Mathematics.Extensions.Hybrid.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Physics.Hybrid.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Postprocessing.Runtime.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Properties.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Rendering.Hybrid.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.Runtime.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Core.ShaderLibrary.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.Lightweight.Runtime.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.ResourceManager.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Scenes.Hybrid.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.ScriptableBuildPipeline.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.TextMeshPro.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Timeline.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.dll + + + ..\..\ref\Gamecraft_Data\Managed\Unity.Transforms.Hybrid.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AccessibilityModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AIModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AndroidJNIModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AnimationModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ARModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AssetBundleModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.AudioModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClothModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterInputModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ClusterRendererModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.CoreModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.CrashReportingModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.DirectorModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.DSPGraphModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.FileSystemHttpModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.GameCenterModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.GridModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.HotReloadModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ImageConversionModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.IMGUIModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.InputLegacyModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.InputModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.JSONSerializeModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.LocalizationModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ParticleSystemModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.PerformanceReportingModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.Physics2DModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.PhysicsModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ProfilerModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.ScreenCaptureModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SharedInternalsModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteMaskModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SpriteShapeModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.StreamingModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.SubstanceModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TerrainPhysicsModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TextCoreModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TextRenderingModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TilemapModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.TLSModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UI.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIElementsModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UIModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UmbraModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UNETModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityAnalyticsModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityConnectModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityTestProtocolModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAssetBundleModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestAudioModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestTextureModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.UnityWebRequestWWWModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VehiclesModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VFXModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VideoModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.VRModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.WindModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\UnityEngine.XRModule.dll + + + ..\..\ref\Gamecraft_Data\Managed\uREPL.dll + + + ..\..\ref\Gamecraft_Data\Managed\UserReporting.dll + + + ..\..\ref\Gamecraft_Data\Managed\VisualProfiler.dll + + + + + diff --git a/GamecraftScripting/Plugin.cs b/GamecraftScripting/Plugin.cs new file mode 100644 index 0000000..722123b --- /dev/null +++ b/GamecraftScripting/Plugin.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +using IllusionPlugin; +using UnityEngine; +using GamecraftModdingAPI; +using GamecraftModdingAPI.Commands; + +namespace GamecraftScripting +{ + class Plugin : IEnhancedPlugin + { + public string[] Filter { get; } = new string[] { "Gamecraft" }; + + public string Name { get; } = Assembly.GetExecutingAssembly().GetName().Name; + + public string Version { get; } = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + + + public void OnApplicationQuit() + { + Main.Shutdown(); + } + + public void OnApplicationStart() + { + Main.Init(); + // register development commands +#if DEBUG + CommandManager.AddCommand(new SimpleCustomCommandEngine(() => { Application.Quit(); }, "Exit", "Exit the game immediately")); +#endif + // debugging commands + CommandManager.AddCommand(new Commands.DebugCommandEngine()); + // functional commands + CommandManager.AddCommand(new Commands.PythonRunnerCommandEngine()); + } + + public void OnFixedUpdate() { } + + public void OnLateUpdate() { } + + public void OnLevelWasInitialized(int level) { } + + public void OnLevelWasLoaded(int level) { } + + public void OnUpdate() { } + } +} diff --git a/README.md b/README.md index 61a4d2c..930f89e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,14 @@ # GamecraftScripting -Python scripting support for Gamecraft \ No newline at end of file +Python scripting support for Gamecraft + +## Installation +[Follow the official mod installation guide](https://www.exmods.org/guides/install.html) + +## Script Development +GamecraftScripting uses IronPython to run Python 2.7 scripts in the Mono/.NET runtime. + +Resources +- [Python <-> .NET interfacing](https://ironpython.net/documentation/dotnet) +- [Python 2.7 docs](https://docs.python.org/2.7) +- [GamecraftModdingAPI .NET library](https://git.exmods/modtainers/GamecraftModdingAPI) \ No newline at end of file