Changes between Version 19 and Version 20 of Rmgen_Library


Ignore:
Timestamp:
Apr 20, 2012, 12:38:08 PM (12 years ago)
Author:
FeXoR
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Rmgen_Library

    v19 v20  
    152152== Placing walls ==
    153153
    154 The functions and data provided in wall_builder.js allow easy placements of multiple entities to shape walls:
     154The functions and data provided in wall_builder.js allow easy placements of multiple entities to shape walls.
     155The 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').
     156To 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'.
     157The concept includes 'wall elements' that are commonly chosen by strings like 'wall', 'tower', 'gate' etc. (see WallElement class definition for more documentation).
     158Wall elements are merged in an array that then defines a 'wall' or a 'wall part'.
     159This walls can then be placed with the functions.
     160The 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'.
     165Other functions are in there helpful to generate custom walls and fortresses:
    155166 * 'WallElement()': Defines a wall element including its entity and a name string to easily access it.
    156  * 'Fortress()': Defines a fortress mainly by an array of wall element name strings.
    157  * 'wallStyles': An associative array that holds all default wall styles with the civ strings as keys (like 'cart' or 'celt') or other descriptive strings (like 'palisades' or 'romeSiege'). A wall style itself again is an associative array holding all the default wall elements with their name string as key (like 'wall' or 'tower').
     167 * 'Fortress()': Defines a fortress mainly by its 'wall' and a name string to easily access it.
     168 * 'wallStyles': An associative array that holds all default wall styles with the civ strings as keys (like 'cart' or 'celt') or other descriptive strings (like
     169'palisades' or 'romeSiege'). A wall style itself again is an associative array holding all the default wall elements with their name string as key (like 'wall' or 'tower').
    158170 * 'fortressTypes': An associative array that holds all default fortress types by a key that is mainly chosen like the map sizes (like 'tiny' or 'veryLarge').
    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.
    164171To see examples for the common methods look at the demo random map 'Wall Demo' (wall_demo.js).
    165172An example for placing a custom fortress can be found in 'Fortress' (fortress.js).