How to add new dialogue
This tutorial helps you to understand how to create dialogues files
Files & folders needed:
assets/dialogues/
assets/creatures/characters.json
PITO Dialogue Editor - tool for dialogue creation/editing (.NET 6.0)
All game dialogues placed at assets/dialogues/ folder. Name of the dialogue file is it's unique ID.
The JSON structure of dialogue file:
Editing and creation will be made with Dialogue Editor.
Download dialogue editor and unpack files from it into root game folder near assets folder.
Here is you can see workspace for working with game dialogues files, in left top corner you have dropdown menu that contains all game dialogues. By selecting one of the element, you can start work with it.
Now you can see at the right side at the top corner Start Dialogue ID drop down menu, it contains all dialogues IDs that can be showed at the start of conversation with NPC. You can select what ID will be shown first by selecting element from the drop down,
or left click at the title of the Dialogue Node in the Dialogues Nodes list.
Every dialogue node has ID, NPC Text language key preview and amount of player answers. Dialogues can be created by Add Node button or deleted from the Dialogues Nodes list by pressing red Delete button.
To edit dialogue phrase, click at Edit button and it will set your workspace to dialogue edit mode, and at the left side you will see a list of Player Answers, that has Answer number, answer language key text preview, Next dialogue drop down menu, conditions and actions amount.
You also can move answer block up or down it will change in-game order of the player answers. And also, you'll be able to change current dialogue NPC Text at the top left side of the workspace. Any changing to the text will save it to the temporary data container that hold all dialogue data before you will save it to the file.
So don’t forget to save file by clicking save or save as buttons at the bottom of the workspace.
Answers can be Deleted or Added by clicking Add New button at the top right corner of Player Answers list.
Keep in mind that you can create answers only in Dialogue Edit Mode at dialogue node.
You can change answers conditions and actions by clicking big Edit... button in answer node. You will see a window called Condition Editor.
Here you can add some conditions for showing player answer and some actions that will be executed when player will click at it.
Current active conditions or actions will be shown as numbers, so you can understand does the answer contains some conditions or not. To make condition - simply fill one of the condition fields and condition will be active, same for the actions and press Apply.
If you want to delete conditions and actions, make text fields empty and set number fields with zero and press Apply.
You can preview your dialogue structure as JSON and as Node Graph.
The JSON structure is used by the game, so you can check if everything alright and correct.
The Node Graph structure can help understand connection between dialogues and answers.
After creating and saving dialogue file to assets/dialogues/ folder, open assets/creatures/characters.json file to add new dialogue to the NPC profile.
How to create NPC profiles, you can learn a little in this tutorial:
The NPC profile contains "dialogues" property list [], it can contain structure like this:
So if we want to always show our new dialogue forever, use this structure:
If we want show dialogue only by condition (if no condition done, we can't talk)
If we want use same dialogue, but after receiveing event keys, we can use this:
Last updated