# How can I make a custom listenable?

**URL:** <https://forums.unrealengine.com/t/how-can-i-make-a-custom-listenable/1305603>\
**Category:** Programming & Scripting\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, fortnite\
**Created:** [September 20, 2023, 10:10pm UTC](https://forums.unrealengine.com/t/how-can-i-make-a-custom-listenable/1305603 "2023-09-20T22:10:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lootheo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lootheo/32/720722_2.png) [@lootheo](https://forums.unrealengine.com/u/lootheo)\
**Post date:** [September 20, 2023, 10:10pm UTC](https://forums.unrealengine.com/t/how-can-i-make-a-custom-listenable/1305603/1 "2023-09-20T22:10:20Z")

</div>

Some people mentioned there might be a way to create my own listenables and i wanted to know if there was a way i didnt know about.

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [September 20, 2023, 10:26pm UTC](https://forums.unrealengine.com/t/how-can-i-make-a-custom-listenable/1305603/2 "2023-09-20T22:26:58Z")

</div>

Hey, so I’ve made this script which I’ve been using for a month and it doesn’t seem to fail me, maybe you can try it 🤷

> [@How do you implement your own listenable in Verse?](https://forums.unrealengine.com/t/how-do-you-implement-your-own-listenable-in-verse/832267/8):
>
> I might have found a better way custom\_cancelable\<public\> := class: var Canceled : logic = false CancelEvent : event() = event(){} Cancel():void= set Canceled = true CancelEvent.Signal() custom\_subscribable\<public\>(t:type)\<computes\> := class\<public\>(awaitable(t)): InnerEvent : event(t) = event(t){} Subscribe(Callback:type {\_\_(:t):void}):custom\_cancelable= Cancelable := custom\_cancelable{} spawn{\_WaitForEvent(Callback, Cancelable)} …

---

<div class="post-metadata">

**Author:** ![TheCreaitor](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/thecreaitor/32/1100960_2.png) [@TheCreaitor](https://forums.unrealengine.com/u/TheCreaitor)\
**Post date:** [September 28, 2023, 9:29pm UTC](https://forums.unrealengine.com/t/how-can-i-make-a-custom-listenable/1305603/3 "2023-09-28T21:29:04Z")

</div>

> [@How do you implement your own listenable in Verse?](https://forums.unrealengine.com/t/how-do-you-implement-your-own-listenable-in-verse/832267/8):
>
> `<computes>`

Tried to use something similar to this code, it works fine when everthing is in one script but once I attempt to use my subscribable class it start throwing “Can’t access a function from a preceding type” errors.

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [September 28, 2023, 10:07pm UTC](https://forums.unrealengine.com/t/how-can-i-make-a-custom-listenable/1305603/4 "2023-09-28T22:07:23Z")

</div>

Yep I actually posted an issue about this but it didn’t got any attention, I don’t understand how I didn’t get any upvotes, looks like a major issue to me 🤷

> [@Parametric classes not usable outside of own file](https://forums.unrealengine.com/t/parametric-classes-not-usable-outside-of-own-file/1285253):
>
> Please select what you are reporting on: Verse What Type of Bug are you experiencing? Verse Summary Parametric classes not usable outside of own file Steps to Reproduce Make a parametric class, reference it outside the file Expected Result No errors, the class should be called outside the file (it’s not in a module, and even when inside a module, the same error occurs) Observed Result Can’t access a function from a preceding type. (3502) Error only raises once we make a reference to that c…

---

<div class="post-metadata">

**Author:** ![TheCreaitor](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/thecreaitor/32/1100960_2.png) [@TheCreaitor](https://forums.unrealengine.com/u/TheCreaitor)\
**Post date:** [September 28, 2023, 10:14pm UTC](https://forums.unrealengine.com/t/how-can-i-make-a-custom-listenable/1305603/5 "2023-09-28T22:14:53Z")

</div>

Yeah I have gotten this multiple times with generics. My current solution is to wrap the subscribable in a class like this (make sure to place this class in the same script as my\_subscribable):

```auto
my_subscribable_agent<public> := class:
    Subscribable<public> : my_subscribable(agent) = my__subscribable(agent){}

```

And then you can just use the Subscribable object in that class, not ideal having to create those extra classes but it’s okay for now I guess.

---

<div class="post-metadata">

**Author:** ![lootheo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lootheo/32/720722_2.png) [@lootheo](https://forums.unrealengine.com/u/lootheo)\
**Post date:** [October 2, 2023, 6:46pm UTC](https://forums.unrealengine.com/t/how-can-i-make-a-custom-listenable/1305603/6 "2023-10-02T18:46:37Z")

</div>

thanks fenzy! i did end up using your method, but we would like to eventually move out of tasks tbh.

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [October 2, 2023, 7:05pm UTC](https://forums.unrealengine.com/t/how-can-i-make-a-custom-listenable/1305603/7 "2023-10-02T19:05:49Z")

</div>

Me too my dude, me too 🙂
