ue4plugins / CommandletPlugin

Unreal Engine 4 plug-in that demonstrates how to implement a commandlet.
BSD 3-Clause "New" or "Revised" License
92 stars 21 forks source link

Project plugin executable error #1

Closed angelali92 closed 7 years ago

angelali92 commented 8 years ago

I cloned the repository to my local /Plugins folder and packaged my project to create an executable.

When running MyGame.exe -run=HelloWorld,

I get this error: LogInit:Error: Cannot run editor commandlet Class /Script/CommandletPlugin.HelloWorldCommandlet with game executable.

Is there a way to run this with an Editor executable without making this an Engine plugin? Apologies in advance if this is a super easy fix. I'm new to Unreal, so not familiar with common practices - yet :)

gmpreussner commented 8 years ago

Looks like commandlets are initialized to require the Editor by default. This should be fixed now, thanks :)

angelali92 commented 8 years ago

Thanks so much for the quick response! Unfortunately, I'm getting some errors. I isolated the errors to two lines of code.

When IsClient = false and IsEditor = false, this error pops up when running the commandlet: Assertion failed: ModuleManager.IsModuleLoaded(ModuleName) [File:Runtime/Core/Public/Modules\ModuleManager.h][Line:240] Tried to get module interface for unloaded module: 'OnlineSubsystem'

When IsEditor = false, this error pops up when running the commandlet: Assertion failed: IsValid() [File:Runtime/Core/Public/Templates\SharedPointer.h] [Line:728]

Side note: I'm using version 4.12. Let me know if you think I set up my project incorrectly or if the errors don't appear in 4.13. Thanks!

gmpreussner commented 8 years ago

Hmm... I have not seen those errors in 4.13. I can run the commandlet using both Editor and Game executables.

Can you copy/paste the whole callstack for both errors?

angelali92 commented 8 years ago

Made an edit to my previous comment for the 'OnlineSubsystem' error. It seems to show up when IsClient = false and IsEditor = false. Here is the callstack taken from the log file for the 'OnlineSubsystem' error. I removed the LogMemory entries since I assume they're not important.

