Dialogue Pools

In Staxel, \*.dialoguepool files are used to specify a collection of dialogues which are to be played together. These files also contain a type property to describe what type of dialogues are collected.

# Creating New Dialogue Pools

Dialogue Pools is Staxel's main way with interacting with Dialogues. These pools mainly allow tagging of Dialogue with a #"type", but also act as a way to group each individual dialogue together.

*Before you start this tutorial, be sure to head through Modding#Getting Started with Staxel Modding.*

The first step would be to go through Dialogue#Creating New Dialogue if you don't already have a dialogue to implement. After that you are ready to go on to creating the pool.

## Creating the \*.dialoguepool file

### Adding the Dialogue Pool via Asset Manager

*Follow Modding#Using the AssetManager to Create Mods to open up the Asset Manager.*

With the Asset Manager open, head to `View → Characters and Animals → Villager Assets`. When the new window is open, head to `Asset → Add → New Asset` and the following window will show up.

First click on the button Asset Path and navigate upwards to the `/content/` folder. Once there, open the `/mods/` folder and create a new folder. Name this new folder to what you want the mod to be called and then open this new folder. When you open this folder give the asset a name, then click on the drop down and select *Dialogue Pool Asset*. Then click save, give the item a code then click OK.

After the asset is created, it will have been automatically selected. With that it is now time to tell the game what you want to do with this Dialogue Pool. The following set of steps highlight the important properties, however you can mess with any property.

1. Click on Dialogues. Click on the dropdown arrow. Find each individual dialogue you want, select them and click Add. Keep going until you have them all.
2. Click on Type of Dialogue. Select the one that is appropriate;
	* Personality: If you are creating this for one villager only, and it has nothing to do with a Job. Select this.
	* Job: If you are creating this for one villager only, and it has has everything to do with a Job. Select this.
	* WorkPlaceMissing: If you are creating this for one villager only, and it has has everything to do with a not having a workplace. Select this.
	* Weather: If it's only about the weather. And you don't care who says this. Select this.
	* Morning: If it's meant to be at day. And you don't care who says this. Select this.
	* Evening: If it's meant to be at night. And you don't care who says this. Select this.
	* Theft: If it's meant to be about someone theiving. And you don't care who says this. Select this.
	* Leaving: If it's meant to be about someone leaving. And you don't care who says this. Select this.
	* Quest: If it's meant to be a quest. Select this. (Quests require special actions using, Dialogue#Quest Functions)
	* Festival: If it's about a festival. And you don't care who says this. Select this.
	* Seasonal: If it's about the season. And you don't care who says this. Select this.
	* TutorialNotCompleted: If it's about not having completed the tutorial yet. And you don't care who says this. Select this.
	* Unemployed: If it's about not having a job.QAnd you don't care who says this. Select this.
	* General: If you don't care who says this. Select this.

In most cases you will want "Personality" or "Job".

With that, hit Crtl+S to save the file. And then go to `File → All Assets → Build and Validate Assets`. If this succeeds, then HURRAY! you have a new tile in the game. If it fails, try and read the error to see what you have done wrong.

Now you just need to add it to something. These are mainly used in various parts of Villager NPCs.

### Adding the Dialogue via Text Files

*Follow Modding#Using a Text Editor to Create Mods in order to be properly set up for this step.*

Creating this file is very simple as it only two properties. The full file will looks like;

```
{
 "code" : "mods.modname.dialoguepools.dialoguepoolname",
 "type" : "Personality",
 "dialogue" : [
	"mods.modname.dialogue.dialoguename",
	"mods.modname.dialogue.dialoguenumber2"
 ]
}

```

With the file being this short, there is no need for pictures. Here is the explanation of the two properties.

* "code": A unique String that would be used to identify this object from others. For example this is like "staxel.item.crafting.BakingPowder" or "staxel.tile.grass". You will most commonly want to use you use the path to the Accessory Model but replace `/` with `.`, as this will ensure your design will have a different code to all other designs.

* "type": A String that tells the game what type of Dialogue pool this will be. You mainly want "job" for dialogues during working time, or "personality" for other personal dialogue. More information about what each type is at #"type".

* "dialogue": A List of Strings that each contain the code to a Dialogue. Having more than one dialogue will mean that dialogues will get randomly chosen from the pool.

After you have done editing the file, head to `gamedata/bin/` folder, and start up **Staxel.ContentBuilder.exe**. When this has started up, click "Tag dialogue and generate language file". This will open up a file browser. Go to your newly created file (The .dialogue file from the first section.) and select that. After that, click **Validate Resources** and wait until the progress bar has done. And with that you should have a working item. If you are confused then go to the #Modding channel on Discord and ask there.

Now you just need to add it to something. These are mainly used in various parts of Villager NPCs.

# Config Options

## "code"

**Valid options (String): `A unique string which dialogue pool this object is.`**

**Default Value:** Must be specified.

A string containing the unique identifier of the dialogue pool. Used by Villager Personalities and other similar files.

## "dialogue"

**Valid options (List of Strings): `A list of strings which point to a Dialogue code each.`**

**Default Value:** If not specified, no dialogues will get added to this pool.

This is a list of strings that point towards the dialogues which will be selected when this pool is used.

## "type"

**Valid options (String): `One of the options specified below.`**

**Default Value:** Must be specified.

This string chooses the type of dialogue and how the game should handle it. Some sections will require a certain type of dialogue or will crash.

The list of available types and when to use them is below;

```
* Personality: If you are creating this for one villager only, and it has nothing to do with a Job. Select this.
* Job: If you are creating this for one villager only, and it has has everything to do with a Job. Select this.
* WorkPlaceMissing: If you are creating this for one villager only, and it has has everything to do with a not having a workplace. Select this.
* Weather: If it's only about the weather. And you don't care who says this. Select this.
* Morning: If it's meant to be at day. And you don't care who says this. Select this.
* Evening: If it's meant to be at night. And you don't care who says this. Select this.
* Theft: If it's meant to be about someone theiving. And you don't care who says this. Select this.
* Leaving: If it's meant to be about someone leaving. And you don't care who says this. Select this.
* Quest: If it's meant to be a quest. Select this. (Quests require special actions using, [[Dialogue#Quest Functions]])
* Festival: If it's about a festival. And you don't care who says this. Select this.
* Seasonal: If it's about the season. And you don't care who says this. Select this.
* TutorialNotCompleted: If it's about not having completed the tutorial yet. And you don't care who says this. Select this.
* Unemployed: If it's about not having a job.QAnd you don't care who says this. Select this.
* General: If you don't care who says this. Select this.

```