Changes between Version 20 and Version 21 of Rmgen_Library


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

--

Legend:

Unmodified
Added
Removed
Modified
  • Rmgen_Library

    v20 v21  
    152152== Placing walls ==
    153153
    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.
     154The functions and data provided in wall_builder.js allow easy placements of multiple entities to shape walls. fist some concepts used:
     155 * The 'wall style' is chosen 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 'fortresses' commonly chosen by a string describing their size (like map sizes) for example 'tiny' or 'veryLarge'.
     157 * 'Wall elements' 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'. Those walls can then be placed with the functions.
    160159The 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.
    162160 * 'placeFortress()': Places a default fortress by it's fortress name string centered at the given coordinates with its entrance facing 'orientation'.
    163161 * 'placeLinearWall()': Places a wall from start X/Y to target X/Y with repeated usage of the given 'wall part'.
    164162 * 'placeCircularWall()': Places a wall circle centered at the given coordinates with a given radius and repeated usage of the given 'wall part'.
     163 * 'placeWall()': Function to place a simple wall defined by a 'wall' array starting with the first wall element placed as coordinates and angle given.
    165164Other functions are in there helpful to generate custom walls and fortresses:
    166165 * 'WallElement()': Defines a wall element including its entity and a name string to easily access it.
     
    169168'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').
    170169 * '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').
     170 * 'getWallAlignment()': A function to get a walls 'alignment' that mainly includes everything needed to place all the wall's elements.
     171 * 'getWallCenter()': A function to get the 'center of mass' of a wall by giving its 'alignment' and returning the vector from the first element to the center.
    171172To see examples for the common methods look at the demo random map 'Wall Demo' (wall_demo.js).
    172173An example for placing a custom fortress can be found in 'Fortress' (fortress.js).