Dialogue System

thejohncrafter added:

  • decorators are now respected : a Question which is not validated by it’s Decorators will not be displayed
  • we can now choose to display or not the mouse after dialogue ends
    01.png
  • some improvements

Also Matinee support in ShowPhrases and WaitAnswer nodes has been added:)

01.png

1.6 RELEASED!

Special thanks to thejohncrafter. He helped with question’s decorators and some code improvements.

FEATURES:

  • Typewriter text effet
  • Now each phrase have its own sound CUE
  • Decorators are now respected : a Question which is not validated by it’s Decorators will not be displayed
  • We can now choose to display or not the mouse after dialogue ends
  • Dialogue settings - allow quickly control of question visibility
  • Matinee support in ShowPhrases and WaitAnswer nodes
  • New version notification
  • Sample project has been updated

You can download it here

T4VXeve_Pds

Cheers
Artem

congrats on releasing 1.6 !
i really love your system. Once our game is at that state i will definitevely try this system !!
one thing about the typewriter effect. i find this one hard to read cause the text is always moving and not staying in place.
i would prefer it if the text stands still and only the letters apear one after the other.
you know what i mean ?
kind regards
stucki

Thanks! I think, you should change text alignment in widget, because typewriter effect is just one char + one more char + one more char etc. with some delay:)

a super. Didnt see textalignement was choosable. !

Hi there.

I implement dialogue parameter for my project. If you think it is usefull, integrates it. I put this in BTDialoguesTypes.h


/**
* Dialogue Argument Struct
*/
USTRUCT()
struct DIALOGUESYSTEM_API FDialogueParameter
{

	GENERATED_USTRUCT_BODY()

public:

	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = DialogueParameter) FString StringKey;
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = DialogueParameter) FBlackboardKeySelector BlackboardKey;

public:

	void PushArgument(FFormatNamedArguments& DialogueArguments, UBehaviorTreeComponent& OwnerComp) const
	{

		UBlackboardComponent * Blackboard = OwnerComp.GetBlackboardComponent();
		FString TextValue = Blackboard->GetValueAsString(BlackboardKey.SelectedKeyName);

		DialogueArguments.Add(StringKey, FText::FromString(TextValue));

	}

};

And here is an example of integration in Question node.

BTComposite_Question.h :


FText GetQuestionThumbnail(UBehaviorTreeComponent& OwnerComp) const;

/** Question Parameters */
UPROPERTY(EditInstanceOnly, Category = Question)
TArray<FDialogueParameter> DialogueParameters;


BTComposite_Question.cpp :


FText UBTComposite_Question::GetQuestionThumbnail(UBehaviorTreeComponent& OwnerComp) const
{

	FFormatNamedArguments DialogueArguments;

	for (const FDialogueParameter& DialogueParameter : DialogueParameters)
		DialogueParameter.PushArgument(DialogueArguments, OwnerComp);

	return FText::Format(QuestionThumbnail, DialogueArguments);

}

You just have to compare the same generated text in the GetNextChildHandler function in the same file :


FText GetQuestion = GetQuestionThumbnail(SearchData.OwnerComp);
if (GetQuestion.ToString() == AnswerText.ToString())
{
	NextChildIdx = 0;
	AnswerNode->ClearAnswer();
}

And print it in the Execute_Task function in BTTask_WaitAnswer.cpp :


NewSampleTextBlock->SetText(FText::Format(NSLOCTEXT("DialogueSystem", "ButtonText", "{0}"), Question->GetQuestionThumbnail(OwnerComp)));

Give you something like this :

e870d00f87bdd32789e58d7a8fae8746efb30b78.jpeg

Thanks for this, great learning resource!
I would be grateful if you can do some step by step tutorials about extending UE4 editor using QuestBook as example.

Instead of pasting the code here, it would be better to create a pull request on github.

Hello, Le Samedi! Nice work!
Also Dialogue parameters will be usefull in ShowPhrases:) It would be great if you create a pull request on github.

I’ll do it, i made this on 1.5, so i’ll take 1.6 tonight or tomorrow and make the pull on it, with the showphrases integration.

nice, thanks!:slight_smile:

Done. I notice after the pull you already do a listener for skipping phrases. It works well if you change the name of the listener you are looking for. Because you are looking for a widget that have the same name of the class, and we cannot add an instance with the same name of his class (always add _0 after the name in UMG). So i look for DialogueListener by default and name the widget DialogueListener in UMG. Cant make a pull for that :slight_smile:

Thanks! I changed searching EventListener, now we search it by class, not name) So name is no longer important)

Hi artemarvin. Some plans for a customizable layout like this? :smiley: that would be really great :rolleyes:

First of all, thanks for your efforts, you’re awesome ! Is it possible to use this plugin in a C++ project ?
I’ll give you some money if it works for mine ! :smiley:

I also have a question : i tried to follow your tutorials on youtube but when I tested it for the first time the dialogue launches itself as soon as the widget appears, i don’t understand why…

EDIT : No problem, set a boolean to true instead of false, all working well now, I’ll try to implement this in C++ now :slight_smile:

Example project file can not be downloaded.

Hi, I wanted to say thank you for your wonderful work! :slight_smile:
Thanks to you and this awesome community I am learning a lot!
Have a nice day and a beautiful week!

I would like to have a 4.12 version, can you create one with the 4.12 preview 3 or newer?

yes, sure, I’ll try to build it for 4.12)