Function vs Custom Event

What is the difference between blueprint function and custom event?

  1. Function can return value(s). Event cannot have any output.
  2. Event can use Delay node or timelines.
  3. Function can use local variables(s).
6 Likes

Delay nodes and timelines, I see. Thank you.

Also, Events can be replicated, functions cannot.

2 Likes

Exactly right. Also an event graph can have multiple entry points (Event nodes) and execution flow that merges together, but a Function can have only one entry.

I realize that this thread is quite old, but as it was the first result shown by my search engine, I figured this thread is still relevant, so please forgive me for reviving it

May I ask in what way they merge together? How do we predict that?
And when saying “events can be replicated”, does that mean that when an event is called at one client, calling it on other clients is automatically handled if replication is on?

Not so much “merge together” as you are thinking, just that they are usually related.

“Tree”, “Branch”, “Leaf”, “Root” - You would likely think these would all go together to form some sort of plant, but it all depends on your definition of those 4 things.

“Tree” could signify a type of plant, but it could also be representing a skill tree or a line of lineage.
“Branch” could be taken to mean if something is True or False, but it could also mean the limbs of something to join one piece to another.
“Leaf” could be known as an object that helps convert sunlight into energy, however it could also be a type of car, like an “Accord” or a “Model X”.
“Root” could be the basis, the foundation of something, or it could just mean to “root” for your favorite team.

Depending on your definition of the terms you use in your programming, you could have all four of those become one Event that fires off that branch of the particular node tree you have created. The root of which is the Event node that calls it. I shall leave it at that…

Excuse me xD?
I just wanted to know how multiple entry points are handled (I assume, that they are kind of executed subsequently) or whether they are executed in parallel (is that what merged together mean?)
I am not sure if my question was answered. I kind of fail to see it.

“Merge” only means that you can connect the execution flow of one event to that of another, as they all share one graph. A good example is timelines. You can connect one event to start and another to stop. Similar setups is not possible with functions, the entire graph got one single start point.

I am not well versed in networking, but as far as I know you are correct on the replication bit.

I *think *all he means is that in a single event graph, you can have many event nodes (entry points) that all connect to the same place - their ‘Execute’ pins are all wired to the input flow of one blueprint node. That way several events can be handled the same way without duplicating chains of nodes.

1 Like

I know this is old but topics never die.
Are events something like events in javascript like “click” etc? So something can trigger an event somewhere in the script/code?

I think so. That’s how I’ve been treating events at any rate, just like a JavaScript “onclick”.