Code Monkey home page Code Monkey logo

haxe-unrealengine5's People

Contributors

somerandev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

haxe-unrealengine5's Issues

FString -> String

Is it currently possible to convert an FString to a haxe String?
I'm trying to pass a String from a blueprint to a Haxe function, however can't workout how to convert the FString (Int and bool work)

Sample Project notes

Hey

I appreciate that you're mid development on a lot of this project, but I thought I'd share a few notes / questions on the Sample project

Following the README.

1) Compile Plugin's Haxe Lib

When running haxe compile.hxml I'm getting a bunch of errors

Error: Semaphore.cpp
include\sys/thread/Semaphore.h(43): error C2039: '__hxcpp_semaphore_create': is not a member of '`global namespace''
include\sys/thread/Semaphore.h(43): error C3861: '__hxcpp_semaphore_create': identifier not found
./src/sys/thread/Semaphore.cpp(18): error C2039: '__hxcpp_semaphore_create': is not a member of '`global namespace''
./src/sys/thread/Semaphore.cpp(18): error C3861: '__hxcpp_semaphore_create': identifier not found
./src/sys/thread/Semaphore.cpp(38): error C2039: '__hxcpp_semaphore_acquire': is not a member of '`global namespace''
./src/sys/thread/Semaphore.cpp(38): error C3861: '__hxcpp_semaphore_acquire': identifier not found
./src/sys/thread/Semaphore.cpp(53): error C2039: '__hxcpp_semaphore_try_acquire': is not a member of '`global namespace''
./src/sys/thread/Semaphore.cpp(53): error C3861: '__hxcpp_semaphore_try_acquire': identifier not found
./src/sys/thread/Semaphore.cpp(61): error C2039: '__hxcpp_semaphore_release': is not a member of '`global namespace''
./src/sys/thread/Semaphore.cpp(61): error C3861: '__hxcpp_semaphore_release': identifier not found

In compile.hxml commenting out the Test line resolves this issue.
The Test class looks to be doing something with cppia, it also has some references to Z:\\Desktop\..

2) Build Plugin

This step seems to run as expected, however the output does contain warning messages along the lines of:

...\Haxe-UnrealEngine5\SampleProject\Plugins\HaxeCompatibility\HostProject\Plugins\HaxeCompatibility\Source\HaxeCompatibility\hxcpp-include\Array.h(910): note: see reference to function template instantiation 'Dynamic Array_obj<ELEM_>::keyValueIterator(void)' being compiled      
        with
        [
            ELEM_=Dynamic
        ]

Are you getting similar warnings?

3) Compile Main Project Haxe

When running this step I get the following errors:

src/ue_helpers/Array.hx:43: characters 3-16 : ue_helpers.TArrayHX<ue_helpers.TArrayHX.T> should be Array<ue_helpers.TArrayHX.T>
src/ue_helpers/Array.hx:90: characters 3-14 : ue_helpers.TArrayHX<ue_helpers.TArrayHX.T> should be Array<ue_helpers.TArrayHX.T>
src/ue_helpers/Array.hx:128: characters 43-47 : ue_helpers.TArrayHX<ue_helpers.TArrayHX.T> should be Array<Unknown<0>>
src/ue_helpers/Array.hx:128: characters 43-47 : ... For function argument 'array'
src/ue_helpers/Array.hx:132: characters 36-40 : ue_helpers.TArrayHX<ue_helpers.TArrayHX.T> should be Array<Unknown<0>>
src/ue_helpers/Array.hx:132: characters 36-40 : ... For function argument 'array'
src/ue_helpers/Array.hx:158: characters 3-14 : ue_helpers.TArrayHX<ue_helpers.TArrayHX.T> should be Array<ue_helpers.TArrayHX.T>
src/ue_helpers/String.hx:94: characters 3-14 : ue_helpers.FStringHX should be String
src/ue_helpers/String.hx:99: characters 10-20 : String has no field AppendChar
src/ue_helpers/String.hx:24: characters 32-41 : You cannot access the cpp package while in a macro (for cpp.Int32)

