A Lua script for MechanicalMind/melonbomber that loads maps from bitmap files
- Create the folder
garrysmod/data/melonbomber
. This is where bitmap data goes. - Create the folder
garrysmod/lua/melonbomber/maptypes
. This is where your custom maptype scripts go. (See this page) - Copy
gridmap.lua
togarrysmod/lua/includes/modules
Maps are given as plaintext files. For example:
bbbbbbbb
b b
b b
b b
bbbbbbbb
This creates a boring arena with a section of boxes in the corner.
The allowed characters are:
b
: boxw
: wallh
: hard boxe
: explosive box
Save your map file to garrysmod/data/melonbomber/my_map.txt
.
require("gridmap")
map.name = "MyMap"
map.description = "My custom map"
function map:generateMap(grid)
map = gridmap.load_map_data("melonbomber/my_map.txt")
gridmap.generate(grid, map)
end
Save the contents of this file to garrysmod/lua/melonbomber/maptypes/my_map.lua