UI buttons with multiple clicks

Hi,

I am trying to build a game that primarily uses a text based UI and button system to operate. I am using one button and one text box within that button so far, and everything appears within the box without problems.

The issue I am having is that as I have daisy chained a series of texts to appear in the box, whenever the box is clicked after the first choice it then fires every previous option in the dialogue chain when the next option is selected. I have tried to user an integer to fix this, but it still fires.

Is what I am attempting possible, and if so, how do you set a UI button to only effect the present option you want, and not fire all the previous options when you click on it.

This setup confuses me. Especially having all the collapsed graphs, hard to tell what exactly is going on. Are you trying to have an interactive text box? For example, player is posed a question, then responds in the text box and hits the button to submit. The response is read and based on what the player says have a few responses from the NPC be displayed and wait for more player input?

No - the UI has a button which the blueprint casts the text to via a variable -

The problem is that when you click on the button the button calls all the actions associated with it - that is fine for the first text, but when you get onto the second and third texts it means when you click you get all the prior events assigned to that button.

There is one solutions I can think of, namely have a button for each part of the conversation, but that seems like a lot of wasted system resources. I simply want to be able to have the player dialogue text on the button which is called to the button via the event.

Can you show me a video of this working from some game? I think I get what you are trying to do but I am not completely sure so, show me an example of this in action.

Here is a link to the video

is that how it is supposed to work? You click on the text and it gives a response? the last 20 sec of the video it just repeated the same thing when you clicked, stuff about being dead outside the light etc etc. With event dispatchers you can “unbind” events so they don’t fire. Maybe you need to do that? I still don’t understand what you are trying to achieve. The video was confusing, I can’t tell if it is working or not. Is there some polished game you can show me with this mechanic?

This is the start of a new game I am working on, and this is how far I got this afternoon. I will try the unbinding, as that may the the solution I am looking for.

There are three responses on the click, and it keeps repeating as the dispatch keeps stacking the clicks, which is why I am looking for a solution.

I tried to unbind the events, and it is still causing the same error. I also added in a branch to backstop, but it still reads all the loaded events when the button is pressed. Even if I change the input to an array I think the problem will persist.

Ultimately, is this an issue with UI buttons only liking one binding at a time? If so, do I need to use a different button each time I add more dialogue? Thus, will I need to destroy the actor each time?

I found a solution - I put a 1.0 second delay after the click, which seems to have solved the repeat issue.

Haha nice. Glad it is working now.