Event Dispatchers - I thought I knew how they worked

Yes, I thought so as well, and since you were of the same opinion I wiped all and redid and got it to work. TL;DR

  • Was binding dispatchers before object was available to bind to;
  • had binding setup incorrectly - I was calling the ED_Dispatcher from a different object through the object that had the dispatcher. I changed this so that the Object would first call a custom event on the object that has the event dispatcher, then that custom event calls the event dispatcher on itself (I have not confirmed this is required?)

This is my setup now:
WBP_Multiplayer = Base Class for all Mulitplayer UI Widgets
HUD_UI_MP → Handles Communication between game instance and UI MP Widgets
GI_Multiplayer → Handles Multiplayer Events

HUD_UI_MP creates the Sessions Widget, so it Holds and Sets its reference to the WBP_Sessions widget, all other widgets can access the HUD via player controllers. Therefore, any WBP_Multiplayer widget is able to call events from HUD, and HUD then calls events on Parent Widget, and Parent Widget calls Event Dispatcher for all other widgets to execute event.


It is also possible to call the Event Dispatcher Directly from the Blueprint that has it, such as this

WBP_Multiplayer Binds the Class Event to the Event Dispatcher (During CONSTRUCT, so that all child widgets will be initialized when parent widget calls construct (ChildWidgets fire events first before parent, parent comes last)

WBP_Sessions is a Child of WBP_Multiplayer; Contains all UI elements for Multiplayer Sessions (Logins, Errors, Host, Find Sessiosn ect.) and has the Event Dispatchers. Event Init Login is from the Parent Class and calls parent

All the widget elements in WBP_Sessions, derive from WBP_Multiplayer, and are able to run the event when called from event dispatcher



Hope this helps someone, this makes things sooooooooo much easire for updating the Sessions Widget depending on the situation, as I can just call dispatcher for tat situation, and each widget handles it as needed. Huge time saver!

1 Like