Howdy,
Ok, so I am having a problem with using a BlueprintImplementableEvent. I run my editor through Visual Studio. Within the Editor, I created a new c++ class that derives from UUserWidget. This class is used as a base class for a popup system in my game. Once I coded the class, I created a blueprint from it inside the editor. I then take a UserWidget blueprint that I had already created and re-parent it with this new blueprint of the base class.
In the c++ code for the base class, I create a BlueprintImplementableEvent. I call the event from another function within the same base class code. The first time I call the event, it works just fine. The second time, however, I get the same access violation every time:
(UE4Editor-CoreUObject.dll) in UE4Editor.exe: 0xC0000005: Access violation reading location 0x0000000000000010.
At present, the event looks like this:
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "Popup Event")
void Toggle_Popup_Event(const uint8 _ind, const bool _state);
};
My stack trace points to a line in the .generated.cpp file for my overall project.
void UGame_Popups::Toggle_Popup_Event(const uint8 _ind, bool _state)
{
Game_Popups_eventToggle_Popup_Event_Parms Parms;
Parms._ind=_ind;
Parms._state=_state ? true : false;
ProcessEvent(FindFunctionChecked(GAME_Toggle_Popup_Event),&Parms);
}
It points to the ProcessEvent line. I have placed a break on this line and there was acceptable data for both the GAME_Toggle_Popup_Event and &Parms. The GAME_Toggle_Popup_Event had the same data as it did during the first, successful run of this event. I figure this is basically just the memory location of the event so it seems correct that it should be the same through subsequent calls. The Parms showed the appropriate changes between the two calls as well. If I try to Step Into the function when I place a break on it, it instantly gives me the error.
On the editor side, I have utilized the event inside the base class blueprint originally. I also tried utilizing it in the re-parented “derived” blueprint but got the same error.
This is really frustrating as I have many other blueprintimplementableevents in my code and they work just fine. Granted, none of them are in base/derived class situations like this though.
I am using Visual Studio 2015 and am on Unreal version 4.14.
If you need any more information, please feel free to ask.