proletariatgames / unreal.hx

Unreal.hx: Haxe Integration for Unreal
MIT License
424 stars 43 forks source link

Spent around 2 hours attempting to setup Unreal Hx with UE4 4.19.2 #101

Closed etherealbacon closed 6 years ago

etherealbacon commented 6 years ago

As title says, had no joy, engine would not recognise the plugin, definitely in the correct place.

Really enthusiastic about using Haxe with UE4 but alas, no luck.

Followed the instructions, word for word on the readme.

datee commented 6 years ago

Do you have Haxe 3.4.7 / 4.0, hxcs and hxcpp installed?

Did you try the following : -Create a empty c++ project in the launcher -Create a plugins/Unrealhx folder -Copy the repo to the plugins UnrealHx folder -Add the plugin "UnrealHx" to the .uproject file in a text editor -Edit the build.cs file under source/projectname to extend HaxeModuleRules instead of ModuleRules -Open visual studio and compile

It should be OK, haxe libs and UE4 should compile and launch.

What kind of error do you get?

etherealbacon commented 6 years ago

-Add the plugin "UnrealHx" to the .uproject file in a text editor.

Missed this step, will check back after trying.

Thanks for the prompt reply!

etherealbacon commented 6 years ago
1>------ Build started: Project: MWareGame, Configuration: Development_Editor x64 ------
1>Couldn't parse '------- ' in UnrealBuildTool.ConfigFileSection of D:\Program Files\Epic Games\UE_4.19\Engine\Config\BaseEngine.ini
1>Couldn't parse '-------' in UnrealBuildTool.ConfigFileSection of D:\Program Files\Epic Games\UE_4.19\Engine\Config\BaseEngine.ini
1>Creating makefile for MWareGameEditor (changes to module files)
1>Using Python at: C:/Python27
1>[WARNING] Your Python installation is not in the system PATH environment variable.
1>[WARNING] Ensure your python paths are set in GlobalConfig (DefaultEngine.ini) so the path can be corrected at runtime.
1>BuildApi.Build.cs: Using Haxe
1>Calling Haxe
1>Calling the build tool with arguments --cwd "d:\Documents\Unreal Projects\MWareGame\Plugins\UnrealHx/Haxe/BuildTool" compile-project.hxml -D "EngineDir=D:\Program Files\Epic Games\UE_4.19\Engine" -D "ProjectDir=d:\Documents\Unreal Projects\MWareGame" -D "TargetName=MWareGameEditor" -D "TargetPlatform=Win64" -D "TargetConfiguration=Development" -D "TargetType=Editor" -D "ProjectFile=d:\Documents\Unreal Projects\MWareGame\MWareGame.uproject" -D "PluginDir=d:\Documents\Unreal Projects\MWareGame\Plugins\UnrealHx" -D UE_BUILD_CS
1>UnrealBuildTool : error : Unable to instantiate module 'MWareGame': System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
1>                           at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
1>                           at HaxeModuleRules.callHaxe(ModuleRules rules, HaxeCompilationInfo info, HaxeConfigOptions options) in d:\Documents\Unreal Projects\MWareGame\Plugins\UnrealHx\Source\HaxeInit\BuildApi.Build.cs:line 324
1>                           at HaxeModuleRules.setupHaxeTarget(ModuleRules rules, Boolean forceHaxeCompilation, HaxeConfigOptions options) in d:\Documents\Unreal Projects\MWareGame\Plugins\UnrealHx\Source\HaxeInit\BuildApi.Build.cs:line 273
1>                           at HaxeModuleRules.run() in d:\Documents\Unreal Projects\MWareGame\Plugins\UnrealHx\Source\HaxeInit\BuildApi.Build.cs:line 177
1>                           at MWareGame..ctor(ReadOnlyTargetRules Target) in d:\Documents\Unreal Projects\MWareGame\Source\MWareGame\MWareGame.Build.cs:line 9
1>                        (referenced via MWareGameEditor.Target.cs)
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3075: The command ""D:\Program Files\Epic Games\UE_4.19\Engine\Build\BatchFiles\Build.bat" MWareGameEditor Win64 Development "d:\Documents\Unreal Projects\MWareGame\MWareGame.uproject" -WaitMutex -FromMsBuild" exited with code 5. Please verify that you have sufficient rights to run this command.
1>Done building project "MWareGame.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped =========

when trying change "ModuleRules" to "HaxeModuleRules" in the build.cs

etherealbacon commented 6 years ago

Seems that haxe environment variables werent exported properly, restarted machine and they were available to VS. Thanks again!