Event Dispatch cancelled if called again during delay
So I have this event dispatcher that receives data then does something. This event for the dispatcher has a delay in however, if I get to the delay, and if the data was dispatched again before this event finished it will start the new dispatch and it will never turn back to finish the original one and just continue on with the current one. Its as if, the original dispatch was cancelled. I don't see anything in the documentation documenting this behavior, so is it a bug?
There appears to be more to this, it may not be cancelled, but something really weird is going on. The blueprint that receives the data is a base class, right after the delay there is a 'switch', it switches on a value that's passed as a parameter from the dispatcher. Based on what I'm seeing, it appears it does return to the original HOWEVER, it may be using the value from the new dispatch call instead of the original.
After more testing it appears that all values being passed into the second dispatch call replaced all the original values from the original call. Not only that, the second dispatch call happens on a completely different object, but they share the same base class where the event is located. I confirmed this by putting watches on all the values. It's not even possible for it to be where it is in the flow control with the values it has now, and as a result it moves down an unexpected path. These parameter values for the events are just vectors and a structs.
I hope this helps, let me know if you have any trouble replicating the issue.
It appears that the problem is the placement of your delay. When TestEvent is called, it calls the TestDispatcher twice. The Event you have linked to it has a delay in it, but TestEvent (in GameMode) does not care what's happening in the bound event, so it tries to call TestDispatcher again with new values before the delay in the first Event has finished. Then by the time the print strings are run, it's using the latest values set.
Hope that makes sense. To get the desired effect, you need to make sure the events bound to your dispatchers don't have a delay in them. Instead, you need to place the delays where the dispatchers are called, and remember that using a delay inside an event bound to a dispatcher does not delay the execution of the node following the dispatcher call.
Hope that helps! Let me know if you have any questions or need help setting this up in your project.
answered Oct 29 '14 at 07:30 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here