Dialog System Using Data Structures, Arrays, Etc

Alright, so I just wanted to get some input from you more experienced coders in Unreal Engine.
I have been diving into creating a dialog system, and so far I’ve been able to implement something very basic. The problem is, I’d like to use a Data Structure to store a Text Array (Or multiple) that contains character dialog text, meaning each element of the Text Array contains a different text. Here’s where I’m stuck though (And I’ve also been using ChatGPT to help point me in the right direction so bear with me).

I have a dialog widget, that contains 2 variables: A text array for dialog text that’s binded to a text block, and an integer variable for the dialog index.

I was told by ChatGPT I should create a function library to create functions to communicate between the Widget and my Data Structure.

The problem is, I can’t figure out how to read the values of my text array in my data structure, and use them to overwrite the values from my text array variable in my dialog widget, so that the dialog updates in respect to the character that’s speaking.

Am I going in the right direction? Or am I missing key components here? Any suggestions and/or tutorial videos you guys can post?

To summarize: I want to use a Data Structure that contains a Text Array to overwrite the values of another Text Array variable located in my dialog widget so that the dialog text is different between characters.

First you need create widget with “create widget” set. Then use “set text” blueprint element. Get text from your structure, or just set variable with “set text” element.

To change dialog window use buttons. Any element of widget can be replaced. So you need just one widget at all.

It simple.

I’m really sorry. So I’ve done that, that part is easy enough to figure out, I just can’t figure out how to throw a data structure into the equation. Like, for example, I’m fairly confident with casting now, from whatever blueprint, but I don’t know how to access variables in a data structure from another blueprint?

Dear friend. I bit busy right now. I will post you screenshot later. Today I need help to Mom in garden.

I do some simple instruction how get linked blueprints in UE. It same like connect web pages. So you can get any variable from any structure in any blueprint.




Sometimes blueprint can’t get value directly. Then use castto…(BP Name) or GetActorOfClass and get your variable from class.

I hope it will be usefull.

1 Like

Thanks bro, I think I understand, I will try it out.

So while I was able to access that structure using your method, Consoler, I couldn’t quite figure out how to overwrite that information in my Widget blueprint while incrementing the dialog integer index with the text array. It increments just fine in my dialog widget blueprint with the variables being located in it, but I am having a hard time trying to put it all together from another class or blueprint. I appreciate your help, I’m following a different tutorial for a dialog system right now that looks like it uses behavior trees instead of data structures.

1 Like

Just to follow up and be done with this thread…

After a few days of research and following tutorial videos, I found a system that worked for me and experimented a little bit to make a system of my own tailored to my own needs. I now properly understand how to communicate between blueprints, especially when dealing with widgets. Thanks to all who posted.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.