proletariatgames / UnrealHxGenerator

Automatically generate externs from UHT definitions
MIT License
20 stars 8 forks source link

Generate UE 5.0.2 Externs #4

Open peteshand opened 2 years ago

peteshand commented 2 years ago

Hey there

I'm trying to run this with UE5.0.2, however I haven't been able to get it to work.. What should trigger extern generation?...

After completing the below steps should it simply be a case of starting a project with the UnrealHxGenerator plugin enabled (along with EXTERN_OUTPUT_DIR and GENERATE_EXTERNS set) and the externs will be generated?

For me after starting the project nothing is generated, so I'm wondering if maybe the hook that triggers extern generation isn't working as expected?

/////////////////////////////////////////////////////////

Unreal.hx Extern Generator

This project takes UHT reflection information and generates Haxe extern definitions from it. You don't need to use this in order to benefit from the externs; They are for now included in the main project

Installation (4.11 and above)

This plugin should be installed in your engine Plugins directory. (e.g. Plugins/UnrealHxGenerator) Once this is achieved, add the plugin to your project, either through the editor or by inserting the following into your .uproject file:

  "Plugins": [{
      "Name": "UnrealHxGenerator",
      "Enabled": true
    }]

Set the EXTERN_OUTPUT_DIR environment variable to the location you wish to output the generated files to, and set the GENERATE_EXTERNS environment variable to 1

For downloaded engines

If you haven't built the engine yourself, you will need to build the plugin using UAT. To do that, do the following:

cd [UE-Install-Dir]
.\Engine\Build\BatchFiles\RunUAT.bat BuildPlugin -Plugin=[/path/to/UnrealHxGenerator.uplugin] -Package=[TemporaryOutputDirectory]

Once it is built, copy TemporaryOutputDirectory to your [UE-Install-Dir]/Engine/Plugins/UnrealHxGenerator

/////////////////////////////////////////////////////////

What is the next step? start the project?

On a side note I have a fork that addresses some compatibility issues with new engine versions: https://github.com/proletariatgames/UnrealHxGenerator/compare/development...spacemonster-interactive:development

peteshand commented 2 years ago

with the project open, if I hit the recompile button I getting: ERROR: Expecting to find a type to be declared in a module rules named 'UnrealHxGenerator' in UE5Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null. This type must derive from the 'ModuleRules' type defined by Unreal Build Tool. Build failed.