Creating UE4 events, opposed to c++ _event?

Hey, so I’ve got to the point where I need to be able to create listeners and notifiers within a lot of my classes. Currently I’m use c++ to do this with _raise and _event:

It’s easy to use but I’d like to use UE4s way of doing this as well, providing that it will work in c++ just as well as blueprints.

I’ve noticed this:

CollisionComp->OnComponentHit.AddDynamic(this, &AThe_Battle_Of_MaldonProjectile::OnHit); // set up a notification for when this component hits something blocking

which appears to be like this in my code:

__hook(&EventSource::AttackActionEvent, pSource, &EventReceiver::AttackActionEvent);

Where the method of OnComponentHit, the notifier/event, is run from the CollisionComp and also passed into the method OnHit, the listner, of AThe_Battle_Of_MaldonProjectile.

What what I have to do to set this up? Does ‘AddDynamic’, automatically hook OnComponentHit to OnHit or do I need to change something in OnComponentHit?

These links should be helpful:

Official Documentation

Forum Post

Thanks, I’ll look into it. lots of stuff to do for such a simple thing…

So i’ve got the idea but the compiler won’t compile. All I have is:

DECLARE_DELEGATE_OneParam(SuppliesGivenEvent, ASupply*);

UCLASS(Blueprintable, BlueprintType)
class THE_BATTLE_OF_MALDON_API AVillageVolume : public ABaseVolume

UPROPERTY(BlueprintAssignable, Category = “Events”)

	SuppliesGivenEvent OnSuppliesGivenEvent;


It just doesn’t know what SuppliesGivenEvent is, Unrecognized type ‘SuppliesGivenEvent’ etc?