Modding:Tiles: Difference between revisions

2,360 bytes added ,  23:59, 16 November 2020
no edit summary
m (link to palette file info)
No edit summary
Line 114: Line 114:
}
}
</syntaxhighlight>
</syntaxhighlight>
== Painted Tiles ==
Walls, fences, and liquids are "painted" tiles. This basically means that the game analyzes whether they are connected to other similar walls, fences, or liquids, and then selects an appropriate tile for them based on how they connect to adjacent squares. For example, you can see that the corners of the following wall look different than the horizontal parts of the wall, and those look different than the vertical segments of the wall.
[[File:Modding_wall_tile_example.png]]
To create proper walls, fences, and liquids, you must supply files that end in the expected suffixes that will be constructed by the game code when it paints them.
* Walls and liquids use the filename suffix format <code>-00000000</code>, where each digit may be a zero or a one. The digits indicate whether there is a connecting wall in each of the 8 adjacent cells, starting from the Northern cell and working clockwise. For example, a wall tile within a horizontal segment that has a wall both to the west and the east would use the filename suffix <code>-00100010</code>. To properly create a complete wall or liquid that can be rendered in all possible configurations, you must have 256 individual wall sprites using all combinations of 0 and 1 in the filename suffix.
* Fences are similar but only allow connecting with the cardinal directions (N/S/E/W). They use the filename suffix format <code>_nsew</code>, with the cardinal direction letters always appearing in that direction. For example, a fence in a horizontal fence segment with a fence to its west and to its east uses the suffix <code>_ew</code>. A single fence tile with no connections uses the <code>_</code> suffix. To properly create a complete fence that can be rendered in all possible configurations, you must have 16 individual fence sprites using all possible combinations of 0-4 cardinal directions.
To make it a bit easier to create the full set of required wall or fence tiles, you can use [https://bitbucket.org/bbucklew/imageslicer the ImageSlicer utility] created by one of the {{gamename}} developers.
* For walls, this utility expects a 5x5 tile image of walls in the following configuration:<br>[[File:Modding_wall_tile_example.png]]
* For fences, this utility expects a 5x5 tile image of fences in the following configuration:<br>[[File:Modding_fence_tile_example.png]]


==See Also==
==See Also==