That is an interesting idea - you are the first one to try this
What is the motivation of adding these functions and properties to the
SkookumScriptClassDataComponent? I assume that
- it’s functionality that you want to live in a component and
- you want to avoid creating yet another additional component for this functionality when all the actors that would use it would also need a
The errors you are seeing are likely an artifact of how UE4 is set up for the integration of script generator modules. In order for the generated bindings to work, certain UE4 header files have to be included in the generated binding code so the involved types are known. Unfortunately, many UE4 header files do not include all the sub-includes defining all their dependencies, so we had to implement some heuristic in the generator by which it decides the order in which headers are included, so that each header file happens to have all its dependencies defined in a header file that was included beforehand. Whenever you add a new class to the project, the heuristic may decide to change the include order, potentially resulting in errors like this.
The proper fix would be for Epic to make sure every single of their include files includes all its dependencies. For now though, here is how you would address this:
- Find out in which header files those missing types are defined (in this case it seems to be
Blueprint/UserWidget.h - or you could simply include all of
- Open up
SkookumScript.ini in the
Config folder of your project
- For each of the above header files, add a line to
SkookumScript.ini like this:
- Trick UnrealHeaderTool into re-running by touching (or adding a blank line) to any header file that has reflection macros in it (
UCLASS etc.), e.g.
UCoSkookumScriptClassData.h, assuming it has at least one
UPROPERTY in it.
An alternative way of addressing this could be excluding the UMG module from script generation by commenting out its entry in the
SkookumScript.ini file located in the
Config folder of the SkookumScript plugin (there is one
.ini for each the plugin and your project):
;+ScriptSupportedModules=UMG - of course, in this case, UMG functionality would no longer be available in SkookumScript.
Let me know if this works for you!