Hello everyone.
I have been struggling with this for some time. First I’ll describe a bit about the use case. I am writing an application to visualize the output of a flight simulator. In order to communicate between our simulator and the visualizer, I have a blueprint function library written in c++. In essence, this library keeps a list of the moveable objects so that our c++ side can just call a function with an identifier to tell an object to move and/or change its attitude.
A quick description of how this work is as follows:
The c++ side of our simulation sends a request to position an object, by name, to a location. Say like:
movePawnAvatar(“chase02”,lat,lon,height);
this is in a blueprint function library. The library also contains a list of pawns and actors that we would want to manipulate. They are indexed by idname.
So what happens is movePawnAvatar() will check the list for an index “chase02” if it finds it, all is well, issues the proper command to relocate the pawn and off we go. That part works.
However, in the case that the id name is a new one, as in it doesn’t appear on the list of registered pawns in this case, it needs to fire off an even to whomever needs to hear it to please spawn an pawn avatar (which is a bp avatar parented by a c++ one) at a position and attitude which would be specified.
That sounds like a job for a delegate. Which I can and have made. Its in a blueprint function library, though.
Apparently I can’t bind a delegate on the receiving side without a handle on an instance of this blueprintfunction library class. I can’t for the life of me find a way to get such a handle.
The idea is that the blueprintfunction library would be able to execute a delegate. In the current case, the level blueprint would see this delegate and then spawn the appropriate version of the blueprint reflected class of the pawn, register it in the list and then move on with life.
I have nothing to stick into the “target [self]” in order to bind an action to the delegate on the receiving side. Is there some way to get a handle on this library full of static functions? self, in the case of the receiver, is not a type blueprintfunction library so the blueprint does not compile.