USE A LOCAL FUNCTION IN ESTERNAL BPS?

Ok, I found the issue about the missing refs, but the self ref is still not working properly.
Now the number of refs they keep is correct but they keep a self ref for each one, so 1 correct ref is lost for every bp that received it. I don’t understand why

1 Like

What message do you see when you mouse over the Self warning?

1 Like

@ClockworkOcean
this one

1 Like

Ahhh… I do get the error

You can’t have Self in a library function, basically.

But you can do this with a macro, so macro library it is… :slight_smile:

1 Like

so…my friend…that time has finally come..hasn’t it?

1 Like

Because you don’t like macros?

1 Like

no no, It was to laugh a bit. :rofl: Because I guess I’ll have to delete everything and redo it. Never done a macro before, I don’t know anything about it. Should I be worried?

1 Like

It feels very like making a function, but the code actually gets compiled into your blueprint graphs, whereas a function is actually a separate object.

1 Like

I just thought of a way to bypass the self ref in the function, but I still want to try with the macro, also because what I thought is not very elegant perhaps. Anyway, thanks a lot for the help sir!

1 Like

:star_struck: :+1:

1 Like

good morning @ClockworkOcean

I’m noticing that macro has not exe pins in input/output
Is that normal?
I manually entered the exe pins but now even though I recreate the macro variables in the bp, I have an error on them, and it also says that self is not valid

It’s one of the variable types

Self has to work, because a macro is literally just copied into your code on complile

To make the correct variable type, use a pin drag

mac

1 Like

While waiting for your answer, I solved it by keeping the function library, adding the ref as input, so now I will pass it between the bpi call and the function library call, so I have no errors of any kind. Now everything works, anyway, thank you very much! Maybe I need more time for the macros, to understand all the differences between macros and functions and exploit their potential to the fullest.

1 Like

Yes, that was also an option :slight_smile:

Generally, functions are better than macros. But it really depends on the situation.

1 Like

I tried to make a very stupid macro because with the function I couldn’t manage the output with exes, at least I limit useless duplications of logic as much as possible

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.