I’m making a GameplayEvents plugin that has a better dev experience than UE’s native events, using GameplayTags.
Is there a way to change the type of a function parameter based on the value of another parameter like in this concept?
I think what you are looking for is a concept called function overloading where we write two same functions with different parameters and the appropriate ones gets called according to the passed parameter
E.g
void func(){}
void func(int x){}
Then if we write
func(); the first method is called
func(1); then the second method is called
This is a plugin, so there’s no way for me to know what the user-defined types will be. What I want to do here is like “generative” overloading. For example, the user can define a gameplay tag “event.damage” and can specify a Struct to go with that event. I want this Publish function to set the type of the Payload parameter based on the value of the Gameplay Tag parameter.