EventDispatcher in GameMode broken on 4.6?

  • make an event dispatcher on custom game mode
  • call it once on begin play
  • use it in custom hud / custom player
  • use the Standalone mode or make a build

it works fine with 4.5.1 and is completely broken in 4.6. Player and hud get ignored at the start. Level loads fine but no hud and no working default pawn class.

Please note that upon opening the project for the first time with 4.6 I observed the following error… But hitting compile solved the problem(?!)

Btw, the compile error will reoccur every time the project is reopened. Then I hit compile and it goes away. But Standalone mode or builds won’t work properly.

Is it a compile order issue? Where game mode would be compiled after hud and player causing an issue from a clean build?

  • refresh all nodes

  • compile OK

  • launch Standalone game

    MachineId:23F563844A04271878FE6C85FB93C956
    EpicAccountId:

    Access violation - code c0000005 (first/second chance not available)

    UE4Editor_UnrealEd + 3154877 bytes
    UE4Editor_UnrealEd + 3206223 bytes
    UE4Editor_UnrealEd + 9878186 bytes
    UE4Editor_UnrealEd + 9617164 bytes
    UE4Editor_CoreUObject + 626800 bytes
    UE4Editor_CoreUObject + 946322 bytes […]
    UE4Editor_Engine + 9512678 bytes
    UE4Editor_Engine + 9260885 bytes
    UE4Editor_Engine + 3802230 bytes
    UE4Editor_Engine + 3703790 bytes
    UE4Editor!FEngineLoop::Init() + 1147 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\launch\private\launchengineloop.cpp:1919]
    UE4Editor!GuardedMain() + 292 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\launch\private\launch.cpp:126]
    UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
    UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.6\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
    UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

I have experienced this kind of behavior a lot … using eventDispatchers in UMG widgets with parameters (weird) or using them on GameModes and GameInstance (singletons). It does not work properly either on PlayerController … I used a workaround that most of the time works for me which consists on using a Blueprint to handle all eventDispatchers. It might work for you…

Thanks @

@staff I believe this is what the problem is

[2014.12.04-13.02.22:898][  0]LogBlueprint:Error: [compiler] Error No delegate function ''  WeaponChangeDispatcher_Event_0 
[2014.12.04-13.02.22:899][  0]LogBlueprint:Error: [compiler] Error Wrong Event Dispatcher. Refresh node  Assign Weapon Change Dispatcher 
[2014.12.04-13.02.22:899][  0]LogBlueprint:Error: [compiler] Error Failed to create property K2Node_CreateDelegate_OutputDelegate from  OutputDelegate  due to a bad or unknown type (Delegate)
[2014.12.04-13.02.22:900][  0]LogBlueprint:Error: [compiler] Error Event signature error:  Signature not found.  WeaponChangeDispatcher_Event_0 
[2014.12.04-13.02.22:905][  0]LogBlueprint:Warning: [compiler] Warning [0018.50] Compile of GameHud failed. 4 Fatal Issue(s) 0 Warning(s) [in 16 ms]

I have found a work around. Instead of having the dispatcher in the GameMode BP, I put it in the PlayerController. Hud hooks onto that, so does player character, and the dispatching is done by the GameMode (For now). All seems to work and no Failure are appearing in logs anymore.

It may look like it’s a compile order issue from a clean.

Hey -

I’m attempting to reproduce the event dispatcher bug you described but I need a little clarification on your setup. Are the screenshots you provided from your GameMode BP or the HUD/Player BP?

Cheers

Just crosslinking these bugs. I think it’s the same thing:

https://answers.unrealengine.com/questions/142293/46-blueprint-compiler-fails-to-resolve-bindings-to.html

Repro steps in my cross linked issue.

@-

  • b1.png - player character BP (set projectile)
  • b2.png - game hud BP (set hud graphic)
  • b3.png - game mode BP (hook up 1,2,3 keys to dispatch)
  • b4.png - shows the HUD after a project closed/opened

HTH

I’ve had this issue in 4.6 as well. my bug Event Dispatcher Bug can probably be closed out in favor of this one.

In my case, migrated files with bindings would no longer appear during runtime as well.

can you explain this concept a little? previously my dispatchers were coming from game mode or controller to help communicate with the persistent level. but since that is currently not working, i’m interested to know how a separate blueprint could handle this. does the new blueprint have an actor base class? do you spawn an instance of it on beginplays of your game mode or controller?

[EDIT] just to expound upon this a bit, that workaround is really helpful. basically, in my player controller i spawned an event dispatcher manager class and stored it in a variable. then, from all other classes i can access that player controller’s variable to execute whichever event dispatcher. no crashes or corrupt blueprints as a result of this method thus far.

Hey -

I have written bug report UE-6396 and submitted it to our bug database so that our engineers can investigate this issue further.

Cheers

Should it be marked as Resolved if all that’s been done is a ticket being raised?

Hey -

Are you unable to use event dispatchers in other blueprints as well or does this only occur when using the custom GameMode BP?

Great that you found problematic commit. Note that this isn’t the only thing it broke.

Thanks for the additional information. This has been added to the report currently being investigated.

,

We were having the same issue as described above and, specifically with EventDispatchers in a BP of PlayerController that are subscribed to from within a UMG widget (using GetOwningPlayer->CastToOurBPPC). The error messages will show up until you compile the Widget that is subscribing; additionally these callbacks are broken in cooked builds regardless of compiling the Widget. We have other dispatchers that do not appear to be broken, however, any custom events in our Widgets that subscribe to dispatchers appear to be whats affected.

Fortunately I was able to check the differences between 4.5 and 4.6 (using Perforce actually, I am at a studio that is a licensee and am posting in AnswerHub as opposed to UDN because this post already existed with Epic eyes on it). It looks like what broke this is CL#2308582, specifically the changes to //depot/UE4/Engine/Source/Editor/BlueprintGraph/Private/K2Node_MCDelegate.cpp [revision 33]

I reverted the changed code from this CL (only the changes in K2Node_MCDelegate.cpp) to the code that was in 4.5 and everything is now working for us. We are still testing this locally but so far it seems to be the remedy for our dispatcher regression in 4.6.

Hope that helps.

p.s. Anyone that wants to try what I am describing in their 4.6 code simply replace the implementation of UK2Node_BaseMCDelegate::AllocateDefaultPins() and UK2Node_BaseMCDelegate::GetDelegateSignature() in their 4.6 code using the functions from 4.5 found below:

https://github.com/EpicGames/UnrealEngine/blob/4.5/Engine/Source/Editor/BlueprintGraph/Private/K2Node_MCDelegate.cpp

Hey ,

I guess my point is that this is marked as resolved while it’s not resolved for users. The creation of a ticket - which I can’t track - does not solve the problem for Users.

To reiterate, my work around is currently to not use the GameMode BP but use the player controller instead. I wouldn’t consider your answer as Resolved, as there is no linked ticket, or fix version for this issue for Users.

This only occurs to custom GameMode BP indeed. For me anyway.

Where can I track UE-tickets, even -only?