How to use organise blueprint inputs and outputs in c++ using templates?

More of a theoretical question, as the official functions made by Epic, seem to use the unstructured approach:

I have a function library, and one function takes in quite many values. Instead of writing them out as const references in one enormous line, I’d rather make some kind of template or struct that would organize them, but still show them as separate input pins in the blueprint editor. Something like

struct FunctionData {
  struct Inputs {
    APawn* TargetPawn;
    float SomeValue
    //and so on
  struct Outputs {
    float ChangedValue;
    FVector SomePawnVector

And then in function declaration i’d do something like

UFUNCTION(BlueprintPure, Category=Chemistry)
static void ILikeTurtles(const FunctionData::Inputs&, FunctionData::Outputs&)

And it would take FunctionData::Inputs and break it up into separate pins, and the same with FunctionData::Output.

I don’t even know if it makes sense from a C++ standpoint, as you can probably tell I am new to this, however if there is a way to organize inputs and outputs of blueprint function in a similar way, I would like to know.

Hello, Megakoresh

To learn about receiving a Struct in a Blueprint function, please go here:

[Tutorial] How to accept wildcard structs in your UFUNCTIONs - Community & Industry Discussion - Unreal Engine Forums,

Please also note that there some specifics regarding creating Structs in Unreal Engine 4. If you like to learn more about them, please go here:

Hope this helped!

Good luck!

Many thanks.