Conversation Editor

  • warning: Parameter 1 to generic_productapi() expected to be a reference, value given in /home/visual3d/ on line 386.
  • warning: Parameter 1 to generic_productapi() expected to be a reference, value given in /home/visual3d/ on line 386.

Conversation Editor for Character Dialogue Scripting and Voice Acting

This tutorial shows how to write and script a conversation between a player character (PC) and non-player character (NPC) using Visual3D's Conversation Editor

The conversation structure is a tree. The conversation course can go on one of branches. Phrases participating in conversation alternate.
Let's create the first conversation. It will look like this:
  • Hello!
    • Hello.
      • I have a question to you. Where you were last Friday in the evening?
        • Wait, I need some time to recollect …
          • You have recollected?
            • Yes. I watched TV at home!
              • Thanks! Good-bye!
          • Unfortunately, I cannot wait. Have a good time!


To do this open the conversation editor and press button "New". In the appeared dialog enter a conversation name (for example «TVConversation») and press “OK».

Conversation also can be created using Asset Explorer. To do this you will have to select (folder Conversations) Add Asset-> Base Type-> Conversation in the Asset Explorer context menu:


Then create a conversation tree. To do this use context menu, that appears when you right click on the phrase.


Clicking on the phrase appears built-in text editor. Also, phrases are can be entered in the «Text» field in Object Explorer.

Also you can choose a special behaviors (sound playing for example), camera position, animation and other for any phrase.

Save conversation.

Conversation options and Images.

This is coming soon. 

Custom Actions for Phrase

Conversation Phrases supports custom actions like PlaySound or Animate. To add custom actions, set the property TalkAction in the Object Explorer. The action appears as a component for Conversation asset in Asset Explorer. When you select action in Asset Explorer, Conversation Editor will focus on the phrase with this action.
Talk Action is executed during playback of the phrase.


Conversation start.

There are several ways to start a conversation.
1.       Activate Speaker behavior system.
Set the Speaker behavior system properties: Conversation and Target. Then activate the Speaker behavior system using the context menu or trigger (simply drag drop behavior system on trigger).
2.       Conversation with Target Entity and Default Conversation.
You can assign a conversation for any entity in the world. To do this, set Conversation property at ConversationSupport ability at the required entity. Now, if we approach to this entity, to press the button of conversation start (default is the «E» button), conversation will be started. If the conversation is not set for the entity, then the default conversation will be started. It is conversation with a name «Default» in Asset Explorer.
3.       Run StartTalk action.
You can start the conversation, having executed StartTalk action. To do this, configure the necessary StartTalk properties. Start StartTalk action can be from a trigger or Behavior tree.
4.       Execute Talk command in python script.
To start the conversation from the python script, use the Talk command and DefaultTalk for default conversation start.

Use of links and scripts in Conversation.

It is possible to use links to phrases and scripts, for more complex conversations.
Scripts can be set  on a phrase and happen two types: conditions and actions. The script - action is executed at once at a phrase choice and run, and by means of a script-condition it is possible to show only those phrases which suit on a condition.
Links exist for construction of more complex structure of conversations, than a simple tree. For example, it is possible to loop one of branches
Let's change conversation. We will make so that one phrase repeated some times before conversation continuation.
At first we will loop a conversation branch.
To refer to any phrase, we need to define the phrase identifier. Select a phrase «I have a question to you.» And generate Phrase ID. To do this, right click on phrase and select “Generate phrase ID».


Then, add the link. To do this, add an child phrase for a phrase «You have recollected?». And set property «Link» in this phrase at reference on ID, which you have generated:


Now we will add scripts with which help the phrase «Wait, I need some time to recollect …» will repeat some times.
To do this, we will add a variable “answerIsReady” and we will initialize it in the first phrase. Add a script in “Action” property:
answerIsReady = 0


At phrase playing «You have recollected?» Value of a variable will increase:
answerIsReady = answerIsReady + 1


And, at last, that there was a choice between the link and a phrase «Yes. I watched TV at home!» Need  to add condition-scripts:
For a phrase «Yes. I watched TV at home!» :
answerIsReady >= 3


And for the link:
answerIsReady < 3


Save conversation and try it.
Hint: value of a variable «answerIsReady» can be found through the scripting console, so just enter «answerIsReady» into the console.
The example described here can be found in Asset Explorer. Its name «Default».