Difference between revisions of "Totems"

From wiki
Jump to: navigation, search
m (Fix copy paste errors.)
(Update formatting and added some missing information.)
Line 133: Line 133:
  
 
= Config Options =
 
= Config Options =
 
 
== "code" ==
 
== "code" ==
'''Valid options (String): <code>A unique string which totem what this object is.</code>'''
+
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A unique string which totem what 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 143: Line 142:
  
 
== "centreOffset" ==
 
== "centreOffset" ==
'''Valid options (Vector 3): <code>{ "x": 0, "y": 0, "z":0 }</code>'''
+
'''Valid options ([[Modding_Key_Terms#Vector 3|Vector 3]] - [[Modding_Key_Terms#Integer|Integer]]): <code>{ "x": 0, "y": 0, "z":0 }</code>'''
  
'''Default Value:''' Can be omitted. Will just leave the totem centred in the area.
+
'''Default Value:''' If not specified, leaves the totem in the center of the area.
  
  
Line 152: Line 151:
  
 
== "region" ==
 
== "region" ==
'''Valid options (Vector 3): <code>{ "x": 0, "y": 0, "z":0 }</code>'''
+
'''Valid options ([[Modding_Key_Terms#Vector 3|Vector 3]] - [[Modding_Key_Terms#Integer|Integer]]): <code>{ "x": 0, "y": 0, "z":0 }</code>'''
  
'''Default Value:''' No default value. Must be specified.
+
'''Default Value:''' No default value is specified. Always need to provide your own.
  
  
Line 161: Line 160:
  
 
== "requiredBuildings" ==
 
