Dialogue System

I’ve got it)

  1. Create one more behavior tree variable in your bot character and set your basic AI behavior tree:

01.png02.png

  1. In DialogueController (AIController) create branch:

  1. We should set game mode and cursor visibility, because CloseDialogue task doesn’t run (patrol behavior runs before it)

And that’s all we need. You can redownload sample project, I just updated it:)

Thanks, I’ll check it out - btw - your attachments are broken.

  1. Behavior Tree doesn’s have any information about key pressing, and UserWidget has. So I just can pass this information from widget to behavior tree throw the event listener. It’s not so hard, just follow the tutorial carefully, you might miss something.
  2. To separate phrases just create another text widget and give them different name. By default phrase slot name is PhraseSlot. In behavior tree and widget they should be the same.

Hmm, I see that you’re using a BT services to populate most blackboard values in each tick. (not a very good solution for complex ai behaviours)
You however don’t update the waypoint value and that’s why it resets each time I talk to the bot. After the dialogue ends the bot turns around and goes to a different waypoint - that should not happen unless it’s explicitly triggered by the dialogue.

My approach is to update blackboard from player controller when necessary. And it doesn’t work with the dialogue system, because switching BTs always resets blackboards.

I’m now going to experiment whether having 2 controllers (one for dialogues, other for the rest) per character is a good idea.

I update isTalking and CanTalk every tick because I shold now is bot talking or not at this moment)
Can you explain why you can’t use one blackboard data for AI and dialogues? With one blackboard it works perfect.

Because I’d have to use the same blackboard for every single BT that I have. If I have 10 dialogues, but the same Blackboard data - it could get very messy.

Also I tried the two controller solution (with dialogue bt running all the time in the background) and now the editor crashes on
Plugins\DialogueSystem\Source\DialogueSystem\Private\BTTask_ShowPhrases.cpp L106 - with “array out of bounds” exception when it reaches the same “show phrases” node again.

Can you try in sample project in dialogue blackboard set patrol blackboard as parent? Will the bot return to the first waypoint after dialogue? I don’t have access to my computer now and can’t try by myself.

Is this working with 4.11?

Nevermind i just read the other page, awesome, will give this a try. Thanks!

yes, 1.5.2 for 4.11:)

Parent/child blackboards are still treated as different blackboards unfortunately.

Found solution, I hope:) Yes, we need 2 controllers. 1st - basic ai, and 2nd - dialogue controller. (they are running at the same time)

  1. In Dialogue bot create variable, type - dialogue controller class. Set it.

01.png

  1. In Dialogue bot on begin play spawn controller of that class. Owner - dialogue bot.

  1. Now we should change controlled pawn node to owner node, because dialogue controller doesn’t have controlled pawn, just owner (it’s more than enough)

You can check sample project. I hope it helps:)

Thanks, but I’ve implemented something like that already.

And you really should fix the crash on L106 in Plugins\DialogueSystem\Source\DialogueSystem\Private\BTTask_ShowPhrases.cpp
I inserted this after L105 and that prevents those crashes.



if (ShowingNumPhrase > PhrasesCount) {
	ShowingNumPhrase = PhrasesCount;
}


But maybe there’s a better way.
Have you thought about putting your code on github btw?

if ShowingNumPhrase > PhrasesCount already something wrong. As you can see in node startup ShowingNumPhrase = 0. I really don’t know, how do you get this situation)) It’s not normal behavior!
I’ll think about github)

Are you talking about the constructor on L24?
Don’t think that it fires more than once if the bt keeps running in the background all the time.

Anyway - your code should not crash without warning for users that only use blueprint. And in that place that I showed you - you never do bounds checking before accessing the phrases array.

thank you!) I appreciate your help!

Fixing Decorators

Hello !

Could you please create a Github repo for this plugin ?
Because I found a problem in this system, and I fixed it, but I modified too much code to just post the fix here.
This is about Decorators : Questions did not check them, and were shown even if they “did not agree”.
And I think the plugin would be even better if everyone could contribute to it :smiley:

Thank you for this plugin !

Added typewriter effect :slight_smile: I’m working on skipping now

textEffect.png typewriter.gif

:cool:… yeah

Created GitHub repository GitHub - artemavrin/UE4-DialogueSystem: Dialogue System source code

Thank you, I will create a fork !