> For the complete documentation index, see [llms.txt](https://mars-15.gitbook.io/dispatchito/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mars-15.gitbook.io/dispatchito/getting-started/quickstart.md).

# Quickstart

For a basic scenario we need two objects: one expecting an event to happen - we call it Subscriber, other being an originator of this event - we call it Sender.

### Subscriber

1. Inside a class expecting an event, right-click anywhere on the event graph and search for Dispatchito Subsystem:

<figure><img src="https://1181272575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfQy1REqz5GdSLZ1Mbpoo%2Fuploads%2FQ09Dz8qBONHAsf8y96me%2Fimage.png?alt=media&amp;token=2f43d32a-7535-44af-b89d-80838a6da636" alt=""><figcaption></figcaption></figure>

2. Drag a pin off of the given label and search for SubscribeToTopic function:

<figure><img src="https://1181272575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfQy1REqz5GdSLZ1Mbpoo%2Fuploads%2FC7BQ8jaTXeTUJGKc28o3%2Fimage.png?alt=media&amp;token=1d409d53-5a03-46de-8c8f-e76ca20d6a8a" alt=""><figcaption></figcaption></figure>

3. Press the dropdown for the Topic parameter and select desired tag for the topic of this event:

<figure><img src="https://1181272575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfQy1REqz5GdSLZ1Mbpoo%2Fuploads%2FtgVIkf8RXYOgmGWhhVZP%2Fimage.png?alt=media&amp;token=cff2fd5b-08ec-4084-a99b-8a9708189e61" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Learn about Gameplay Tags from official [documentation](https://dev.epicgames.com/documentation/en-us/unreal-engine/using-gameplay-tags-in-unreal-engine).
{% endhint %}

4. Drag from the Callback parameter and search for Add Custom Event:

<figure><img src="https://1181272575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfQy1REqz5GdSLZ1Mbpoo%2Fuploads%2FPwpVpjCUTcGd1VTekkHE%2Fimage.png?alt=media&amp;token=aa70d06c-10a6-467e-8719-308f8dc36707" alt=""><figcaption></figcaption></figure>

5. Name your event handler and add logic you want to be executed when the event is sent through Dispatchito:

<figure><img src="https://1181272575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfQy1REqz5GdSLZ1Mbpoo%2Fuploads%2F19NEW1RXxgxSGTFzbpGf%2Fimage.png?alt=media&amp;token=5cf2da22-e3aa-4906-a31d-a4665c68efec" alt=""><figcaption></figcaption></figure>

We are done here. Let's now set up the sender of the event.

### Sender

1. Inside a class sending an event, right-click anywhere on the event graph and search for Dispatchito Subsystem:

<figure><img src="https://1181272575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfQy1REqz5GdSLZ1Mbpoo%2Fuploads%2FQ09Dz8qBONHAsf8y96me%2Fimage.png?alt=media&amp;token=2f43d32a-7535-44af-b89d-80838a6da636" alt=""><figcaption></figcaption></figure>

2. Drag a pin off of the given label and search for DispatchEvent function:

<figure><img src="https://1181272575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfQy1REqz5GdSLZ1Mbpoo%2Fuploads%2FpB9d3KjAKzDrgYP1d7Su%2Fimage.png?alt=media&amp;token=56484080-602a-405d-bb1a-70cb934ada84" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
In this case we are using Dispatchito subsystem directly, so make sure to select function variant that's not under Utilities group. Utilities provide 1:1 wrappers for functions that allow to skip using label of the subsystem. Always make sure to use proper variant.
{% endhint %}

3. Press the dropdown for the Topic parameter and select desired tag for the topic of this event:

<figure><img src="https://1181272575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfQy1REqz5GdSLZ1Mbpoo%2Fuploads%2F5pbyAyPIMCYVLOAN8ULw%2Fimage.png?alt=media&amp;token=39608bd8-20e9-4c65-bd44-8d197cf7eee3" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
Make sure to select the same topic as the subscriber.
{% endhint %}

That's all we need for this simple scenario.

### Execution

Connect nodes to paths of execution in your code. E.g:

1. Subscribe in the actor's BeginPlay function:

<figure><img src="https://1181272575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfQy1REqz5GdSLZ1Mbpoo%2Fuploads%2FbhJMc7Iz25opbH1roSV7%2Fimage.png?alt=media&amp;token=eef9db63-9521-4b78-980a-17a1397791f4" alt=""><figcaption></figcaption></figure>

2. Call DispatchEvent on a key pressed from a PlayerController:

<figure><img src="https://1181272575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfQy1REqz5GdSLZ1Mbpoo%2Fuploads%2FJiYND5mcbTsfX2cAXpJd%2Fimage.png?alt=media&amp;token=549a3f09-b00e-4fbc-82b5-262cc65ffa3e" alt=""><figcaption></figcaption></figure>

3. Start PIE, press the bound button and watch the magic unfold:

<figure><img src="https://1181272575-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfQy1REqz5GdSLZ1Mbpoo%2Fuploads%2FqYsvAjGsz2zWu8PEqC0A%2Fimage.png?alt=media&amp;token=aae5ca27-86e6-41dd-9fae-4d5a55bba903" alt=""><figcaption></figcaption></figure>
