Download

Invoking Unreal Header Tool

Hello,

I’m trying to create a new property for the details module for all actors in the scene so I created a new UPROPERTY() in AActor which worked. But, I want the property to be a dynamic list of a class that I made, so I tried to find an example of what I was looking for and I found out that other properties use some sort of asset picker and the code looks something like:


UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Whatever)
TSubclassOf<class USomething> LabelOfProperty;

I realized that I needed to make couple of changes to the class I made where it needed to derive from UObject, and I need to use the UCLASS and ENGINE_API Macros for it to be recoginzed by TSubclassOf. So then I read needed to have “FileName.generated.h” included in my class header to used UCLASS, but it seems like I need to invoke the “Unreal Header Tool” which is normally invoked when making new classes while the engine is running, is there a way for me to use it on my class header?

Also I don’t know what the requirements are to use the ENGINE_API, using “Go to definition” in Visual Studios doesn’t get me anything.

Another issue I am having is that whenever I try to include my file to “Actor.h”, “Pawn.h” is apparently having issues with it saying that I am calling pawn.h more than once and #pragma once isn’t present (which it is). If anyone has any idea why this is happenning I would greatly apreciate the insight.

P.S. The way I think that TSubclassOf works in the context of making properties(please correct me if I’m wrong) is that it look for any instances of the class inputed into the TSubclassOf template and will create new items for it in the asset view.
P.S.2 I am wondering how to create a property that would affect all actors in the scene from a different ffile, to potentially avoid the errors I have had trying to include my class header.

Thanks for any help!

TL;DR
Should I be using TSubclassOf to make a new property to create a dynamically?
If so:

  1. What requirements are there for using the ENGINE_API macro on a class?
  2. How do I use the Unreal Header Tool on a class I made in the source code?
  3. Including new files to Actor.h causes errors in Pawn.h saying that I am including pawn.h more than once, why?