diff --git a/HelloModdingWorld/MyPlugin.cs b/HelloModdingWorld/MyPlugin.cs deleted file mode 100644 index d261f30..0000000 --- a/HelloModdingWorld/MyPlugin.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Reflection; - -using IllusionPlugin; -//using GamecraftModdingAPI; - -namespace HelloModdingWorld -{ - public class MyPlugin : IEnhancedPlugin // the Illusion Plugin Architecture (IPA) will ignore classes that don't implement IPlugin' - { - public override string Name { get; } = Assembly.GetExecutingAssembly().GetName().Name; // HelloModdingWorld by default - // To change the name, change the project's name - - public override string Version { get; } = Assembly.GetExecutingAssembly().GetName().Version.ToString(); // 0.0.1 by default - // To change the version, change 0.0.1 in HelloModdingWorld.csproj - - // called when Gamecraft shuts down - public override void OnApplicationQuit() - { - // Shutdown this mod - GamecraftModdingAPI.Utility.Logging.LogDebug($"{Name} has shutdown"); - - // Shutdown the Gamecraft modding API last - GamecraftModdingAPI.Main.Shutdown(); - } - - // called when Gamecraft starts up - public override void OnApplicationStart() - { - // Initialize the Gamecraft modding API first - GamecraftModdingAPI.Main.Init(); - // check out the modding API docs here: https://mod.exmods.org/ - - // Initialize this mod - // create HelloWorld command - // this writes "Hello modding world!" when you execute it in Gamecraft's console - // (use the forward-slash key '/' to open the console in Gamecraft when in a game) - GamecraftModdingAPI.Commands.CommandBuilder.Builder() - .Name("HelloWorld") // command name (used to invoke it in the console) - .Description("Says Hello modding world!") // command description (displayed in help and hint toolbar) - .Action(() => { GamecraftModdingAPI.Utility.Logging.CommandLog("Hello modding world!"); }) - .Build(); // construct and automatically register the command so the modding API knows about it - - GamecraftModdingAPI.Utility.Logging.MetaLog($"{Name} has started up"); - } - - // unused methods - - public override void OnFixedUpdate() { } // called once per physics update - - public override void OnUpdate() { } // called once per rendered frame (frame update) - } -} diff --git a/HelloModdingWorld.sln b/NPort.sln similarity index 85% rename from HelloModdingWorld.sln rename to NPort.sln index 53b74f0..31345e0 100644 --- a/HelloModdingWorld.sln +++ b/NPort.sln @@ -3,7 +3,7 @@ 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}") = "HelloModdingWorld", "HelloModdingWorld\HelloModdingWorld.csproj", "{E0EEA15D-AB3C-4C73-A000-C49B5AE9EA66}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NPort", "NPort\NPort.csproj", "{E0EEA15D-AB3C-4C73-A000-C49B5AE9EA66}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/HelloModdingWorld/HelloModdingWorld.csproj b/NPort/NPort.csproj similarity index 99% rename from HelloModdingWorld/HelloModdingWorld.csproj rename to NPort/NPort.csproj index 1b417eb..8b7e004 100644 --- a/HelloModdingWorld/HelloModdingWorld.csproj +++ b/NPort/NPort.csproj @@ -6,7 +6,7 @@ 0.0.1 Me MIT - https://git.exmods.org/modtainers/HelloModdingWorld + https://git.exmods.org/NGnius/NPort en-CA diff --git a/NPort/NPortPlugin.cs b/NPort/NPortPlugin.cs new file mode 100644 index 0000000..6a863b0 --- /dev/null +++ b/NPort/NPortPlugin.cs @@ -0,0 +1,43 @@ +using System.Reflection; + +using IllusionPlugin; +//using GamecraftModdingAPI; + +namespace NPort +{ + public class NPortPlugin : IEnhancedPlugin + { + public override string Name { get; } = Assembly.GetExecutingAssembly().GetName().Name; + // To change the name, change the project's name + + public override string Version { get; } = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + + // called when Gamecraft shuts down + public override void OnApplicationQuit() + { + // Shutdown this mod + GamecraftModdingAPI.Utility.Logging.LogDebug($"{Name} has shutdown"); + + // Shutdown the Gamecraft modding API last + GamecraftModdingAPI.Main.Shutdown(); + } + + // called when Gamecraft starts up + public override void OnApplicationStart() + { + // Initialize the Gamecraft modding API first + GamecraftModdingAPI.Main.Init(); + // check out the modding API docs here: https://mod.exmods.org/ + + // Initialize this mod + + GamecraftModdingAPI.Utility.Logging.MetaLog($"{Name} has started up"); + } + + // unused methods + + public override void OnFixedUpdate() { } // called once per physics update + + public override void OnUpdate() { } // called once per rendered frame (frame update) + } +} diff --git a/README.md b/README.md index 1af4fef..f201644 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,21 @@ -# HelloModdingWorld +# NPort -Shell project for Techblox mods. -Use this as a quick-start project structure for your own mods, or to learn how modding works. +Stuff for importing things into Techblox. ## Setup -This project requires most of Techblox's `.dll` files to function correctly. -Most, but not all, of these files are stored in Techblox's `Techblox_Data/Managed` folder. -The project is pre-configured to look in a folder called ref in the solution's main directory or one level up from that. +Refer to [HelloModdingWorld's instructions](https://git.exmods.org/modtainers/HelloModdingWorld). -You can make sure HelloModdingWorld can find all of `.dll` files it needs by copying your Techblox folder here and renaming it to `ref`, but you'll have to re-copy it after every Techblox update. -You can also create a symbolic link (look it up) to your Techblox install folder named `ref` in this folder to avoid having to re-copy files. - -For any mod to work, you will have to patch your game with [GCIPA](https://git.exmods.org/modtainers/GCIPA). -[Direct link to install guide](https://git.exmods.org/modtainers/GCIPA/src/branch/master/README.md#how-to-install). - -This project also requires the [GamecraftModdingAPI](https://git.exmods.org/modtainers/GamecraftModdingAPI) library to be installed (in `ref/Plugins/GamecraftModdingAPI.dll`). -[Direct link to install guide](https://www.exmods.org/guides/install.html). - -If you don't want to use the standard modding API, -you can remove the dependency by removing ` ... ` in `HelloModdingWorld.csproj` and removing all mentions in `MyPlugin.cs`. +Some external libraries are also used, which should be installed seperately. ## Building -After you've completed the setup, open the solution file `HelloModdingWorld.sln` in your prefered C# .NET/Mono development environment. -I'd recommend Visual Studio Community Edition or JetBrains Rider for Windows and Monodevelop for Linux. +Refer to [HelloModdingWorld's instructions](https://git.exmods.org/modtainers/HelloModdingWorld). -If you've successfully completed setup, you should be able to build the HelloModdingWorld project without errors. -The build configuration should be automatically imported from the project's files. -If it doesn't work and you can't figure out why, ask for help on [our Discord server](https://discord.gg/xjnFxQV). +Some external libraries written in Rust are also used, which can be built by the standard Rust toolchain (`cargo build`). ## Installation -To install the HelloModdingWorld mod, copy the build's `HelloModdingWorld.dll` into the `Plugins` folder in Techblox's main folder. +Patch Techblox with the latest version of [GCIPA](https://git.exmods.org/modtainers/GCIPA) and install [GamecraftModdingAPI](https://git.exmods.org/modtainers/GamecraftModdingAPI) first. +Then, to install the NPort, download the latest release and put `NPort.dll` into Techblox's `Plugins` folder. +The next time Techblox is launched, NPort may automatically download any other required files.