Download

Custom structs and enums in Niagara

After creating some Enums and Custom structs (where some of members in those structs are of types of those enums) in editor, I assigned them in Edit->Project options->plugins->Niagara to be visible in Niagara. After recompiling everything was fine. Both structs and enums were visible inside Niagara and I can freely used them. But after whole editor restarting, editor crashes instantly. After debugging, it looks that order of loading those types is wrong. Editor tries to load structs at first place (and it doesn’t know about those Enum definitions at that time and crashes). Huge bug. After manually change those members in structs to be just integers, editor started normally. After that I created User parameter in Niagara of type of that struct. And it works fine in Niagara but problem is when some of that fields in user parameter has to be referenced by blueprint. Inside editor, those structs are exposed as overrides and all members can be setup. Problem is runtime. Setting of Niagara variable is strictly typed (every supported type has its own function) so passing whole struct as user parameter is not possible (that should be fixed… if struct members are all of supported types what is the problem to iterate over them and set them all?) But I also didn’t find a way to reference those variables separately. Usually user parameter of type lets say int is set up by calling function SetNiagaraVariable(int) where for variable name you define string like User.MyInt if MyInt is name of your user parameter. But if MyInt is member of MyStruct and whole struct is set as user parameter I didnt find a way to reference it. Tried with User.MyStruct.MyInt but at runtime nothing happens. Tried with User.MyInt and with MyStruct.MyInt but nothing worked. Is it a bug or am I missing something?

Thanks in advance