Are they custom events, event dispatchers or something else?
I know what ue4 event dispatchers are. They are an implementation of the Observer (or Signal-Slot) design pattern.
But I’m confused as to what custom events are. What is their difference?
The only thing I understand about custom events is that they’re different from regular functions, they can have delays etc.
If somebody can shed some light on this very interesting topic for me I will be very grateful.
Thank you.
Thank you! You are right, I just corrected the typo, I meant “custom events”. I corrected the question (you can modify your answer as well if you want). However, you haven’t answered the main part of the question which is the difference between custom events and event dispachers (although my careless typo may be the cause of this).
Event Dispatchers. Think of these as built in dispatchers inherited from the parent class. What you’re seeing on the list are their corresponding events. Let’s say you have an actor with a component that has an event dispatcher; you can evoke these calls automatically on the owning actors without any additional binding. And you can add your own, too.
What is their difference?
The only thing I understand about event dispatchers is that they’re
different from regular functions, they
can have delays etc.
You meant Custom Events here, surely:
functions return values, custom events don’t
custom events can be replicated
custom events can use latent actions, like Timeline or Delay
What is the difference between Custom
Events and Event Dispatchers?
In the context of Event Dispatchers: Event Dispatchers send data, and Events catch it.
Custom Events however don’t really fit into a question about event dispatchers. They’re custom, you create them and they can carry any signature. For example, trying to use a Custom Event with a Dispatcher:
In order to call an object’s Custom Event you’d need that object’s reference each time. Dispatchers’ events are bound once (but you can bind and unbind, and bind more than one event) and do not require a reference after that.
I was mistaken in thinking that there’s more magic hidden inside the “custom event” construct which makes them different from the “event dispatcher event” construct, but thankfully there is none! I dug up a bit of these in the C++ source and indeed there doesn’t seem to be anything else conceptually different. Thank you.
I’ll just add one thing to clarify. One can absolutely use manually created Custom Events with an Event Dispatcher but you must ensure that the signature on the dispatcher matches the event’s one.
All the dispatcher assignment does is to create a custom event with a matching signature and correct attribute names; Automagically so to speak.
If the question was: “What is the difference between the Event from the dispatcher’s event list (the original pic in the question) and a Custom Event”:
The answer would be: It’s a shortcut. Apart from that there is no difference afaik; but you need to manually punch in a list of attributes if you’re not using automated assignment with the context sensitive blueprint wires.
That event list takes care of it all by making the events available in the owning actor and provides pertinent pins.
I have a question on the events, how did you get On Component Activated (BeaconProbe)?
I am assuming (BeaconProbe) is a reference to the event dispatcher in the blueprint. I am currently looking at code from someone else’s project and can not find a way that it is referenced.
It’s a native event, so any component can do it already.
For something more elaborate, extend a component, add an Event Dispatcher and a new Event will be available to use on the owning actor, and carry the appropriate data signature.
I guess what I am trying to figure out is the event dispatcher In one blueprint is an event in another blueprint. Right-clicking does not bring up the event nor does trying to create it off of an output delegate. Or even what this type of event dispatcher is called so I can research how it works or how to call it.
It seems that both widgets subscribe to user widget, other than that I haven’t any idea. Even in the example, I am looking at I can’t figure out how to call On Building Object Selected if I was to delete it and try and reinstate it.