LuaGlobals: Describe TemplateFilter and TemplateNumber
authorWuzzy
Mon, 20 May 2019 20:44:02 +0100
changeset 1896 3b924ec68ec5
parent 1895 93f8269fca27
child 1897 1d24131414e3
LuaGlobals: Describe TemplateFilter and TemplateNumber
LuaGlobals.wiki
--- a/LuaGlobals.wiki	Mon May 20 19:57:32 2019 +0100
+++ b/LuaGlobals.wiki	Mon May 20 20:44:02 2019 +0100
@@ -76,8 +76,8 @@
 || `Seed` || `0` || Seed of the random number generator ||
 || `LandDigest` || _N/A_ || Digest for the current map. Only meant for internal use by Hedgewars ||
 || `MapGen` || `mgRandom` || Type of map generator. One of `mgRandom`, `mgMaze`, `mgPerlin`, `mgDrawn`. ||
-|| `TemplateFilter` || `0` || _unknown meaning_ ||
-|| `TemplateNumber` || `0` || _unknown meaning_ ||
+|| `TemplateNumber` || `0` || This is the number of the land template for random map generators like `mgRandom`. A land template is a rule set for random maps. Maps generated with the same template look similar. You can see the land template number in console when you generate a new random map in the frontend. ||
+|| `TemplateFilter` || `0` || Used for the random map generator (`mgRandom`). This is the number of the template filter to be used. template filter is a grouping of multiple land templates. This corresponds directly to the map size/type selection in the frontend (e.g. Small/Medium/Large/Cavern/Wacky).
 || `MapFeatureSize` || `50` (`12` in 1.0.0) || Used by random maps to determine its “curvyness” or complexity. This value can be set by the user with the slider under the random map preview in the game setup screen. The user-set value ranges from 1 (leftmost position) to 25 (rightmost position). A good starting value is `12`. ||
 || `GameFlags` || `0` || All `GameFlags` combined as a bitmask. Setting `GameFlags` directly is discouraged, use the [LuaGameplay#GameFlags_functions GameFlags functions] instead ||
 || `Ready` || `5000` || Ready timer at the start of the turn (in milliseconds) ||
@@ -105,6 +105,30 @@
 
 The proper way to disable Sudden Death is by setting both `WaterRise` and `HealthDecrease` to `0`.
 
+== <tt>!TemplateFilter</tt> ==
+Depending on the map type (`MapGen`), the meaning of `TemplateFilter` differs:
+
+=== Random maps (`mgRandom`) ===
+|| *Template filter number* || *Generated maps* ||
+|| `0` || All ||
+|| `1` || Small ||
+|| `2` || Medium ||
+|| `3` || Large ||
+|| `4` || Cavern ||
+|| `5` || Wacky ||
+
+=== Perlin maps (`mgPerlin`) and maze maps (`mgMaze`) ===
+|| *Template filter number* || *Generated maps* ||
+|| `0` || Small tunnels ||
+|| `1` || Medium tunnels ||
+|| `2` || Large tunnels ||
+|| `3` || Small islands ||
+|| `4` || Medium islands ||
+|| `5` || Large islands ||
+
+=== Other map generators ===
+It doesn't matter.
+
 == <tt>!WorldEdge</tt> ==
 The value of `WorldEdge` can have the following values: