This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Changes between Version 17 and Version 18 of Random_Map_Generator


Ignore:
Timestamp:
05/28/24 21:03:30 (3 months ago)
Author:
phosit
Comment:

Remove "Initialize the library" because of [20995]; convert "Save the results" to "GenerateMap generator" because of [28093]

Legend:

Unmodified
Added
Removed
Modified
  • Random_Map_Generator

    v17 v18  
    2525A random map script should first load any libraries it will need. Libraries are stored in the game data directories under `maps/random/libraryName/`. When a library is loaded, all scripts in that directory are parsed and their code made available to the random map script. They are loaded through the function call `Engine.LoadLibrary(libraryName)`.
    2626
    27 === Initialize the library ===
     27=== !GenerateMap generator ===
    2828
    29 The next step is to initialize the library. This may vary, but for rmgen, you would call `InitMap()`.
    30 
    31 === Save the results ===
    32 
    33 The random map script should end with a call to `Engine.ExportMap(data)`, which returns all the map data back to the engine. In rmgen this is abstracted by a call to `ExportMap()`. For the exact format of the data see [wiki:Random_Map_Generator_Internals Random Map Generator Internals].
    34 
    35 '''Note:''' The export map function does a coordinate conversion from the 2D used in the rmgen libs to 3D for the engine. You should only use it once, only after the map is fully generated.
     29The script has to implement a generator with the name !GenerateMap (like: `function* GenerateMap(mapSettings)`. Normally the whole map computation is done in this function. The function get's the map settings as an argument and has to `return` the map. It can repeatetly `yield` the progress (a number from 1 to 100) to update the progress bar. See [wiki:Random_Map_Generator_Internals Random Map Generator Internals] for more details.
    3630
    3731=== Design Tips and Conventions ===