# HG changeset patch # User almikes@aol.com # Date 1417581286 0 # Node ID d2f4b5b9b77c63ae98584e0c8e833c553d16686f # Parent dbb7937903a44e35fc421e5b50944c28c770b793 Add AddPoint and FlushPoints. diff -r dbb7937903a4 -r d2f4b5b9b77c LuaAPI.wiki --- a/LuaAPI.wiki Wed Dec 03 04:11:08 2014 +0000 +++ b/LuaAPI.wiki Wed Dec 03 04:34:46 2014 +0000 @@ -84,11 +84,11 @@ * Map = "Bamboo" - the map being played * Theme = "Bamboo" - the theme to be used * Ready = 5000 - the ready timer at the start of the round - * !MapGen + * !MapGen - type of map generator. One of `mgRandom`, `mgMaze`, `mgPerlin`, `mgDrawn`. * !TemplateFilter * Goals = "Jumping is disabled" - if you want to add info to the game mode dialog, use "|" to separate lines -If you want to add teams or hogs manually you have to do it here. +If you want to add teams or hogs manually you have to do it here. If you want to draw your own map using `AddPoint` and `FlushPoints`, you have to do this within this function as well. === onGameStart() === @@ -761,6 +761,17 @@ * 7: long, increasing right + +==== !AddPoint(x, y [, width [, erase] ]) (0.9.21) ==== +This function is used to draw your own maps using Lua. The maps drawn with this are of type “hand-drawn”. + +The function takes a `x`,`y` location, a `width` (means start of a new line) and `erase` (if `false`, this function will draw normally, if `true`, this function will erase drawn stuff). + +This function must be called within `onGameInit`, where `MapGen` has been set to `mgDrawn`. You also should call `FlushPoints` when you are finished with drawing. + +==== !FlushPoints() (0.9.21) ==== +Makes sure that all the points/lines specified using `AddPoint` are actually applied to the map. This function must be called within `onGameInit`. + === Current hedgehog === ==== !GetCurAmmoType() (0.9.16) ====