How do I set up global macros to be used in multiple blueprint graphs?

I have a problem where I’ve created some macros to solve it (can’t use functions due to the need for multiple input and output exec pins), and am trying to put them in a macro library to be able to use them in more than one blueprint graph.

However, I can’t seem to load the macros from the macro library in the Content/Blueprints folder without losing the ability to save my blueprint actor class. I keep getting the error, “Graph is linked to private object(s) in an external package.”

How can I resolve this so that I can reuse the same macros across several blueprint actor class graphs?

Sometimes ‘refresh all nodes’ helps…

Oh, how I wish it were that simple. But alas, I’ve tried that, as well as adding the library with a couple macros in it in a few different locations under the content folder. Still no such luck.

Bizarre…

As it turns out, there were several problems I was running into.

For one, the blueprint graph search seems to be unfriendly when it comes to certain “special characters” in macro/function names (in my case, an underscore was the culprit).

Secondly, it seems that the blueprint library does need to be within the same content folder as your other/current project files.

Third (and this was the big issue causing the errors I was seeing), while it seems to work to copy nodes from a macro graph in a blueprint actor class into a new macro in a blueprint library, copying a macro itself from another location and pasting it into a blueprint library is apparently a big “no no”. Rather than the editor creating copies of the various nodes used into the pasted macro within the library, it reuses the same code (including IDs) for the nodes as are used in the original location.

Furthermore, even after I deleted the original macro from the blueprint actor, the copy pasted into the library still wouldn’t work. And you’ll also notice that “broken” macros created this way seem to be listed under “default” in the graph editor “create node menu”, whereas good/valid macros seem to show up under “utilities.”

Lastly, I’ve found that setting up a game instance blueprint class (and selecting it as your game instance class under Project Settings > Maps & Modes) is the ideal way to ensure that not only functions and macros will be available to use throughout the project in other blueprint classes, but also global variables that will persist as long as the game is running (i.e. even between level loads). I created one under Content/Blueprints, and it has been working great as a central/global library.

1 Like