Difference between revisions of "Auto-Tiling"
DeamonHunter (Talk | contribs) (Initial commit.) |
DeamonHunter (Talk | contribs) (Initial commit.) |
||
Line 1: | Line 1: | ||
− | + | There are times where you would want a tile to change it's look depending on what other tiles are around it. It could be objects like roofing tiles or fences. And there are times where you want a tile to change the tiles around it, again like roofing and fences. Auto-Tiling will allow you to do the following; | |
+ | * Change the tile you are placing. | ||
+ | * Change tiles up to 2 blocks away from the tile. | ||
+ | * Block placing your tile unless certain conditions are met. | ||
− | + | ||
+ | = How to do Simple Stairs = | ||
+ | To start this tutorial off, you will need 3 [[Tiles]]. These tiles should look like; | ||
+ | |||
+ | [Currently Under Construction] | ||
+ | |||
+ | |||
+ | |||
+ | = Config Options = | ||
+ | An important thing to note, is that Auto-tiling is not by it's own. It must be placed within a [[Tile]]. Before you continue however, there is some information about "autoTileInfo" itself. | ||
+ | |||
+ | == "autoTileInfo" == | ||
+ | AutoTileInfo is the property which contains all the properties listed below. However this is being mentioned, due to a special condition. | ||
+ | |||
+ | AutoTileInfo is a [[Modding_Key_Terms#List|List]] of [[Modding_Key_Terms#Blob|Blobs]]. This means you can specify multiple different groups of autoTiling in the same tile. It will commonly look like; | ||
<pre> | <pre> | ||
"autoTileInfo" : [ | "autoTileInfo" : [ | ||
{ | { | ||
− | + | //Group 1 | |
− | "DirectionsToLookIn" : [ | + | }, |
− | + | { | |
− | + | //Group 2 | |
− | + | }, | |
− | + | { | |
− | + | //Group 3 | |
− | + | } | |
− | + | ] | |
− | + | ||
− | + | Another thing to note is that these groups are done in order, with higher groups going first. This can be taken advantage off and make simpler files, as later groups will override earlier results. Take a look at Rope Fence Corner to see this in action. | |
− | + | ||
− | + | ||
− | + | == "directionsToLookIn" == | |
− | + | This is yet another list of [[Modding_Key_Terms#List|List]] of [[Modding_Key_Terms#Blob|Blobs]]. It will commonly look like the following; | |
− | + | <pre> | |
− | + | "DirectionsToLookIn" : [ | |
− | + | { | |
− | + | "direction" : "", | |
− | + | "secondDirection" : "", | |
+ | "tilesToLookFor" : [], | ||
+ | "tileCategoriesToLookFor" : [], | ||
+ | "rotationToLookFor": 0 | ||
+ | }, | ||
+ | { | ||
+ | //Direction 2 | ||
+ | } | ||
+ | ], | ||
</pre> | </pre> | ||
+ | === "direction" === | ||
+ | '''Valid options ([[Modding_Key_Terms#String|String]]): <code>"right", "left", "front", "back", "up", "down", "none"</code>''' | ||
− | + | '''Default Value:''' No default value is specified. Always need to provide your own. | |
− | + | ||
− | ''' | + | |
− | + | This is the direction that it will check first. That is, if you say "right" it will check the tile to the right. | |
− | + | === "rotationToLookFor" === | |
− | '''Valid options ( | + | '''Valid options ([[Modding_Key_Terms#Integer|Integer]] ): <code>0,1,2 or 3</code>''' |
− | + | '''Default Value:''' If not specified, will not care about rotation. | |
− | ===== " | + | If the tile that is searched, the one specified with [[#"direction"]] and [[#"secondDirection"]], has this specific rotation, then proceed to [[#"results"]]. Otherwise reject it. |
− | '''Valid options (String): <code> | + | |
+ | |||
+ | === "secondDirection" === | ||
+ | '''Valid options ([[Modding_Key_Terms#String|String]]): <code>"right", "left", "front", "back", "up", "down", "none"</code>''' | ||
+ | |||
+ | '''Default Value:''' If not specified, will default to "none". | ||
+ | |||
+ | This is the direction that will check second. This will force the checked tile to be one further That is, if you say "right" for direction, then "right" for secondDirection it will check the tile, two tiles to the right. | ||
+ | |||
+ | |||
+ | === "tileCategoriesToLookFor" === | ||
+ | '''Valid options ([[Modding_Key_Terms#List|List]] of [[Modding_Key_Terms#String|String]] ): <code>A list of any valid strings.</code>''' | ||
+ | |||
+ | '''Default Value:''' If not specified, will not look for categories. Should specify either "tileCategoriesToLookFor" or "tilesToLookFor". | ||
+ | |||
+ | |||
+ | If the tile that is searched, the one specified with [[#"direction"]] and [[#"secondDirection"]], has any of these categories, then proceed to [[#"results"]]. (As long as it is not rejected.) | ||
+ | |||
+ | |||
+ | === "tileCategoriesToReject" === | ||
+ | '''Valid options ([[Modding_Key_Terms#List|List]] of [[Modding_Key_Terms#String|String]] ): <code>A list of any valid strings.</code>''' | ||
+ | |||
+ | '''Default Value:''' If not specified, will not look for categories. Should specify either "tileCategoriesToLookFor" or "tilesToLookFor". | ||
+ | |||
+ | |||
+ | If the tile that is searched, the one specified with [[#"direction"]] and [[#"secondDirection"]], has any of these categories, then reject going to [[#"results"]]. | ||
+ | |||
+ | |||
+ | === "tilesToLookFor" === | ||
+ | '''Valid options ([[Modding_Key_Terms#List|List]] of [[Modding_Key_Terms#String|String]] ): <code>A list of strings each containing the code to a [[Tile]].</code>''' | ||
+ | |||
+ | '''Default Value:''' If not specified, will not reject any tiles. | ||
+ | |||
+ | |||
+ | If the tile that is searched, the one specified with [[#"direction"]] and [[#"secondDirection"]], has a code in this list, then proceed to [[#"results"]]. (As long as it is not rejected.) | ||
+ | |||
+ | |||
+ | === "tilesToReject" === | ||
+ | '''Valid options ([[Modding_Key_Terms#List|List]] of [[Modding_Key_Terms#String|String]] ): <code>A list of strings each containing the code to a [[Tile]].</code>''' | ||
+ | |||
+ | '''Default Value:''' If not specified, will not reject any tiles. | ||
+ | |||
+ | |||
+ | If the tile that is searched, the one specified with [[#"direction"]] and [[#"secondDirection"]], has a code in this list, then reject going to [[#"results"]]. | ||
+ | |||
+ | |||
+ | == "lookFromOverride" == | ||
+ | '''Valid options ([[Modding_Key_Terms#String|String]]): <code>"right", "left", "front", "back", "up", "down", "none"</code>''' | ||
+ | |||
+ | '''Default Value:''' No default value is specified. Always need to provide your own. | ||
+ | |||
+ | This is set the central tile to work from. Both "direction" and "secondDirection" will work based off of this direction. | ||
+ | |||
+ | |||
+ | == "results" == | ||
+ | This is yet another list of [[Modding_Key_Terms#List|List]] of [[Modding_Key_Terms#Blob|Blobs]]. It will commonly look like the following; | ||
+ | <pre> | ||
+ | "results" : [ | ||
+ | { | ||
+ | "tileToPlace" : "", | ||
+ | "direction" : "", | ||
+ | "secondDirection" : "", | ||
+ | "rotation" : "" | ||
+ | }, | ||
+ | { | ||
+ | //Group 2 | ||
+ | } | ||
+ | ], | ||
+ | </pre> | ||
+ | |||
+ | === "alt" === | ||
+ | '''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>0, 1, 2 or 3</code>''' | ||
− | + | '''Default Value:''' If not specified, will place in a random alt. | |
− | + | This will be the number of the alternative look (alt) that the tile will have. | |
− | + | ||
− | |||
+ | === "tileToPlace" === | ||
+ | '''Valid options ([[Modding_Key_Terms#String|String]]): <code>A strings containing the code to a [[Tile]].</code>''' | ||
− | + | '''Default Value:''' If not specified, will place the the tile. | |
− | + | ||
− | + | This will be the tile that is placed in the place specified by [[#"direction"_2|#"direction"]] and [[#"secondDirection"_2|#"secondDirection"]]. | |
− | + | ||
− | |||
+ | === "direction" === | ||
+ | '''Valid options ([[Modding_Key_Terms#String|String]]): <code>"right", "left", "front", "back", "up", "down", "none"</code>''' | ||
− | + | '''Default Value:''' No default value is specified. Always need to provide your own. | |
− | ''' | + | |
− | This is | + | This is the direction that it will check first. That is, if you say "right" it will check the tile to the right. |
− | + | === "rotation" === | |
− | '''Valid options ( | + | '''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>0, 1, 2 or 3</code>''' |
− | If | + | '''Default Value:''' If not specified, will place in a random rotation. |
− | + | This will be the rotation that the tile is placed in. | |
− | This | + | |
− | |||
− | |||
− | + | === "secondDirection" === | |
+ | '''Valid options ([[Modding_Key_Terms#String|String]]): <code>"right", "left", "front", "back", "up", "down", "none"</code>''' | ||
− | + | '''Default Value:''' If not specified, will default to "none". | |
− | ''' | + | |
− | This is the | + | This is the direction that will check second. This will force the checked tile to be one further That is, if you say "right" for direction, then "right" for secondDirection it will check the tile, two tiles to the right. |
Revision as of 06:08, 29 August 2017
There are times where you would want a tile to change it's look depending on what other tiles are around it. It could be objects like roofing tiles or fences. And there are times where you want a tile to change the tiles around it, again like roofing and fences. Auto-Tiling will allow you to do the following;
- Change the tile you are placing.
- Change tiles up to 2 blocks away from the tile.
- Block placing your tile unless certain conditions are met.
Contents
How to do Simple Stairs
To start this tutorial off, you will need 3 Tiles. These tiles should look like;
[Currently Under Construction]
Config Options
An important thing to note, is that Auto-tiling is not by it's own. It must be placed within a Tile. Before you continue however, there is some information about "autoTileInfo" itself.
"autoTileInfo"
AutoTileInfo is the property which contains all the properties listed below. However this is being mentioned, due to a special condition.
AutoTileInfo is a List of Blobs. This means you can specify multiple different groups of autoTiling in the same tile. It will commonly look like;
"autoTileInfo" : [ { //Group 1 }, { //Group 2 }, { //Group 3 } ] Another thing to note is that these groups are done in order, with higher groups going first. This can be taken advantage off and make simpler files, as later groups will override earlier results. Take a look at Rope Fence Corner to see this in action. == "directionsToLookIn" == This is yet another list of [[Modding_Key_Terms#List|List]] of [[Modding_Key_Terms#Blob|Blobs]]. It will commonly look like the following; <pre> "DirectionsToLookIn" : [ { "direction" : "", "secondDirection" : "", "tilesToLookFor" : [], "tileCategoriesToLookFor" : [], "rotationToLookFor": 0 }, { //Direction 2 } ],
"direction"
Valid options (String): "right", "left", "front", "back", "up", "down", "none"
Default Value: No default value is specified. Always need to provide your own.
This is the direction that it will check first. That is, if you say "right" it will check the tile to the right.
"rotationToLookFor"
Valid options (Integer ): 0,1,2 or 3
Default Value: If not specified, will not care about rotation.
If the tile that is searched, the one specified with #"direction" and #"secondDirection", has this specific rotation, then proceed to #"results". Otherwise reject it.
"secondDirection"
Valid options (String): "right", "left", "front", "back", "up", "down", "none"
Default Value: If not specified, will default to "none".
This is the direction that will check second. This will force the checked tile to be one further That is, if you say "right" for direction, then "right" for secondDirection it will check the tile, two tiles to the right.
"tileCategoriesToLookFor"
Valid options (List of String ): A list of any valid strings.
Default Value: If not specified, will not look for categories. Should specify either "tileCategoriesToLookFor" or "tilesToLookFor".
If the tile that is searched, the one specified with #"direction" and #"secondDirection", has any of these categories, then proceed to #"results". (As long as it is not rejected.)
"tileCategoriesToReject"
Valid options (List of String ): A list of any valid strings.
Default Value: If not specified, will not look for categories. Should specify either "tileCategoriesToLookFor" or "tilesToLookFor".
If the tile that is searched, the one specified with #"direction" and #"secondDirection", has any of these categories, then reject going to #"results".
"tilesToLookFor"
Valid options (List of String ): A list of strings each containing the code to a Tile.
Default Value: If not specified, will not reject any tiles.
If the tile that is searched, the one specified with #"direction" and #"secondDirection", has a code in this list, then proceed to #"results". (As long as it is not rejected.)
"tilesToReject"
Valid options (List of String ): A list of strings each containing the code to a Tile.
Default Value: If not specified, will not reject any tiles.
If the tile that is searched, the one specified with #"direction" and #"secondDirection", has a code in this list, then reject going to #"results".
"lookFromOverride"
Valid options (String): "right", "left", "front", "back", "up", "down", "none"
Default Value: No default value is specified. Always need to provide your own.
This is set the central tile to work from. Both "direction" and "secondDirection" will work based off of this direction.
"results"
This is yet another list of List of Blobs. It will commonly look like the following;
"results" : [ { "tileToPlace" : "", "direction" : "", "secondDirection" : "", "rotation" : "" }, { //Group 2 } ],
"alt"
Valid options (Integer): 0, 1, 2 or 3
Default Value: If not specified, will place in a random alt.
This will be the number of the alternative look (alt) that the tile will have.
"tileToPlace"
Valid options (String): A strings containing the code to a Tile.
Default Value: If not specified, will place the the tile.
This will be the tile that is placed in the place specified by #"direction" and #"secondDirection".
"direction"
Valid options (String): "right", "left", "front", "back", "up", "down", "none"
Default Value: No default value is specified. Always need to provide your own.
This is the direction that it will check first. That is, if you say "right" it will check the tile to the right.
"rotation"
Valid options (Integer): 0, 1, 2 or 3
Default Value: If not specified, will place in a random rotation.
This will be the rotation that the tile is placed in.
"secondDirection"
Valid options (String): "right", "left", "front", "back", "up", "down", "none"
Default Value: If not specified, will default to "none".
This is the direction that will check second. This will force the checked tile to be one further That is, if you say "right" for direction, then "right" for secondDirection it will check the tile, two tiles to the right.