== "requiredBuildings" ==
Required buildings act fairly similar to required categories and required objects. It is a blob that contains blobs that are named "tier0", "tier1" etc. It can have any of the numbers up to but not including the number specified by "tiers". (i.e. If tiers is 2, then you can put "tier0" and "tier1" but not any other numbers). It has code points to another totem altogether. It uses that code to check if a totem of that type exists in the village. Then if it does exist it will also check it's current tier, and if that is correct it will allow the tier specified to be built. It can commonly look like;
+
This is a [[Modding_Key_Terms#Blob|Blob]] that contains Blobs which are named "tier0", "tier1" etc. It can have any of the numbers up to but not including the number specified by "tiers". (i.e. If tiers is 2, then you can put "tier0" and "tier1" but not any other numbers). For each tier, the requirements must be met for this tier and lower.
  
 
<pre>
 
<pre>
Line 178: Line 177:
 
</pre>
 
</pre>
  
As a note, this is note needed. You do not need to tie any tiers to any other buildings, but doing so can be a good way to force progress. (A smelter would need a mine for example.)
+
As a note, this is note needed. You do not need to tie any tiers to any other buildings, but doing so can be a good way to force progress. (A smelter could need a mine for example.)
 +
 
 +
=== "code" ===
 +
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A string which contains the code of another item.</code>'''
 +
 
 +
'''Default Value:''' No default value is specified. Always need to provide your own.
 +
 
 +
 
 +
This is the totem that it will search for in the village.
 +
 
 +
 
 +
=== "tier" ===
 +
'''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>A positive integer value.</code>'''
 +
 
 +
'''Default Value:''' No default value is specified. Always need to provide your own.
 +
 
 +
 
 +
This is the minimum tier the totem must be before this totem's tier can be met.
  
  
 
== "requiredCategories" ==
 
== "requiredCategories" ==
Required Categories act fairly similar to required buildings and required objects. It is a blob that contains blobs that are named "tier0", "tier1" etc. It can have any of the numbers up to but not including the number specified by "tiers". (i.e. If tiers is 2, then you can put "tier0" and "tier1" but not any other numbers). It has categories that it will look for in every tile that the totem covers. It also has a quantity, and if that amount of tiles, or more, can be found then it will allow this tier to be gotten. It can commonly look like;
+
This is a [[Modding_Key_Terms#Blob|Blob]] that contains Blobs which are named "tier0", "tier1" etc. It can have any of the numbers up to but not including the number specified by "tiers". (i.e. If tiers is 2, then you can put "tier0" and "tier1" but not any other numbers). For each tier, the requirements must be met for this tier and lower.
  
 
<pre>
 
<pre>
Line 205: Line 221:
 
</pre>
 
</pre>
  
As a note, this is note needed. You do not need to tie any tiers to any categories, but this will be the most used property in tiles. (You don't care what table is place, just that a table is placed for example.)
+
You do not need to tie any tiers to any categories, but this will be the most used property in tiles. (You don't care what table is place, just that a table is placed for example.)
 +
 
 +
=== "category" ===
 +
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>Any valid string.</code>'''
 +
 
 +
'''Default Value:''' No default value is specified. Always need to provide your own.
 +
 
 +
 
 +
This is the category it will search for in all the tiles in the area.
 +
 
 +
 
 +
=== "count" ===
 +
'''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>A positive integer value.</code>'''
 +
 
 +
'''Default Value:''' No default value is specified. Always need to provide your own.
 +
 
 +
 
 +
This is the number of these tiles it must have before allowing the tier goals to be met.
  
  
 
== "requiredObjects" ==
 
== "requiredObjects" ==
Required objects act fairly similar to required buildings and required categories. It is a blob that contains blobs that are named "tier0", "tier1" etc. It can have any of the numbers up to but not including the number specified by "tiers". (i.e. If tiers is 2, then you can put "tier0" and "tier1" but not any other numbers). It has a tile code that it will look for in every tile that the totem covers. It also has a quantity, and if that amount of tiles, or more, can be found then it will allow this tier to be gotten. It can commonly look like;
+
This is a [[Modding_Key_Terms#Blob|Blob]] that contains Blobs which are named "tier0", "tier1" etc. It can have any of the numbers up to but not including the number specified by "tiers". (i.e. If tiers is 2, then you can put "tier0" and "tier1" but not any other numbers). For each tier, the requirements must be met for this tier and lower.
  
 
<pre>
 
<pre>
"requiredCategories" : {
+
"requiredObjects" : {
 
   "tier0": [
 
   "tier0": [
 
     {
 
     {
       "category" : "stool",
+
       "code" : "staxel.tile.glass",
 
       "count" : 3
 
       "count" : 3
 
     },
 
     },
 
     {
 
     {
       "category" : "table",
+
       "category" : "staxel.tile.wood",
 
       "count" : 5
 
       "count" : 5
 
     }
 
     }
Line 225: Line 258:
 
   "tier1": [
 
   "tier1": [
 
     {
 
     {
       "category" : "stool",
+
       "category" : "staxel.tile.stool",
 
       "count" : 1
 
       "count" : 1
 
     }
 
     }
Line 232: Line 265:
 
</pre>
 
</pre>
  
As a note, this is note needed. You do not need to tie any tiers to any objects, but this is useful for making sure a very specific object is placed. (You want to make sure a baking station is placed for example.)
+
You do not need to tie any tiers to any objects, but this is useful for making sure a very specific object is placed. (You want to make sure a baking station is placed for example.)
 +
 
 +
 
 +
=== "code" ===
 +
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A string which contains the code to a [[Tile]].</code>'''
 +
 
 +
'''Default Value:''' No default value is specified. Always need to provide your own.
 +
 
 +
 
 +
This is the exact tile it will search for in all the tiles in the area.
 +
 
 +
 
 +
=== "count" ===
 +
'''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>A positive integer value.</code>'''
 +
 
 +
'''Default Value:''' No default value is specified. Always need to provide your own.
 +
 
 +
 
 +
This is the number of these tiles it must have before allowing the tier goals to be met.
  
  
 
== "requiresRoof" ==
 
== "requiresRoof" ==
'''Valid options (bool): <code>True or False</code>'''
+
'''Valid options ([[Modding_Key_Terms#Bool|Bool]]): <code>True or False</code>'''
  
 
'''Default Value:''' False.
 
'''Default Value:''' False.
Line 245: Line 296:
  
 
== "shopGoods" ==
 
== "shopGoods" ==
[Will be editted when [[Treasures]] is complete.
+
This is a [[Modding_Key_Terms#Blob|Blob]] that contains Blobs which are named "tier0", "tier1" etc. It can have any of the numbers up to but not including the number specified by "tiers". (i.e. If tiers is 2, then you can put "tier0" and "tier1" but not any other numbers). For each tier, the requirements must be met for this tier and lower.
 +
 
 +
<pre>
 +
"shopGoods" : {
 +
  "tier0": [
 +
    {
 +
      "dock": "staxel.tileObject.shop.ShopShelfMerchant",
 +
      "treasures": [
 +
        {
 +
          "code": "staxel.treasure.storeShelf.BuildingStoreCarpet",
 +
          "count": 1
 +
        },
 +
        {
 +
          "code": "staxel.treasure.storeShelf.BuildingStoreHappyBricks",
 +
          "count": 2
 +
        }
 +
      ],
 +
    }
 +
  ]
 +
},
 +
</pre>
 +
 
 +
These are the shop goods that will be available after the tier has been met.
 +
 
 +
 
 +
=== "dock" ===
 +
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A string which contains the code to a [[Tile]].</code>'''
 +
 
 +
'''Default Value:''' No default value is specified. Always need to provide your own.
 +
 
 +
 
 +
This is the tile needed in order to store the treasures listed below.
 +
 
 +
 
 +
=== "treasures" ===
 +
This is a [[Modding_Key_Terms#List|List]] of [[Modding_Key_Terms#Blob|Blobs]] that contain the [[Treasure Pools]] for the selected dock. This commonly looks like;
 +
<pre>
 +
"treasures": [
 +
  {
 +
    "code": "staxel.treasure.storeShelf.BuildingStoreCarpet",
 +
    "count": 1
 +
  },
 +
  {
 +
    "code": "staxel.treasure.storeShelf.BuildingStoreHappyBricks",
 +
    "count": 2
 +
  }
 +
],
 +
</pre>
 +
 
 +
==== "code" ====
 +
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A string which contains the code to a [[Treasure Pool]].</code>'''
 +
 
 +
'''Default Value:''' No default value is specified. Always need to provide your own.
 +
 
 +
 
 +
This is the treasure to be used in order to fill the selected dock.
 +
 
 +
 
 +
==== "count" ====
 +
'''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>A positive integer value.</code>'''
 +
 
 +
'''Default Value:''' No default value is specified. Always need to provide your own.
 +
 
 +
 
 +
How many tiles should contain this treasure.
  
  
 
== "tiers" ==
 
== "tiers" ==
'''Valid options (Int): <code>A number that is 0 or greater</code>'''
+
'''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>A number that is 0 or greater</code>'''
  
 
'''Default Value:''' No default value. Must be specified.
 
'''Default Value:''' No default value. Must be specified.
Line 258: Line 373:
  
 
== "villagerSpawner" ==
 
== "villagerSpawner" ==
'''Valid options (Int): <code>A code that points to a [Tiles|Tile] that is a villager spawner.</code>'''
+
'''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>A code that points to a [Tiles|Tile] that is a villager spawner.</code>'''
  
 
'''Default Value:''' Can be omitted. Will not spawn any villagers.
 
'''Default Value:''' Can be omitted. Will not spawn any villagers.

Revision as of 03:08, 17 November 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 Totems, these are found in .totem files and contains information for;

  • What objects are needed to make a building
  • Size of the search area
  • What is needed to make higher tiers of building

This file actually doesn't have much to do with villagers. But this system is entirely made to allow villagers to take advantage of it. Villagers will know of totems and can speak about them in their dialogue. It also has a tier system which can also be taken advantage of.


Creating a *.totem file

Villager totems can actually be a somewhat complicated file to work with. But it can be simply broken down into separate parts. But first here is a typical .totem file.

{
  "code" : "staxel.totem.workplace.Patisserie",
  "region" : {
    "x" : 5,
    "y" : 5,
    "z" : 5
  },
  "centreOffset" : {
    "x" : -5,
    "y" : 5,
    "z" : 0
  },
  "tiers": 2,
  "requiresRoof" : true,
  "requiredCategories" : {
    "tier0": [
      {
        "category" : "stool",
        "count" : 3
      },
      {
        "category" : "table",
        "count" : 5
      }
    ],
    "tier1": [
      {
        "category" : "stool",
        "count" : 1
      }
    ]
  },
  "requiredObjects" : {
    "tier1": [
      {
        "code" : "staxel.tileObject.office.OfficeChair",
        "count" : 1
      }
    ]
  },
  "requiredBuildings" : {
    "tier1": [
      {
        "code" : "staxel.totem.workplace.Patisserie",
        "tier" : 1
      },
      {
        "code" : "staxel.totem.workplace.FishingSpot",
        "tier" : 0
      }
    ]
  },
}

The first five properties are fairly simple to understand. Code is just the unique identifier for this totem. Region is how many tiles in each direction, for example if you have an x of 3, it will stretch from -3 to 3 (7 tiles) with the totem as the centre. Centre offset moves the area that it searches away from the totem. And requires roof allows it to check if a roof has been built over the totem/area.

With that comes the more complicated looking bits. All of these parts rely on the property "tiers". Tiers that is greater than 0, numbering how many different tiers that this totem can have. This does not include the base "Broken" tier that you get just for placing down the totem. The first of the properties to use this is "requiredCategories". Required categories follows the following order;

"requiredCategories" : {
  "tier0": [
    {
      "category" : "stool",
      "count" : 3
    },
    {
      "category" : "table",
      "count" : 5
    }
  ],
  "tier1": [
    {
      "category" : "stool",
      "count" : 1
    }
  ]
},

Required categories is actually not a list but a blob. It contains properties for each tier of the totem is to be influenced. The first tier is "tier0", the second tier is "tier1" etc. In each of these tiers is a list of category names. It will look for a certain number of items that have the "category" specified in their name. If at least the number in "count" exist then this part succeeds. If all succeed then this tier is complete. Feel free to play around with this to get a feel for it.

The second one is required objects. This one acts pretty much the same as the required categories one, except that it looks for specific tiles and tileObjects, with a specific code. This is great for making sure a very specific object is included. It will normally look like;

"requiredObjects" : {
  "tier1": [
    {
      "code" : "staxel.tileObject.office.OfficeChair",
      "count" : 1
    }
  ]
}

This also shows off that you can completely skip tiers. Feel free to play around with this as well.

The last one for this tutorial is required Buildings. Required buildings is also fairly similar to required categories and required objects. This time the code points to another totem altogether. Alongside the code is a new property named "tier". This is a check that the building is this tier or higher.

"requiredBuildings" : {
  "tier1": [
    {
      "code" : "staxel.totem.workplace.Patisserie",
      "tier" : 1
    },
    {
      "code" : "staxel.totem.workplace.FishingSpot",
      "tier" : 0
    }
  ]
},

As with all others feel free to experiment.

With this, you have created a totem. Now all you need to do is let a tile have a totem component with this totem and your good to go.


Creating a Shop

[To be done when Treasures is complete]


Config Options

"code"

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

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


A string containing the code of the totem the blob will be referring to.

"centreOffset"

Valid options (Vector 3 - Integer): { "x": 0, "y": 0, "z":0 }

Default Value: If not specified, leaves the totem in the center of the area.


This is how many tiles it will offset the totem from the centre of the search area. So offsetting the totem by 1,1,1 will move it one tile upwards, one tile forwards and one tile to the side.


"region"

Valid options (Vector 3 - Integer): { "x": 0, "y": 0, "z":0 }

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


This is how large the area it will search. It extends the number in every direction, that is if you have an x of 3, it will go between -3 and 3 (Crossing 7 tiles).


"requiredBuildings"

This is a Blob that contains Blobs which are named "tier0", "tier1" etc. It can have any of the numbers up to but not including the number specified by "tiers". (i.e. If tiers is 2, then you can put "tier0" and "tier1" but not any other numbers). For each tier, the requirements must be met for this tier and lower.

"requiredBuildings" : {
  "tier1": [
    {
      "code" : "staxel.totem.workplace.Patisserie",
      "tier" : 1
    },
    {
      "code" : "staxel.totem.workplace.FishingSpot",
      "tier" : 0
    }
  ]
},

As a note, this is note needed. You do not need to tie any tiers to any other buildings, but doing so can be a good way to force progress. (A smelter could need a mine for example.)

"code"

Valid options (String): A string which contains the code of another item.

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


This is the totem that it will search for in the village.


"tier"

Valid options (Integer): A positive integer value.

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


This is the minimum tier the totem must be before this totem's tier can be met.


"requiredCategories"

This is a Blob that contains Blobs which are named "tier0", "tier1" etc. It can have any of the numbers up to but not including the number specified by "tiers". (i.e. If tiers is 2, then you can put "tier0" and "tier1" but not any other numbers). For each tier, the requirements must be met for this tier and lower.

"requiredCategories" : {
  "tier0": [
    {
      "category" : "stool",
      "count" : 3
    },
    {
      "category" : "table",
      "count" : 5
    }
  ],
  "tier1": [
    {
      "category" : "stool",
      "count" : 1
    }
  ]
},

You do not need to tie any tiers to any categories, but this will be the most used property in tiles. (You don't care what table is place, just that a table is placed for example.)

"category"

Valid options (String): Any valid string.

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


This is the category it will search for in all the tiles in the area.


"count"

Valid options (Integer): A positive integer value.

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


This is the number of these tiles it must have before allowing the tier goals to be met.


"requiredObjects"

This is a Blob that contains Blobs which are named "tier0", "tier1" etc. It can have any of the numbers up to but not including the number specified by "tiers". (i.e. If tiers is 2, then you can put "tier0" and "tier1" but not any other numbers). For each tier, the requirements must be met for this tier and lower.

"requiredObjects" : {
  "tier0": [
    {
      "code" : "staxel.tile.glass",
      "count" : 3
    },
    {
      "category" : "staxel.tile.wood",
      "count" : 5
    }
  ],
  "tier1": [
    {
      "category" : "staxel.tile.stool",
      "count" : 1
    }
  ]
},

You do not need to tie any tiers to any objects, but this is useful for making sure a very specific object is placed. (You want to make sure a baking station is placed for example.)


"code"

Valid options (String): A string which contains the code to a Tile.

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


This is the exact tile it will search for in all the tiles in the area.


"count"

Valid options (Integer): A positive integer value.

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


This is the number of these tiles it must have before allowing the tier goals to be met.


"requiresRoof"

Valid options (Bool): True or False

Default Value: False.


Whether the totem requires a roof before any tier can be reached.


"shopGoods"

This is a Blob that contains Blobs which are named "tier0", "tier1" etc. It can have any of the numbers up to but not including the number specified by "tiers". (i.e. If tiers is 2, then you can put "tier0" and "tier1" but not any other numbers). For each tier, the requirements must be met for this tier and lower.

"shopGoods" : {
  "tier0": [
    {
      "dock": "staxel.tileObject.shop.ShopShelfMerchant",
      "treasures": [
        {
          "code": "staxel.treasure.storeShelf.BuildingStoreCarpet",
          "count": 1
        },
        {
          "code": "staxel.treasure.storeShelf.BuildingStoreHappyBricks",
          "count": 2
        }
      ],
    }
  ]
},

These are the shop goods that will be available after the tier has been met.


"dock"

Valid options (String): A string which contains the code to a Tile.

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


This is the tile needed in order to store the treasures listed below.


"treasures"

This is a List of Blobs that contain the Treasure Pools for the selected dock. This commonly looks like;

"treasures": [
  {
    "code": "staxel.treasure.storeShelf.BuildingStoreCarpet",
    "count": 1
  },
  {
    "code": "staxel.treasure.storeShelf.BuildingStoreHappyBricks",
    "count": 2
  }
],

"code"

Valid options (String): A string which contains the code to a Treasure Pool.

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


This is the treasure to be used in order to fill the selected dock.


"count"

Valid options (Integer): A positive integer value.

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


How many tiles should contain this treasure.


"tiers"

Valid options (Integer): A number that is 0 or greater

Default Value: No default value. Must be specified.


This is how many tiers the totem will have. It will not check for tiers higher than this number. (i.e. If you have tiers = 2, it will check for "tier0","tier1" but will not check "tier2" etc.)


"villagerSpawner"

Valid options (Integer): A code that points to a [Tiles|Tile] that is a villager spawner.

Default Value: Can be omitted. Will not spawn any villagers.


This will place the tile in question and spawn villagers on a night transition or at some other times.