Events in a struct?

I am trying to figure out the best way to implement a functional dialog tree. I based my initial system off of this tutorial that allows me to edit my dialog trees like so:

This gives my non-programmer teammates a very easy way to create basic dialog trees with NPCs. However I want to extend this to allow functionality to be hooked into a Blueprint. For example, calling a function to add an item to my inventory or trigger a quest step. Since the dialog tree is split up as multiple Structs, I cannot figure out a clean way to do this.

I would like to avoid implementing the full dialog tree in Blueprints, if possible. Ideally, an artist could implement a dialog tree, and pass it on to a programmer to implement the events.

this is a very long shot but a dispatcher binding on the playercharacter to a NPC manager who would handle all the npcs (it would bind itself to all the npcs, waiting for they dispatcher call). then the npcs would just do a call with lets say…npcId, dialogId, that could be stored in something like a dictionary, the npc would retrieve that and send another signal, the player would recieve it. sorry if its totally wrong and not the point.

More customization than a struct, more flexibility. Also can be put into data tables. Enjoy! :smiley:

As someone who hasn’t yet touched C++ with Unreal, I’m not entirely sure how this fits into what I’m attempting to do.

Sure, it’s essentially just a header you can write and compile into UE4 with all kinds of stuff just like a struct! Best part is, you can write one called say QuestDialogAsset that extends UDataAsset. In editor for your team mates it will be a type createable by them. You can add variables to it in the header file like: ChoiceA, ChoiceB, or an array of Choices, that point to other QuestDialogAssets

If no one else replies with an example, I’ll whip one up for you in the AM. It’s late. In the meantime I’d suggest some reading:
https://docs.unrealengine.com/latest/INT/Engine/AI/BehaviorTrees/QuickStart/

Behavior Trees are also top notch for NPC behavior

Thanks for the useful information! I got a Blueprint implementation that works:

However this is a nightmare for my artist. I’ll look into Behavior Trees tomorrow when my brain is properly functioning again. Cheers dude!