Exposing non dynamic delegates to Blueprints?

Hey, does anyone know a clean solution to exposing non dynamic delegates to blueprints? By exposing, I mean that binding a blueprint function to it somehow.

// These are non dynamic delegates, meaning they can't be exposed to BP.
// Sure I could just turn them into dynamic delegates, but this whole class is native and
// I want to handle Blueprints as a separate "layer".
_
DECLARE_EVENT(USteamMatchmakingPolicy, FOnStartSteamMatchmakingComplete);
FOnStartSteamMatchmakingComplete StartSteamMatchmakingComplete;
_
DECLARE_EVENT_TwoParams(USteamMatchmakingPolicy, FOnSteamMatchmakingComplete, const FName /** SessionName */, const ESteamMatchmakingCompleteResult /** Result */);
FOnSteamMatchmakingComplete SteamMatchmakingComplete;
_
DECLARE_EVENT(USteamMatchmakingPolicy, FOnCancelSteamMatchmakingComplete);
FOnCancelSteamMatchmakingComplete CancelSteamMatchmakingComplete;
_
DECLARE_EVENT_TwoParams(USteamMatchmakingPolicy, FOnSteamMatchmakingStateChanged, const ESteamMatchmakingState /** OldState */, const ESteamMatchmakingState /** NewState */);
FOnSteamMatchmakingStateChanged SteamMatchmakingStateChanged;

Right now, I have dynamic variants of these delegates in a different source file and I’m calling them when the native delegates are fired. That works as well, I’m just looking for a better solution.

If you use them as UFunction param, they will be displayed as callback pins on nodes.
(red square input pin)

That’s the only use I ever found for them.

I’m pretty sure that’s not possible. If you want a delegate that is exposed to blueprint, it has to be dynamic.

The non-dynamic delegates work through either template trickery or function pointers. A blueprint has the ability to bind to functions that can’t be compatible be with either. Any purely blueprint function doesn’t really have a unique C++ entry point. It’s really just a name and some sort of lookup used by the Blueprint VM.

Of course, I could be wrong. But I’m not really sure how it could work.

Very interesting question. Some time last year I would have liked to do this as well. Unfortunately came to the same conclusion as @MagForceSeven. My experiements either failed during serialization (not really resonable to serialize a delegate created with FOnSteamMatchmakingStateChanged::CreateLambda for example), creating/editing the binding in the property editor or the instancing for delegates bound in the C++ constructor.

The UFUNCTION macro or the UFunction type? Can you give a quick example because I’m not really sure what you mean.