Download

static / global BlueprintImplementableEvent method?

Is it possible to make a static BlueprintImplementableEvent method that can be invoked from any Blueprint?

We have a plugin that we want any Blueprint to ask if its finished initializing.
Example:


UCLASS(ClassGroup = VRstudios, BlueprintType, Blueprintable, meta = (ShortTooltip = "VRstudios settings"))
class VRSTUDIOSSYSTEM_API UVRstudiosSettings : public UObject
{
	GENERATED_BODY()

private:
	UVRstudiosSettings();

public:
	UFUNCTION(BlueprintImplementableEvent, Category="VRstudios")
	static void IsInitializedEvent();// <<< "static" isn't allowed here. (Why not?)
};

I think BlueprintImplementableEvent only works for dynamic functions. But it would be nice to have a solution… I have basically the same problem.

You are essentially trying to create global state, generally a bad idea, but it can save time when prototyping.

Generally when global state looks attractive, its best to review what your actual goal is.

In your case it sounds like its a initialization order problem. This would suggest that you should be looking at how you initialize your level.

If you move the initialization of this object into the initialization of the level you can insure the instance exists before anything else that needs it gets created. If the instance can’t be created you can log / display debug info before other objects fail.

Regarding to BlueprintImplementableEvent, you might use Interfaces, but if you want trigger an execution order you could pass an public integer and check the numeric order before call Super::BeginPlay(); inside the override, additionally one guy develop a plugin to do that: https://forums.unrealengine.com/showthread.php?128648-Begin-Play-Execution-Order

Cheers

Implementable won’t work that way, I would make a broadcast and then any blueprint interested should subscribe to receive the “global” event.