I recently had the thought of the difference between a macro and a function.
For me they are most likely the same. They both can have input and output, both should be used multiply times,…
So what is the difference? When am i better running a macro and when a function? What is your experience with that?
Btw i’m working on a single player project. Maybe they have more meaning in Multiplayer.
As far as i know, you can’t call macros from outside. If you have logic that should be callable from outside (others actors etc) you will want to
use Functions/Events (Events have no Return). I only use macros to make my graph smaller.
For example if i need to compare an Enum, i don’t want to have multiple “Equal” and “Branch” nodes in my graph, i just make a macro out of them.
Like eXi mentioned, you can’t call macros from outside of it’s respective blueprint. One of the advantages of macros is that they can have latent functions (delays, etc…), while a function cannot. A macro can also take advantage of wildcard variables, and multiple execution pins, while a function cannot. Each has it’s own use, and you will likely find yourself using both of them. Personally I like using macros for all of my math/calculation nodes, or for doing special things like dynamically executing an event.
Also, if you have some math that you have to keep doing over throughout your graph, you’ll probably benefit slightly more by using a pure function. You just can’t put anything that would cause a change in anything. So no calling anything that needs an execution pin in it, just things like < > == × \ + - or anything else without an exec pin.