Variable not showing up in UnrealEditor

Hi Everyone,
I have a simple AUTWeaponSet class extending AUTPickup and I’m trying to get some simple variables appearing in the editor. Most of the other questions I’ve seen are concerned with the variable appearing in the blueprint, but I’m just worried about the editor. Here’s my code for my variable which should be appearing in the Test category with the name testTest:

 UCLASS(Blueprintable, Abstract)
class UNREALTOURNAMENT_API AUTWeaponSet : public AUTPickup
{
	GENERATED_UCLASS_BODY()

public:	
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)	
	int32 testTest;

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	
	// Called every frame
	virtual void Tick( float DeltaSeconds ) override;
};

If I copy and paste this code in any other class, such as AUTPickup, it shows up but it does not show up in my custom class. If you have any advice, I would greatly appreciate it.

Thanks.

Just a stab in the dark here, but the class is Abstract which could be why.

https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/Reference/Classes/Specifiers/Abstract/index.html

Ok, just another stab as I haven’t played with them, have you tried replacing the GENERATED_UCLASS_BODY() with GENERATED_BODY() and just having UCLASS() empty? It should still be visible to Blueprints from what I can tell…

I just fired up a project to test and I couldn’t get an int32 working either - you could create a function to return the value, something like this:

    UFUNCTION(BlueprintNativeEvent,BlueprintCallable,Category="Test")
int32 GetMyValue();
virtual int32 GetMyValue_Implementation();

I tried moving that abstract keyword in the class, but its still not appearing in the editor.

I get this error when trying to add those function lines in the header:

Error	1 error C2535: 'int32 AUTWeaponSet::GetMyValue_Implementation(void)' : member function already defined or declared

I also just tried removing the int32 and started using an enumeration just to test out another type:

UENUM()
enum EWeaponSet
{
	Set_1,
	Set_2,
	Set_3,
	Set_4,
	Set_5,
	Set_6,
};
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Pickup)
	TEnumAsByte<EWeaponSet> WeaponSet;

Still no luck in the editor.

Which version of UE are you using, for older versions you won’t need the “int32 AUTWeaponSet::GetMyValue_Implementation(void)” line in your header, later versions remove the auto declaration of it.

I’m using 4.7.2. I removed the int32 getmyvalue_implementation and I still get

Error	1	error LNK2001: unresolved external symbol "public: virtual int __cdecl AUTWeaponSet::GetMyValue_Implementation(void)" (?GetMyValue_Implementation@AUTWeaponSet@@UEAAHXZ)	C:\Work\UnrealTournament\Engine\Intermediate\ProjectFiles\UTWeaponSet.cpp.obj	UnrealTournament

umm, yeah you also need to implement the method in your cpp file, for instance:

int32 AUTWeaponSet::GetMyValue_Implementation() {
return 42;
}

Ah yeah, sorry. I tried that earlier, but I was getting an error due to the auto-generation. You were right, the second line was not needed. I have that function in my header file and the implementation in the .cpp and its still not showing up! :frowning:

Anyone else have any suggestions? I would love to really get started on development, but this simple issue is causing me massive headaches and roadblocks.

I know for a fact the class is being recognized, it just won’t affect the layout of the editor.

Hey Rolfeh-

It appears that your variable should appear in the editor properly. Are you working in the UnrealTournament editor or the Unreal Engine editor?

Cheers

Doug Wilson

Hi Doug,
I think I’m working in the Unreal Engine Editor. I’m using …\UnrealTournament\Engine\Binaries\Win64\UE4Editor. Please correct me if I’m wrong. :slight_smile:

Hi Rolfeh,

Can you list the steps you are taking to add this specific code to your project?

Hi Adam,
Here are the steps I took:

  1. Downloaded and built Unreal Tournament 4 code base

  2. Opened the UE4Editor.exe, clicked on a random weapon base, clicked add C++ component

  3. Clicked New Actor Component

  4. Named it UTWeaponSet for the .h and .cpp files

  5. Went to the UTWeaponSet.h and made my AUTWeaponSet class inherit AUTPickup (I think I need this because I’m making a weapon set class that can store user specified guns)

  6. As a test to see if my future changes affected the editor, I made a simple UProperty int

  7. Built UnrealTournament project, editor recompiled, and changes did not appear in editor. Note that if I put that variable into any other class such as UTPickup, it shows up

    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
    int32 testTest;

Did you download the Unreal Tournament branch from Github or did you pull it from the Unreal Engine Launcher?

Unreal tournament branch in github.

Any luck recreating it?

Hey Rolfeh-

Sorry for the delayed response. Following the steps you provided I selected a weapon base and used the AddComponent button to create an Actor Component class. When this class opened in Visual Studio I added the UPROPERTY() variable to the header file and compiled again. Back in the editor I added the new component to the weapon base and the variable was present.

This was using the release branch for Unreal Tournament (https://github.com/EpicGames/UnrealTournament/tree/release) that was updated within the last day. Let me know if there was something that I did differently from your setup or if you’re still having the same issue with the latest version of the source code from GitHub.

Cheers

Doug Wilson