The steps to write your first event

Create Event Assets

To create your own events all you need to do is to right-click inside your content browser and go to OutOfTheBox->ESEvent. You will then prompted to give the event a name and then you can save it.

Inside the event asset you will find a handful of useful debugging tools (which we will look at later on) including a description field which should contain accurate information about how and when the specific event should be used.

Create Event Listeners

A Listener is a component that's going to be notified when a certain event happens (is invoked). He will then execute a delegated function to allow you the implement it.

To add a listener all you have to do is to add an ESListener Component for AActors or ESListener Widget for UUserWidgets.

You can add as many listeners as you like on every Object and also you can rename it to better suit it's desired use.

Implement Listener Delegates

Next up, when you select the Listener you will see multiple options, but for now we will only focus on 2 of them:

  1. Event to listen - you will be notified when this event is invoked
  2. On Event Invoked - the flow executed when the event is invoked

All you need to do is to select the event from the drop-down and press on the + next to the OnEventInvoked delegate.

Now this will open a new delegate for you to implement where you can add your logic. Keep in mind, this code will be executed each time the event is invoked and only when the event is invoked.