Changes between Version 10 and Version 11 of Rmgen_Library


Ignore:
Timestamp:
Mar 23, 2012, 4:36:26 PM (12 years ago)
Author:
O.Davoodi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Rmgen_Library

    v10 v11  
    2323 * `setHeight(x, z, height)`: Manually set the terrain height for tile (x,z).
    2424 * `getHeight(x, z)`: Returns height of tile (x,z).
     25 * `getTerrainTexture(x, y)`: Returns terrain texture of tile (x,z).
    2526
    2627Note: By default the height map refers to the corners of the terrain grid, so is one unit larger in both directions.  Setting TILE_CENTERED_HEIGHT_MAP = true; makes the height map define the height of the centres of each terrain grid square (interpolated to the corners at the export stage).
     
    125126To create a tile class call `createTileClass()` which will return a new integer ID. Store the ID in a variable for future reference. If you want to get the tile class object, call `getTileClass(id)` and it will return the object or `undefined` if the ID was invalid.
    126127
    127 Points can be added individually to a tile class with `addToClass(x, z, id)`. In practice this would be tedious, and one advantage of areas is they allow a simple representation of points. There is a special area painter just for this purpose, `TileClassPainter(tileClass)`. This could be used directly if you have a tile class object, but more common is using the `paintClass(id)` helper function, which will return a `TileClassPainter` matching the given ID.
     128Points can be added individually to a tile class with `addToClass(x, z, id)`. In practice this would be tedious, and one advantage of areas is they allow a simple representation of points. There is a special area painter just for this purpose, `TileClassPainter(tileClass)`. This could be used directly if you have a tile class object, but more common is using the `paintClass(id)` helper function, which will return a `TileClassPainter` matching the given ID. For removing tiles from a tile class, you can use `unPaintClass(id)` or `TileClassUnPainter` in a similar way. You can also check if a tile is in a class by using `checkIfInClass(x, z, id)` function.
    128129
    129130== Controlling Placement: Constraints ==
     
    185186 * `randFloat(minValue, maxValue)`: Returns a random floating-point number between `minValue` (inclusive) and `maxValue` (exclusive).
    186187 * `chooseRand(...)`: Returns one of its arguments at random (takes any number of arguments).
    187  * `createStartingPlayerEntities(x, z, playerid, civEntities, BUILDING_ANGlE)`: Creates starting player entities of a selected player in the given coordinates.
     188 * `getDistance(x1, z1, x2, z2)`: Function to get the distance between 2 points
    188189
    189190== Random Biome System ==
     
    223224  * "13":Large metal mine
    224225
    225  * `rBiomeAn()`: "n" in the end of the function can be any number from 1 to 8. Returns the n'th actor of the current set. For example rBiomeA3() returns the third actor of the set which is reserved for water reeds. These actors are used for:
     226 * `rBiomeAn()`: "n" in the end of the function can be any number from 1 to 9. Returns the n'th actor of the current set. For example rBiomeA3() returns the third actor of the set which is reserved for water reeds. These actors are used for:
    226227  * "1-2":Grass
    227228  * "3-4":Water decoration
    228229  * "5-6":Stones
    229230  * "7-8":Bushes
     231  * "9":Tree actors. Used as eyecandy for unreachable areas (eg: hilltops)
     232
     233== Other Helpers ==
     234
     235 * `createStartingPlayerEntities(x, z, playerid, civEntities, BUILDING_ANGlE)`: Creates starting player entities of a selected player in the given coordinates.
     236 * `passageMaker(x1, z1, x2, z2, width, maxheight, height, smooth, tileclass, terrain)`: Function for creating shallow water between two given points
     237 * `paintTerrainBasedOnHeight(minheight, maxheight, mode, terrain)`: Paints the tiles which have a height between minheight and maxheight with the given terrain
     238 * `paintTileClassBasedOnHeight(minheight, maxheight, mode, tileclass)`: Paints the tiles which have a height between minheight and maxheight with the given tile class
    230239
    231240== Script Library ==