This tutorial shows how to write a small and basic dialogue.
Note: You should already have a NPC (e.g Walter) spawned somewhere on your level. If not checkout the Spawn NPC (for dialogues etc) tutorial.
- Give it a name e.g walter_dialog (it's good to name the script according to the name of the actors or the time/quest it should appear at/in).
- Open the file.
- Right-click on the grey area and click on Add section.
- Name the section in (B), e.g main.
- Press enter, the lines SPEAKER and (dialog line) should appear
- Click on the line with SPEAKER and choose the speaker by writing and selecting, e.g GERALT.
- If you want Walter to say something write the name of his voicetag as on the Spawn NPCs tutorial (e.g CITIZEN POOR FLOTSAM 01).
- Write some dialog lines.
- Connect the main section-node with input on the left and output on the right.
- SAVE!
- Right-click and Add element
- Choose the voicetag of Walter (there is no need to choose Geralt's voicetag, that applies only to other actors) in this case CITIZEN POOR FLOTSAM 01.
- Actor tag: the tag of Walter's entity (walter)
- Actor Template: link with Walter's entity
Be sure that the voicetags/the actors are all in Dialog settings as well. If not right-click on the field below Voicetag and Add Element. Choose the right voicetag. Put in some Slot Number (1-4) and SAVE!
Right-click and click on Scenes/Scene:
- Click on the Scene Node
- Link your walter_dialog in scene (left window), click somewhere on the gray area to update the Scene
- Connect Start and the input of the Scene
- SAVE! and close the file
The dialogue should start right after you start the game.
Note: there are certain NPCs with different voicetags. If you add the Dandelion Entity Template to your dialogue as an example, you can't choose Dandelion as his voicetag. His voicetag is called Jaskier (the polish name of Dandelion). Be sure to check the voicetag of every NPC in its Entity Template.
Note: You should already have a NPC (e.g Walter) spawned somewhere on your level. If not checkout the Spawn NPC (for dialogues etc) tutorial.
Basic dialogue
- In Asset Browser, right-click and Create/Scene script- Give it a name e.g walter_dialog (it's good to name the script according to the name of the actors or the time/quest it should appear at/in).
- Open the file.
- The top-left window (A) shows the properties of whatever you select in the other windows.
- The top-right window (B) is for the dialog texts.
- The bottom window (C) shows the dialog logic (like what part of this dialog comes first, what conditions should be there, etc.).
- Right-click on the grey area and click on Add section.
- Name the section in (B), e.g main.
- Press enter, the lines SPEAKER and (dialog line) should appear
- Click on the line with SPEAKER and choose the speaker by writing and selecting, e.g GERALT.
- If you want Walter to say something write the name of his voicetag as on the Spawn NPCs tutorial (e.g CITIZEN POOR FLOTSAM 01).
- Write some dialog lines.
- Connect the main section-node with input on the left and output on the right.
- SAVE!
Defining the actors of the dialogue
- Go to the tab Actors definitions- Right-click and Add element
- Choose the voicetag of Walter (there is no need to choose Geralt's voicetag, that applies only to other actors) in this case CITIZEN POOR FLOTSAM 01.
- Actor tag: the tag of Walter's entity (walter)
- Actor Template: link with Walter's entity
Be sure that the voicetags/the actors are all in Dialog settings as well. If not right-click on the field below Voicetag and Add Element. Choose the right voicetag. Put in some Slot Number (1-4) and SAVE!
Adding it to your Quest file
Open your Quest. For an Interactive Dialog follow the tutorial Scene (dialog). For a scripted dialog that starts right at a given moment in your Quest, or after a trigger - or any other condition:Right-click and click on Scenes/Scene:
- Click on the Scene Node
- Link your walter_dialog in scene (left window), click somewhere on the gray area to update the Scene
- Connect Start and the input of the Scene
- SAVE! and close the file
The dialogue should start right after you start the game.
Note: there are certain NPCs with different voicetags. If you add the Dandelion Entity Template to your dialogue as an example, you can't choose Dandelion as his voicetag. His voicetag is called Jaskier (the polish name of Dandelion). Be sure to check the voicetag of every NPC in its Entity Template.