How to make a blueprint function that have two output pin with cpp

how i can make an exposed cpp function (function that have a UFUNCTION macro on it) to have two output exec pin?? i already try to use LatentInfo (so the function have an “after fired” output pin. but what i also need output pin that always fired, when the function is still in processed). anyone can help me??? (the function is like timeline function on blueprint)

1 Like

As you said, to create blueprint available functions, you can use UFUNCTION macro, but I’m not sure if this function can have multiple exec output pins.

The other way is to override UK2Node class. Implementation of those types could be useful:

Select node → K2Node_Switch.h

If node → K2Node_IfThenElse.h

It’s more a hint than the real answer.

Hope it helps,

You don’t have to derive your class from K2Node. The point is to create new class that derives from K2Node. This new class will extend the editor. Then, new node will be available (see example: K2Node_Switch class that implements Select node in blueprint graph).
Your new node can have input pin of your gameplay class type, and multiple exec outputs. Anyway, this is complicated C++ solution.

Maybe it would be easier if you create blueprint Macro. As far as I know editor allows Macros having multiple exec outputs.

hemm. that’s interesting. but what i want is just some function in my object. (because at first i derive my class from UObject). if i derive my class from K2Node is it have a same behaviour as an UObject?? ( i mean, can i build a blueprint with that class?? and also have multi output exec function for that blueprint (function in the eventgraph)??

yeah, i think this is the only possible solution. thx for the information. :slight_smile:

I think you are looking for something like this:

UFUNCTION(BlueprintCallable, Category = "DataTable", meta = (ExpandEnumAsExecs="OutResult", DataTablePin="CurveTable"))
static void EvaluateCurveTableRow(UCurveTable* CurveTable, FName RowName, float InXY, TEnumAsByte<EEvaluateCurveTableResult::Type>& OutResult, float& OutXY);

The important part is the meta-tag called “ExpandEnumAsExecs”. It creates one execution pin per enum value.

Marc

I can confirm Marc answer, I did it on my own project using the ExpandEnumAsExecs meta tag.

yeah, i just got it, i already now the meta ExpandEnumAsExecs (but at first i think it just can expand the input exec) - as in the kismet library. dang. why i don’t put the reference mark before. jejeje. it’s really help thx a lot!!!

Can I expand Struct As Execs?