If I delete src/ue_helpers/Array.hx and src/ue_helpers/String.hx this step compiles without errors and creates the following output:
image
Is it expected there is AAMyActor.h, AMyActor.h and MyActor.h
It is somewhat annoying that Unreal require prefixed letters at the start of Classes within the Class, however the filename is different.. how are you getting around this requirement?

Is seems like my output is slightly off.
for example I would expect the include line to omit the A at the start and instead read: #include MyActor.generated.h
image

4) Open/Compile UE Project

When hitting the compile button, or running the .sln project I get the following errors which seem to be related to the prefix letters:

Haxe-UnrealEngine5/SampleProject/Source/HaxeProject/HaxeOutput/include/CustomClass.h(25): error : When compiling class definition for '', attempting to strip prefix results in an empty name. Did you leave off a prefix?
Haxe-UnrealEngine5/SampleProject/Source/HaxeProject/HaxeOutput/include/MyActor.h(25): error : When compiling class definition for '', attempting to strip prefix results in an empty name. Did you leave off a prefix?

TReturnType UClass UObject

Hey where are TReturnType, UClass, UObject defined?
I'm getting errors for each of these along the lines of:

src/ue/FObjectInitializer.hx:8: characters 117-128 : Type not found : TReturnType

src/ue/FObjectInitializer.hx:10: characters 39-45 : Type not found : UClass

src/ue/FObjectInitializer.hx:8: characters 57-64 : Type not found : UObject

Compilation creates lots of warnings

So, compiling a project seems to generate lots and lots of hxcpp warnings.. any idea whats going on here?
Even so, the project complies and runs ok - but it would definitly be nice to remove or at least supress these?

