Cannot create BlueprintImplementableEvent with args in UUserWidget

Version UE4.18.2.

Issue: Cannot create BlueprintImplementableEvent with args in UUserWidget. BlueprintImplementableEvent works fine when args are removed.

Reproduction:

  1. Create a new C++ project.
  2. Create a new ‘MyUserWidget’ class below
  3. In the .cpp file, just include the header.
  4. Attempt to compile, fails
  5. Remove FString MyKey argument.
  6. Re-attempt compile, success.

Expected Result: Compiles fine in step 4.

Note: May also be an issue with BlueprintNativeEvent


MyUserWidget.h

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "Runtime/UMG/Public/Components/VerticalBox.h"
#include "MyUserWidget.generated.h"


/**
 * 
 */
UCLASS(Blueprintable)
class MYPROJECT_API UMyUserWidget : public UUserWidget
{
	GENERATED_BODY()

public:

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (BindWidget))
	UVerticalBox* VBox;

	UFUNCTION(BlueprintImplementableEvent)
	void BUSTER_WOLF(FString MyKey);
	
};

MyUserWidget.cpp

// Fill out your copyright notice in the Description page of Project Settings.

#include "MyUserWidget.h"

Try changing BUSTER_WOLF to more conventional name BusterWolf, or is it some macro?

The name doesn’t change anything. This is just a stub a made to test. The actual thing had the same results and used normal UE4 UpperCamelCase naming conventions.

In general I don’t think function names have restrictions in UE4 right? Also per the original question, only those two files are needed to reproduce the bug. So I don’t have any macros elsewhere.

I don’t think Events can take input arguments. Doing the same with a function, instead of an event, with UFunction(BlueprintCallable) works fine. Needs implementation in the ,cpp file as well.

What are you looking to do, exactly?

that’s not correct. events can take inputs. they don’t have outputs instead.

The problem is that BlueprintImplementableEvent is going to be used in BP (surprise!)

And BP don’t support FString. they support “const FString&”

This should work :]

void BUSTER_WOLF(const FString& MyKey);

p.s. BUSTER_WOLF still looks ugly af though, so karma might start disliking you

I stand corrected, you’re absolutely correct. Should’ve been obvious but I was somehow stuck in thinking in terms of BP and not remembering an input variable pin on any of the standard events, of course the event nodes themselves can have variables coming out of them.

This probably also explains the use of const FString& instead of just FString