Difference between revisions of "Dialogue Pools"

From wiki
Jump to: navigation, search
(Updated to new category.)
(Accidental mention of Villager Design due to copy pasting.)
 
(5 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
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.
 
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 a *.dialoguepool file =
+
= Creating New Dialogue Pools =
 +
Dialogue Pools is Staxel's main way with interacting with [[Dialogue|Dialogues]]. These pools mainly allow tagging of Dialogue with a [[#"type"]], but also act as a way to group each individual dialogue together.
  
Creating an dialogue pool is fairly easy once you have created a dialogue, due to dialogue pools being more of a collection of other files. The full file looks like;
+
''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 <code>View → Characters and Animals → Villager Assets</code>. When the new window is open, head to <code>Asset → Add → New Asset</code> and the following window will show up.
 +
 
 +
[[File:Asset Manager - New Asset.png]]
 +
 
 +
First click on the button Asset Path and navigate upwards to the <code>/content/</code> folder. Once there, open the <code>/mods/</code> 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 ''<tt>Dialogue Pool Asset</tt>''. 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.
 +
 
 +
# 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.
 +
# 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 <code>File → All Assets → Build and Validate Assets</code>. 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;
 
<pre>
 
<pre>
 
{
 
{
Line 10: Line 59:
 
   "type" : "Personality",
 
   "type" : "Personality",
 
   "dialogue" : [
 
   "dialogue" : [
     "mods.modname.dialogue.dialoguename"
+
     "mods.modname.dialogue.dialoguename",
 +
    "mods.modname.dialogue.dialoguenumber2"
 
   ]
 
   ]
 
}
 
}
 
</pre>
 
</pre>
  
The property "type" can only contain special values, [[#"type"|listed below]]. Otherwise the rest should be explanatory. Once this is done, you can add it to your [[Villager Personalities]]
+
With the file being this short, there is no need for pictures. Here is the explanation of the two properties.
 +
 
 +
* [[#"code"|"code"]]: A unique [[Modding_Key_Terms#String|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 <code>/</code> with <code>.</code>, as this will ensure your design will have a different code to all other designs.
 +
 
 +
* [[#"type"|"type"]]: A [[Modding_Key_Terms#String|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"|"dialogue"]]: A [[Modding_Key_Terms#List|List]] of [[Modding_Key_Terms#String|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 <code>gamedata/bin/</code> folder, and start up <tt>'''Staxel.ContentBuilder.exe'''</tt>. 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 <tt>'''Validate Resources'''<tt> 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 =
 
= Config Options =
 
== "code" ==
 
== "code" ==
'''Valid options (String): <code>A unique string which dialogue pool this object is.</code>'''
+
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A unique string which dialogue pool this object is.</code>'''
  
 
'''Default Value:''' No default value is specified. Always need to provide your own.
 
'''Default Value:''' No default value is specified. Always need to provide your own.
Line 28: Line 90:
  
 
== "dialogue" ==
 
== "dialogue" ==
'''Valid options (List of strings): <code>A list of strings which point to a [[Dialogue]] code each.</code>'''
+
'''Valid options ([[Modding_Key_Terms#List|List]] of [[Modding_Key_Terms#String|Strings]]): <code>A list of strings which point to a [[Dialogue]] code each.</code>'''
  
'''Default Value:''' Null or nothing specified.
+
'''Default Value:''' If not specified, no dialogues will get added to this pool.
  
  
Line 36: Line 98:
  
 
== "type" ==
 
== "type" ==
'''Valid options (String): <code>One of the following options: Greeting, General, Weather, Evening, Morning, Personality, Quest, Theft, Leaving, Job, WorkPlaceMissing, Unemployed</code>'''
+
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>One of the options specified below.</code>'''
  
 
'''Default Value:''' No default value is specified. Always need to provide your own.
 
'''Default Value:''' No default value is specified. Always need to provide your own.
Line 42: Line 104:
  
 
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.
 
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.

Latest revision as of 06:55, 2 February 2018

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.

Asset Manager - New Asset.png

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<tt> 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: No default value is specified. Always need to provide your own.


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: No default value is specified. Always need to provide your own.


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.