Log file open, 09/29/16 18:46:45 LogPlatformFile: Not using cached read wrapper LogInit:Display: RandInit(-1902147268) SRandInit(-1902147265). LogTaskGraph: Started task graph with 4 named threads and 7 total threads with 1 sets of task threads. LogStats: Stats thread started at 0.973735 LogInit: Version: 4.12.5-3039270+++UE4+Release-4.12 LogInit: API Version: 2992821 LogInit: Net Version: 3039270 LogDevObjectVersion: Number of dev versions registered: 13 LogDevObjectVersion: Dev-Blueprints (B0D832E4-1F89-4F0D-ACCF-7EB736FD4AA2): 3 LogDevObjectVersion: Dev-Build (E1C64328-A22C-4D53-A36C-8E866417BD8C): 0 LogDevObjectVersion: Dev-Core (375EC13C-06E4-48FB-B500-84F0262A717E): 1 LogDevObjectVersion: Dev-Editor (E4B068ED-F494-42E9-A231-DA0B2E46BB41): 2 LogDevObjectVersion: Dev-Framework (CFFC743F-43B0-4480-9391-14DF171D2073): 6 LogDevObjectVersion: Dev-Mobile (B02B49B5-BB20-44E9-A304-32B752E40360): 0 LogDevObjectVersion: Dev-Networking (A4E4105C-59A1-49B5-A7C5-40C4547EDFEE): 0 LogDevObjectVersion: Dev-Online (39C831C9-5AE6-47DC-9A44-9C173E1C8E7C): 0 LogDevObjectVersion: Dev-Physics (78F01B33-EBEA-4F98-B9B4-84EACCB95AA2): 0 LogDevObjectVersion: Dev-Platform (6631380F-2D4D-43E0-8009-CF276956A95A): 0 LogDevObjectVersion: Dev-Rendering (12F88B9F-8875-4AFC-A67C-D90C383ABD29): 2 LogDevObjectVersion: Dev-Sequencer (7B5AE74C-D270-4C10-A958-57980B212A5A): 0 LogDevObjectVersion: Dev-VR (D7296918-1DD6-4BDD-9DE2-64A83CC13884): 0 LogInit: Compiled (64-bit): Jul 6 2016 09:06:15 LogInit: Compiled with Visual C++: 19.00.23026.00 LogInit: Build Configuration: Development LogInit: Branch Name: ++UE4+Release-4.12 LogInit: Command line: -run=HelloWorld LogInit: Base directory: E:/workspace/test/test_unreal/auto_import_test/WindowsNoEditor/auto_import_test/Binaries/Win64/ LogInit: Installed Engine Build: 0 LogInit: Presizing for max 2097152 objects, including 0 objects not considered by GC, pre-allocating 0 bytes for permanent pool. LogInit: Object subsystem initialized [2016.09.30-01.46.45:551][ 0]LogInit: Selected Device Profile: [WindowsNoEditor] [2016.09.30-01.46.45:551][ 0]LogInit: Applying CVar settings loaded from the selected device profile: [WindowsNoEditor] [2016.09.30-01.46.45:559][ 0]LogInit: CPU Page size=65536, Cores=4 [2016.09.30-01.46.45:559][ 0]LogInit: High frequency timer resolution =3.914316 MHz [2016.09.30-01.46.45:599][ 0]LogTextLocalizationManager: No specific translations for ('en-US') exist, so ('en') translations will be used. [2016.09.30-01.46.45:684][ 0]LogAssetRegistry: FAssetRegistry took 0.0034 seconds to start up [2016.09.30-01.46.45:686][ 0]LogPackageLocalizationCache: Processed 3 localized package path(s) for 2 prioritized culture(s) in 0.001856 seconds [2016.09.30-01.46.45:689][ 0]LogInit: Selected Device Profile: [WindowsNoEditor] [2016.09.30-01.46.45:731][ 0]LogInit: WinSock: version 1.1 (2.2), MaxSocks=32767, MaxUdp=65467 [2016.09.30-01.46.45:761][ 0]LogSubstanceCoreModule: Substance CPU Engine Loaded, Max Texture Size 2048 [2016.09.30-01.46.45:769][ 0]LogUObjectArray: 27615 objects as part of root set at end of initial load. [2016.09.30-01.46.45:769][ 0]LogUObjectAllocator: 5491392 out of 0 bytes used by permanent object pool. [2016.09.30-01.46.45:769][ 0]LogUObjectArray: CloseDisregardForGC: 0/0 objects in disregard for GC pool [2016.09.30-01.46.45:854][ 0]LogInit: Executing Class /Script/CommandletPlugin.HelloWorldCommandlet [2016.09.30-01.46.45:854][ 0]LogInit: Initializing Game Engine... [2016.09.30-01.46.45:854][ 0]LogEngine: Initializing Engine... [2016.09.30-01.46.45:857][ 0]LogUObjectGlobals:Warning: Failed to find object 'Font /Engine/EngineFonts/RobotoTiny.RobotoTiny' [2016.09.30-01.46.45:857][ 0]LogInit: Texture streaming: Disabled [2016.09.30-01.46.45:861][ 0]LogNet: Browse: /Game/StarterContent/Maps/StarterMap?Name=Player [2016.09.30-01.46.45:861][ 0]LogLoad: LoadMap: /Game/StarterContent/Maps/StarterMap?Name=Player [2016.09.30-01.46.45:970][ 0]LogAIModule: Creating AISystem for world StarterMap [2016.09.30-01.46.45:970][ 0]LogWorld: Game class is 'GameMode' [2016.09.30-01.46.45:971][ 0]LogInit: WinSock: Socket queue 131072 / 131072 [2016.09.30-01.46.45:975][ 0]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent) [2016.09.30-01.46.45:975][ 0]LogNet: GameNetDriver IpNetDriver_0 IpNetDriver listening on port 7777 [2016.09.30-01.46.45:977][ 0]LogWorld: Bringing World /Game/StarterContent/Maps/StarterMap.StarterMap up for play (max tick rate 30) at 2016.09.29-18.46.45 [2016.09.30-01.46.45:977][ 0]LogWindows: Windows GetLastError: The operation completed successfully. (0) [2016.09.30-01.46.46:137][ 0]LogWindows:Error: === Critical error: === Assertion failed: ModuleManager.IsModuleLoaded(ModuleName) [File:Runtime/Core/Public/Modules\ModuleManager.h] [Line: 240] Tried to get module interface for unloaded module: 'OnlineSubsystem'

