├── .gitignore ├── CommandletPlugin.uplugin ├── Docs └── screenshot.png ├── LICENSE ├── README.md ├── Resources └── Icon128.png └── Source └── CommandletPlugin ├── CommandletPlugin.Build.cs └── Private ├── CommandletPluginModule.cpp ├── CommandletPluginPrivate.h └── Commandlets ├── HelloWorldCommandlet.cpp └── HelloWorldCommandlet.h /.gitignore: -------------------------------------------------------------------------------- 1 | Binaries/ 2 | Intermediate/ -------------------------------------------------------------------------------- /CommandletPlugin.uplugin: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion" : 3, 3 | "Version" : 7, 4 | "VersionName" : "7.0", 5 | "EngineVersion" : "4.19.0", 6 | "FriendlyName" : "Commandlet Plugin", 7 | "Description" : "Demonstates how to implement a commandlet in a plug-in.", 8 | "Category" : "Examples", 9 | "CreatedBy" : "Headcrash Industries LLC", 10 | "CreatedByURL" : "http://headcrash.industries", 11 | "DocsURL" : "", 12 | "MarketplaceURL" : "", 13 | "SupportURL" : "https://github.com/ue4plugins/CommandletPlugin", 14 | "EnabledByDefault" : true, 15 | "CanContainContent" : false, 16 | "IsBetaVersion" : false, 17 | "Installed" : false, 18 | "Modules" : 19 | [ 20 | { 21 | "Name" : "CommandletPlugin", 22 | "Type" : "Runtime", 23 | "LoadingPhase" : "Default" 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /Docs/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ue4plugins/CommandletPlugin/f532bd5a83e4f3a6c9593789500745b5a0827a28/Docs/screenshot.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2016 Epic Games, Inc. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CommandletPlugin 2 | 3 | Unreal Engine 4 plug-in that that demonstrates how to implement a commandlet. 4 | 5 | ![Screenshot](Docs/screenshot.png) 6 | 7 | 8 | ## Supported Platforms 9 | 10 | This plug-in was last built against **Unreal Engine 4.19**. It works on all 11 | platforms. 12 | 13 | 14 | ## Dependencies 15 | 16 | This plug-in requires Visual Studio and either a C++ code project or the full 17 | Unreal Engine 4 source code from GitHub. If you are new to programming in UE4, 18 | please see the official [Programming Guide](https://docs.unrealengine.com/latest/INT/Programming/index.html)! 19 | 20 | 21 | ## Usage 22 | 23 | You can use this plug-in as a project plug-in, or an Engine plug-in. 24 | 25 | If you use it as a project plug-in, clone this repository into your project's 26 | */Plugins* directory and compile your game in Visual Studio. A C++ code project 27 | is required for this to work. 28 | 29 | If you use it as an Engine plug-in, clone this repository into the 30 | */Engine/Plugins/Media* directory and compile your game. Full Unreal Engine 4 31 | source code from GitHub is required for this. 32 | 33 | After compiling the plug-in, you have to **enable it** in Unreal Editor's 34 | plug-in browser. 35 | 36 | Use the *-run* command line parameter to run one of the commandlets in this 37 | plug-in, i.e. *YourGame.exe -run=HelloWorld* 38 | 39 | 40 | ## Support 41 | 42 | Please [file an issue](https://github.com/ue4plugins/CommandletPlugin/issues), 43 | submit a [pull request](https://github.com/ue4plugins/CommandletPlugin/pulls?q=is%3Aopen+is%3Apr) 44 | or email us at info@headcrash.industries 45 | 46 | 47 | ## References 48 | 49 | * [Introduction to UE4 Plugins](https://wiki.unrealengine.com/An_Introduction_to_UE4_Plugins) 50 | -------------------------------------------------------------------------------- /Resources/Icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ue4plugins/CommandletPlugin/f532bd5a83e4f3a6c9593789500745b5a0827a28/Resources/Icon128.png -------------------------------------------------------------------------------- /Source/CommandletPlugin/CommandletPlugin.Build.cs: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | namespace UnrealBuildTool.Rules 4 | { 5 | public class CommandletPlugin : ModuleRules 6 | { 7 | public CommandletPlugin(ReadOnlyTargetRules Target) : base(Target) 8 | { 9 | PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; 10 | 11 | PrivateDependencyModuleNames.AddRange( 12 | new string[] { 13 | "Core", 14 | "CoreUObject", 15 | "Engine", 16 | }); 17 | 18 | PrivateIncludePaths.AddRange( 19 | new string[] { 20 | "CommandletPlugin/Private", 21 | "CommandletPlugin/Private/Commandlets" 22 | }); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Source/CommandletPlugin/Private/CommandletPluginModule.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "CommandletPluginPrivate.h" 4 | 5 | #include "Modules/ModuleInterface.h" 6 | #include "Modules/ModuleManager.h" 7 | 8 | 9 | DEFINE_LOG_CATEGORY(LogCommandletPlugin); 10 | 11 | 12 | /** 13 | * Implements the CommandletPlugin module. 14 | */ 15 | class FCommandletPluginModule 16 | : public IModuleInterface 17 | { 18 | public: 19 | 20 | //~ IModuleInterface interface 21 | 22 | virtual void StartupModule() override { } 23 | virtual void ShutdownModule() override { } 24 | 25 | virtual bool SupportsDynamicReloading() override 26 | { 27 | return true; 28 | } 29 | }; 30 | 31 | 32 | IMPLEMENT_MODULE(FCommandletPluginModule, CommandletPlugin); 33 | -------------------------------------------------------------------------------- /Source/CommandletPlugin/Private/CommandletPluginPrivate.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "Logging/LogMacros.h" 6 | 7 | 8 | /** Declares a log category for this module. */ 9 | DECLARE_LOG_CATEGORY_EXTERN(LogCommandletPlugin, Log, All); 10 | -------------------------------------------------------------------------------- /Source/CommandletPlugin/Private/Commandlets/HelloWorldCommandlet.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "HelloWorldCommandlet.h" 4 | #include "CommandletPluginPrivate.h" 5 | 6 | 7 | UHelloWorldCommandlet::UHelloWorldCommandlet() 8 | { 9 | IsClient = false; 10 | IsEditor = false; 11 | IsServer = false; 12 | LogToConsole = true; 13 | } 14 | 15 | 16 | int32 UHelloWorldCommandlet::Main(const FString& Params) 17 | { 18 | UE_LOG(LogCommandletPlugin, Display, TEXT("Hello world!")); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /Source/CommandletPlugin/Private/Commandlets/HelloWorldCommandlet.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "Commandlets/Commandlet.h" 6 | 7 | #include "HelloWorldCommandlet.generated.h" 8 | 9 | 10 | UCLASS() 11 | class UHelloWorldCommandlet 12 | : public UCommandlet 13 | { 14 | GENERATED_BODY() 15 | 16 | public: 17 | 18 | /** Default constructor. */ 19 | UHelloWorldCommandlet(); 20 | 21 | public: 22 | 23 | //~ UCommandlet interface 24 | 25 | virtual int32 Main(const FString& Params) override; 26 | }; 27 | --------------------------------------------------------------------------------