(I've attached a file with the warnings)
warnings.txt

HaxeProject could not be compiled,Try rebuilding from source manually?

HaxeProject could not be compiled,Try rebuilding from source manually?

image

my unreal version is 5.0.3 is that right? or 5.0? and windows 11.

from your tutorial

1. install custom haxe version  Haxe Compiler 4.3.0-rc.1  and then  install hxcpp and hscript git version.


3.  UpdateExternsInSampleProject.bat  &&  cd  SampleProject\Haxe\HaxeStaticLib\ && haxe .\compile.hxml

4.  cd  SampleProject\Haxe\  && haxe .\compile.hxml

5. click  HaxeProject.uproject  then click ok..

what's wrong of my step?

image

haxe.Json

I've been playing with haxe.Json this evening, as it seems like a good goal due to the fact that is has more or less all the basic types. however I'm running into this error.

Module.HaxeCompatibility.cpp.obj : error LNK2001: unresolved external symbol "public: virtual class Dynamic __cdecl hx::EnumBase_obj::__GetItem(int)const " (?__GetItem@EnumBase_obj@hx@@UEBA?AVDynamic@@H@Z)

Any tips for troubleshooting this?

Unreal Enums seems to create problems

It seems that in general trying to use Unreal Enums in Haxe causes problems.

Test:

var b:EBodyCollisionResponse = EBodyCollisionResponse.BodyCollision_Enabled;
var c:EBlendableLocation = EBlendableLocation.BL_AfterTonemapping;
var e:EndPlayReason:EEndPlayReason = EEndPlayReason.Destroyed;

I get :

C:\dev\Unreal\SampleProject\Source\HaxeCompatibility\HaxeOutput\src\MyActor.cpp	36	Error (active)	E1696	cannot open source file "EBlendableLocation.h"	HaxeProject
C:\dev\Unreal\SampleProject\Source\HaxeCompatibility\HaxeOutput\src\MyActor.cpp	36	Error (active)	E1696	cannot open source file "EBodyCollisionResponse/Type.h"	HaxeProject	
C:\dev\Unreal\SampleProject\Source\HaxeCompatibility\HaxeOutput\src\MyActor.cpp	39	Error (active)	E1696	cannot open source file "EEndPlayReason/Type.h"	HaxeProject
C:\dev\Unreal\SampleProject\Source\HaxeCompatibility\HaxeOutput\src\MyActor.cpp	42	Error (active)	E0276	name followed by '::' must be a class or namespace name	HaxeProject
C:\dev\Unreal\SampleProject\Source\HaxeCompatibility\HaxeOutput\src\MyActor.cpp	88	Error (active)	E0276	name followed by '::' must be a class or namespace name	HaxeProject
C:\dev\Unreal\SampleProject\Source\HaxeCompatibility\HaxeOutput\src\MyActor.cpp	89	Error (active)	E0413	no suitable conversion function from "EEndPlayReason::Type" to "EEndPlayReason::Type" exists	HaxeProject	

Linux: -Werror,-Wreorder-ctor

I've been blocked building on Linux for the past few days with errors along the lines of:

error: field 'type' will be initialized after field 'valObject' [-Werror,-Wreorder-ctor]

I'm looking into a solution, but though I'd log the error / progress here.

The root cause seems to be that Unreal has more strict compile requirements than hxcpp.
I've been looking for a way to relax unreal's compiler requirements without changing the build process (as in my case I don't have access to this), however am yet to find a solution.

I'm temped to look at updating the hxpp-include directory to resolve the issue there, however not sure if there is the best approach.

Let me know if you have any thoughts

`A` prefix

I've just tested the latest update. seeing good improvements.
Though one issue I'm see is to do with the A prefix.. I had similar issues a while back, but they resolved..
Anyways this time I've pulled a fresh copy of the sample project and when I compile the output of the MyActor.h has
#include "AMyActor.h on line 18
image
I'm currently working around this by manually removing the A
Are you seeing the same thing?

Issues with Actor::EndPlay

The Actor::EndPlay extern seems to be missing the EEndPlayReason::Type parameter.
But adding this in manually creates more problems it seems...

This problem occurs on ActorComponent::EndPlay also.

Error (active)	E1455	member function declared with 'override' does not override a base class member	HaxeProject	E:\Epic Games\UE_5.0\Engine\Source\Runtime\CoreUObject\Public\UObject\CoreNet.h	360	
Error (active)	E1455	member function declared with 'override' does not override a base class member	HaxeProject	E:\Epic Games\UE_5.0\Engine\Source\Runtime\CoreUObject\Public\UObject\CoreNet.h	361	
Error (active)	E1455	member function declared with 'override' does not override a base class member	HaxeProject	E:\Epic Games\UE_5.0\Engine\Source\Runtime\CoreUObject\Public\UObject\CoreNet.h	362	
Error (active)	E1455	member function declared with 'override' does not override a base class member	HaxeProject	E:\Epic Games\UE_5.0\Engine\Source\Runtime\CoreUObject\Public\UObject\CoreNet.h	363	
Error	C2371	'EEndPlayReason::Type': redefinition; different basic types	HaxeProject	C:\dev\Unreal\SampleProject\Source\HaxeCompatibility\HaxeOutput\include\MyActor.h	28	
Error	C2371	'EEndPlayReason::Type': redefinition; different basic types	HaxeProject	C:\dev\Unreal\SampleProject\Source\HaxeCompatibility\HaxeOutput\include\MyActor.h	28	
Error	C1083	Cannot open include file: 'EEndPlayReason/Type.h': No such file or directory	HaxeProject	C:\dev\Unreal\SampleProject\Source\HaxeCompatibility\HaxeOutput\src\MyActor.cpp	36	
Error	C2371	'EEndPlayReason::Type': redefinition; different basic types	HaxeProject	C:\dev\Unreal\SampleProject\Source\HaxeCompatibility\HaxeOutput\include\MyActor.h	28	

Project structure

Hey, what are your thoughts on pulling the HaxeCompatibility out of the SampleProject? it kind of feels like a core of your project, so might be better suited to sit at the root at the same level as ExternGenerator, Externs and SampleProject

Extending Unreal classes

Hey do you have any advice around extending unreal objects other than Actor, eg: UBlueprintFunctionLibrary, ActorComponent or SceneComponent? I'm getting errors along the lines of:

error C2039: '__SGetClass': is not a member of 'USceneComponent'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.