I have tried for so long to wrap my head around events but I am failing miserably and need help. So essentially I will break down what I am trying to do.
As an exercise I am trying to recreate the combat system from FF7. I have a couple different level types (Streets, forest. etc) and I created an ENum to hold these types and when combat is triggered, look at the type of level we were in to be able to know what type of map to spawn me into for the combat sequence. I had two plans for this, one of which is using my already existing function that triggers combat and pass my Enum into it determine what map to spawn but that had complications of its own.
So I decided to use events. My idea was I would have an event trigger in my c++ function I already have that begins my combat. That event would tell something in my blueprint to take a look at the enum and spawn my character in the correct level. But when it comes to declaring events, binding them to something and calling them I have no idea how it works.
I declared my event like so:
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FCombatTriggered);
here as well:
UPROPERTY(BlueprintAssignable)
FCombatTriggered CombatTriggered;
And I added what I thought would trigger the even in my cpp:
CombatTriggered.Broadcast();
I can see my event in my blueprint now. But when it comes to binding and calling I can’t wrap my head around how it works to actually make it work for me.
Sorry if this seem inappropriate but I have tried reading others answer questions, reading documentation on unreal’s websites but sometimes it is easier to bounce ideas off someone, or get an answer for my situation so I can relate the info to something I am actively trying to accomplish and hopefully make it easier to learn because of it.
So to explain it quick once more: Trigger event in c++ → The event will run a series of code in BP.