Need help with dialogue system

What you’re asking is a fairly complicated system, it’s far beyond the scope of a forum answer, I can just give you some directions.

First, you should not duplicate data, never. Pass your NPC Actor to your Dialogue Widget as a reference. When the Dialogue Widget needs to know something about its Owner NPC, just “ask” the Owner NPC.

I replaced your condition check with a type casting check. You can use tags if your project requires it, but if you can talk with all NPCs of this class, there is no need for that tag, just check if the hit actor is from class.

You can see that the Dialogue Widget has a property to reference the Owner NPC and it is set before initializing the widget.

image

If your NPCs always have the same options, you should create a list with all available options.
I created a String Table called DialogOptions with some chat options.

image

In your NPC class you should create a list of available options for that NPC. For example, it could contain an array of Text and you add to the array entries to the String Table

Now your Dialogue Widget has access to this list, and it can show the options.

When an options is selected you could call a function from the Onwer NPC to create a list of selected options or something, and check it.

If you have to save this changes it a whole new topic and system.