154 | | The functions and data provided in wall_builder.js allow easy placements of multiple entities to shape walls: |
| 154 | The functions and data provided in wall_builder.js allow easy placements of multiple entities to shape walls. |
| 155 | The style of a wall is defined by a wall style string for example like the civ strings ('cart' or 'celt') or other descriptive strings ('palisades' or 'romeSiege'). |
| 156 | To provide easy placement of fortresses there are some predefined ones commonly chosen by a string describing their size (like map sizes) for example 'tiny' or 'veryLarge'. |
| 157 | The concept includes 'wall elements' that are commonly chosen by strings like 'wall', 'tower', 'gate' etc. (see WallElement class definition for more documentation). |
| 158 | Wall elements are merged in an array that then defines a 'wall' or a 'wall part'. |
| 159 | This walls can then be placed with the functions. |
| 160 | The most simple placement methods are: |
| 161 | * 'placeWall()': Function to place a simple wall defined by a 'wall' array starting with the first wall element placed as coordinates and angle given. |
| 162 | * 'placeFortress()': Places a default fortress by it's fortress name string centered at the given coordinates with its entrance facing 'orientation'. |
| 163 | * 'placeLinearWall()': Places a wall from start X/Y to target X/Y with repeated usage of the given 'wall part'. |
| 164 | * 'placeCircularWall()': Places a wall circle centered at the given coordinates with a given radius and repeated usage of the given 'wall part'. |
| 165 | Other functions are in there helpful to generate custom walls and fortresses: |
159 | | * 'placeWall()': Function to place a simple wall defined by a 'wall' array of wall element name strings (like ['tower', 'wall', ...]) starting with the first tile placed at given x/z at the given angle. |
160 | | * 'placeFortress()': Places a default fortress by it's fortress name string like used as key in fortressTypes. |
161 | | * 'placeLinearWall()': Places a wall from start X/Y to target X/Y with the wall elements given in wallPart (like ['tower', 'wall']). |
162 | | * 'placeCircularWall()': Places a circle of wall elements centered at the given coordinates with a given radius including the wall elements given in wallPart (like ['tower', 'wall']). |
163 | | Some other functions are in there helpful to generate custom walls of any type but the mentioned ones should cover the common case. |