x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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:

Dialog Tree

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.

Product Version: UE 4.11
Tags:
more ▼

asked May 27 '16 at 09:37 PM in Blueprint Scripting

avatar image

Thebluefish
231 6 16 15

avatar image jblaswu May 28 '16 at 12:06 AM

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.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Engine/UDataAsset/index.html

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

more ▼

answered May 28 '16 at 05:02 AM

avatar image

Dodgin
351 7 5 32

avatar image Thebluefish May 28 '16 at 05:04 AM

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.

avatar image Dodgin May 28 '16 at 05:14 AM

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

avatar image Dodgin May 28 '16 at 05:14 AM

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

avatar image Thebluefish May 28 '16 at 05:34 AM

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!

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question