getnamo / GlobalEventSystem-Unreal

Loosely coupled internal event system plugin for the Unreal Engine.
MIT License
276 stars 44 forks source link

Skipped listener due to function not having a matching signature. #25

Closed visoredvisored closed 2 years ago

visoredvisored commented 2 years ago

I'm emitting an event in c++ +with:

FGESEmitContext GEContext;   
GEContext.Event = TEXT("TurnBegin");   
GEContext.WorldContext = this;   
FGESHandler::DefaultHandler()->EmitEvent(GEContext, Actor);

Actor is a UObject (AActor). Binding an event with UObject as input to TurnBegin in blueprint with the GESBindEvent node. I get the warning "Skipped listener due to function not having a matching NumericProperty signature" and the event doesn't trigger. When I change the input from UObject to integer the event triggers and the input is a random integer.

getnamo commented 2 years ago

What does the bound receiver event look like?

visoredvisored commented 2 years ago

Attaching screenshots. Kuvatõmmis 2021-12-24 122700 Kuvatõmmis 2021-12-24 122715

visoredvisored commented 2 years ago

In FGESHandler::EmitEvent(const FGESEmitContext& EmitData, UObject* ParamData) When checking for valid params:

if (FunctionHasValidParams(Listener.Function, FNumericProperty::StaticClass(), PropData, Listener))
    {
        Listener.ReceiverWCO->ProcessEvent(Listener.Function, (void*)&ParamWrapper);// PropData.PropertyPtr);
    }

I think FNumericProperty::StaticClass() should instead be FObjectProperty::StaticClass()? Seems to work as expected with this change.

getnamo commented 2 years ago

Yep, looks like a copy paste error, good catch. Make a pull request with change and I'll merge it

visoredvisored commented 2 years ago

Seems it's already correct in the master. Now I'm confused how I got the old version : ).

getnamo commented 2 years ago

Hah it did seem familiar, likely an older engine plugin release. Not sure if latest release had the patch or if I fixed it post.