Making a public custom event and subscribing

Hi, I am struggling to make a publlic custom event that can be subscribed to and signaled from other verse files.

On the event itself it says “This archetype instantiation constructs a class that has the ‘transacts’ effect, which is not allowed by its context.” This goes away when I put the event within the game_controller class, but then I can’t access it from other files.

And on the .Subscribe it says “Unknown member Subscribe in event(tuple())”. This shows whereever the event is put.

Any help would be appreciated!

NextGameStateEvent<public> : event() = event(){}

game_controller := class(creative_device):

    OnBegin<override>()<suspends>:void=

        var Subscription : ?cancelable = false  
        set Subscription = option{NextGameStateEvent.Subscribe(NextGameStateHandler)}

    NextGameState():void=
        
        Print("Next game state")

events are not subscribable

you can try this instead

Thank you, I can see this is setting up the listenable, but how would do you listen to it and signal it from other verse files?

custom_subscribable.Subscribe() / custom_subscribable.SIgnal()

I had tried that, but I get this error for some reason.

Unknown member Subscribe in `type{_(:type):type(custom_subscribable(any), custom_subscribable(false))}