[2016.09.30-01.46.46:137][ 0]LogExit: Executing StaticShutdownAfterError [2016.09.30-01.46.46:139][ 0]LogWindows: FPlatformMisc::RequestExit(1) [2016.09.30-01.46.46:139][ 0]Log file closed, 09/29/16 18:46:46

angelali92 commented 8 years ago

Log file for the shared pointer 'isValid()' error:

Log file open, 09/29/16 18:24:21 LogPlatformFile: Not using cached read wrapper LogInit:Display: RandInit(1428530865) SRandInit(1428530869). LogTaskGraph: Started task graph with 4 named threads and 7 total threads with 1 sets of task threads. LogStats: Stats thread started at 0.674490 LogInit: Version: 4.12.5-3039270+++UE4+Release-4.12 LogInit: API Version: 2992821 LogInit: Net Version: 3039270 LogDevObjectVersion: Number of dev versions registered: 13 LogDevObjectVersion: Dev-Blueprints (B0D832E4-1F89-4F0D-ACCF-7EB736FD4AA2): 3 LogDevObjectVersion: Dev-Build (E1C64328-A22C-4D53-A36C-8E866417BD8C): 0 LogDevObjectVersion: Dev-Core (375EC13C-06E4-48FB-B500-84F0262A717E): 1 LogDevObjectVersion: Dev-Editor (E4B068ED-F494-42E9-A231-DA0B2E46BB41): 2 LogDevObjectVersion: Dev-Framework (CFFC743F-43B0-4480-9391-14DF171D2073): 6 LogDevObjectVersion: Dev-Mobile (B02B49B5-BB20-44E9-A304-32B752E40360): 0 LogDevObjectVersion: Dev-Networking (A4E4105C-59A1-49B5-A7C5-40C4547EDFEE): 0 LogDevObjectVersion: Dev-Online (39C831C9-5AE6-47DC-9A44-9C173E1C8E7C): 0 LogDevObjectVersion: Dev-Physics (78F01B33-EBEA-4F98-B9B4-84EACCB95AA2): 0 LogDevObjectVersion: Dev-Platform (6631380F-2D4D-43E0-8009-CF276956A95A): 0 LogDevObjectVersion: Dev-Rendering (12F88B9F-8875-4AFC-A67C-D90C383ABD29): 2 LogDevObjectVersion: Dev-Sequencer (7B5AE74C-D270-4C10-A958-57980B212A5A): 0 LogDevObjectVersion: Dev-VR (D7296918-1DD6-4BDD-9DE2-64A83CC13884): 0 LogInit: Compiled (64-bit): Jul 6 2016 09:06:15 LogInit: Compiled with Visual C++: 19.00.23026.00 LogInit: Build Configuration: Development LogInit: Branch Name: ++UE4+Release-4.12 LogInit: Command line: -run=HelloWorld LogInit: Base directory: E:/workspace/test/test_unreal/auto_import_test/WindowsNoEditor/auto_import_test/Binaries/Win64/ LogInit: Installed Engine Build: 0 LogInit: Presizing for max 2097152 objects, including 0 objects not considered by GC, pre-allocating 0 bytes for permanent pool. LogInit: Object subsystem initialized [2016.09.30-01.24.21:891][ 0]LogInit: Selected Device Profile: [WindowsNoEditor] [2016.09.30-01.24.21:891][ 0]LogInit: Applying CVar settings loaded from the selected device profile: [WindowsNoEditor] [2016.09.30-01.24.21:897][ 0]LogInit: CPU Page size=65536, Cores=4 [2016.09.30-01.24.21:897][ 0]LogInit: High frequency timer resolution =3.914316 MHz [2016.09.30-01.24.21:897][ 0]LogMemory: Memory total: Physical=31.9GB (32GB approx) [2016.09.30-01.24.21:897][ 0]LogMemory: Platform Memory Stats for WindowsNoEditor [2016.09.30-01.24.21:897][ 0]LogMemory: Process Physical Memory: 66.93 MB used, 66.93 MB peak [2016.09.30-01.24.21:897][ 0]LogMemory: Process Virtual Memory: 84.81 MB used, 84.81 MB peak [2016.09.30-01.24.21:897][ 0]LogMemory: Physical Memory: 8923.64 MB used, 32715.96 MB total [2016.09.30-01.24.21:897][ 0]LogMemory: Virtual Memory: 274.88 MB used, 8388608.00 MB total [2016.09.30-01.24.21:929][ 0]LogTextLocalizationManager: No specific translations for ('en-US') exist, so ('en') translations will be used. [2016.09.30-01.24.22:006][ 0]LogAssetRegistry: FAssetRegistry took 0.0034 seconds to start up [2016.09.30-01.24.22:007][ 0]LogPackageLocalizationCache: Processed 3 localized package path(s) for 2 prioritized culture(s) in 0.001855 seconds [2016.09.30-01.24.22:011][ 0]LogInit: Selected Device Profile: [WindowsNoEditor] [2016.09.30-01.24.22:049][ 0]LogInit: WinSock: version 1.1 (2.2), MaxSocks=32767, MaxUdp=65467 [2016.09.30-01.24.22:080][ 0]LogSubstanceCoreModule: Substance CPU Engine Loaded, Max Texture Size 2048 [2016.09.30-01.24.22:083][ 0]LogUObjectArray: 27615 objects as part of root set at end of initial load. [2016.09.30-01.24.22:083][ 0]LogUObjectAllocator: 5491392 out of 0 bytes used by permanent object pool. [2016.09.30-01.24.22:083][ 0]LogUObjectArray: CloseDisregardForGC: 0/0 objects in disregard for GC pool [2016.09.30-01.24.22:106][ 0]LogInit: Executing Class /Script/CommandletPlugin.HelloWorldCommandlet [2016.09.30-01.24.22:107][ 0]LogInit: Initializing Game Engine... [2016.09.30-01.24.22:107][ 0]LogEngine: Initializing Engine... [2016.09.30-01.24.22:109][ 0]LogInit: Texture streaming: Disabled [2016.09.30-01.24.22:113][ 0]LogEngine: GameWindow did not exist. Was created [2016.09.30-01.24.22:122][ 0]LogWindows: Windows GetLastError: The operation completed successfully. (0) [2016.09.30-01.24.22:246][ 0]LogWindows:Error: === Critical error: === Assertion failed: IsValid() [File:Runtime/Core/Public/Templates\SharedPointer.h] [Line: 728]

[2016.09.30-01.24.22:247][ 0]LogExit: Executing StaticShutdownAfterError [2016.09.30-01.24.22:248][ 0]LogWindows: FPlatformMisc::RequestExit(1) [2016.09.30-01.24.22:248][ 0]Log file closed, 09/29/16 18:24:22

gmpreussner commented 7 years ago

Hey Angela, sorry for the delay - I've been slammed with other things. I cannot reproduce the problems with the latest code. I'm currently on 4.14 / 4.15.

gmpreussner commented 7 years ago

I'm going to close this. Please ping this thread again if you're still seeing this issue, thanks!