Difference between revisions of "Villager Jobs"

From wiki
Jump to: navigation, search
m (Small fixes.)
(Updated to new category.)
Line 1: Line 1:
[[Category:Modding]][[Category:VillagerModding]]
+
[[Category:Modding]][[Category:Villager Modding]]
[[:Category:VillagerModding|Villagers]] in Staxel are fairly moddable, with many parts being able to be switched out, and new creations can add to the pool.
+
[[:Category:Villager Modding|Villagers]] in Staxel are fairly moddable, with many parts being able to be switched out, and new creations can add to the pool.
  
 
This page is about Villager Jobs, these are found in .villagerjob files and contains information for;
 
This page is about Villager Jobs, these are found in .villagerjob files and contains information for;

Revision as of 01:53, 8 July 2017

Villagers in Staxel are fairly moddable, with many parts being able to be switched out, and new creations can add to the pool.

This page is about Villager Jobs, these are found in .villagerjob files and contains information for;

  • The dialogues specific for the job
  • Starting and ending times
  • Tools and tiles that should be used for the job
  • The totem that signifies the workplace

The file specifies the entire set of information needed for a villager to do their job. Villager jobs help with locking progression of items and help bring more life to the world. Most workplaces have to be built by the player so the world can quickly start to become more built over time.

That being said, a villager is not forced to have a job, so this file contains no mandatory information for a villager.


Creating a *.villagerjob file

Creating a villager job file is mostly specifying other files that might be necessary for the job. This file is then used in a .villagernpc villager files. The file commonly looks like:

{
  "code" : "staxel.village.job.Barkeep",
  "startingTime" : 0,
  "endingTime" : 1440,
  "workPlace" : "staxel.totem.workplace.Tavern",
  "primaryDialogue" : "staxel.village.dialogue.Barkeep",
  "dialoguePools" : [
    "staxel.dialoguePool.Barkeep"
  ],
  "jobItems" : [
    {
      "code" : "staxel.item.tool.Net"
    }
  ],
  "workPlaceTools" : [
    "staxel.tileObject.shop.CashRegister"
  ],
  "weightedScripts" : [
    {
      "script" : "staxel.script.StandAroundIdle",
      "weight" : 25.0
    }
  ]
}

As with many other villager files, most properties just contain a code that points towards another file of the correct type. The first two properties that stand out are the start time and the end time. This is the amount of time in seconds from the start of the day change transition. The second would be the job items property. This contains a list of items which are to be spawned. There is more information on how to create these on this page (Currently not made). The third and final is "workPlaceTools", which specifies the tiles/tile objects in a workplace that the villager can "interact" with. (Stand around.) With all of these properties out of the way, you now have a working villager job.


Config Options

"code"

Valid options (String): A unique string which job what this object is.

Default Value: No default value is specified. Always need to provide your own.


A string containing the code of the job this file will be referring to.


"dialoguePools"

Valid options (List of strings): A list of strings that each point to a Dialogue Pool

Default Value: Can be omitted.


This is the list of dialogue pools that will be used while the villager is working. All dialogue pools in this section should have the "Job" type.


"primaryDialogue"

Valid options (String): A string that points to a Dialogue

Default Value: Can be omitted. Is not forced to say any dialogue first if omitted.


This specifies a dialogue which must be played first before all other dialogues. Useful for when something should be done first before all else.


"jobItems"

Valid options (List of Blobs (Objects)): A list of Spawned Items. In most cases these blobs can just contain a Code of an Item file

Default Value: Can be omitted.


This contains a list of items that the villager will hold in their hand. In most cases an items code can be used, however special cases arise for clothing and tiles. (To be elaborated later.)


"startingTime"/"endingTime"

Valid options (Int): An integer which is between 0-1440 (Start and End of the day)

Default Value: No default value. Must be specified.


The points to the time in which the villager will start/end their job. These times are specified in seconds after the day has been started. In terms of what it actually does, it changes dialogues to the job ones specified above and it also changes the scripts (how the villager behaves) to the ones specified.


"weightedScripts"

Valid options (List of blobs(items)): A list of 2 property blobs.

Default Value: Can be omitted.


This is a list of weighted scripts. These scripts involve how the villager should act, and the weight specifies how likely the particular script will be gotten compared to the others. These blobs look like;

{
  "script": "staxel.script.StandAroundIdle",
  "weight": 25.0
}


"workplace" =

Valid options (String): A string which points to a totem's code.

Default Value: Can be omitted. Omitting this means that the villager has no workplace.


This is the totem which is specified as the workplace for the villager. If one exists in the village, then the villager can use this workplace. If one doesn't exist, then the villager will end up using the dialogue specified by #"workPlaceMissingPools" instead of their normal job dialogue.


"workPlaceMissingPools"

Valid options (List of strings): A list of strings that each point to a Dialogue Pool

Default Value: Can be omitted.


This is the list of dialogue pools that will be used if the villager is missing their workplace. All dialogue pools in this section should have the "WorkPlaceMissing" type.


"workPlaceTools"

Valid options (List of strings): A list of strings that each point to a Tile

Default Value: Can be omitted.


This is the list of tiles in which the villager will "interact" with if they are in the workplace. Interacting with mostly involves standing nearby at this point in time.