Map maker: Add support for optionally specifying base node

This commit is contained in:
ANAND 2019-10-09 11:46:51 +05:30
parent 31ba4286fe
commit c4e3683071
3 changed files with 4 additions and 2 deletions

View file

@ -64,6 +64,7 @@ Each map's metadata is stored in an accompanying .conf file containing the follo
* `author`: Author of the map. * `author`: Author of the map.
* `hint`: [Optional] Helpful hint or tip for unique maps, to help players understand the map. * `hint`: [Optional] Helpful hint or tip for unique maps, to help players understand the map.
* `rotation`: Rotation of the schem. [`x`|`z`] * `rotation`: Rotation of the schem. [`x`|`z`]
* `base_node`: [Optional] Technical name of node to be used for the team base.
* `schematic`: Name of the map's schematic. * `schematic`: Name of the map's schematic.
* `initial_stuff`: [Optional] Comma-separated list of itemstacks to be given to the player * `initial_stuff`: [Optional] Comma-separated list of itemstacks to be given to the player
on join and on respawn. on join and on respawn.

View file

@ -2,8 +2,8 @@ function ctf_map.place_base(color, pos)
-- Spawn ind base -- Spawn ind base
for x = pos.x - 2, pos.x + 2 do for x = pos.x - 2, pos.x + 2 do
for z = pos.z - 2, pos.z + 2 do for z = pos.z - 2, pos.z + 2 do
minetest.set_node({ x = x, y = pos.y - 1, z = z}, minetest.set_node({ x = x, y = pos.y - 1, z = z },
{name = "ctf_map:ind_cobble"}) { name = ctf_map.map.base_node or "ctf_map:ind_cobble" })
end end
end end

View file

@ -100,6 +100,7 @@ local function load_map_meta(idx, path)
screenshot = meta:get("screenshot"), screenshot = meta:get("screenshot"),
license = meta:get("license"), license = meta:get("license"),
others = meta:get("others"), others = meta:get("others"),
base_node = meta:get("base_node"),
schematic = path .. ".mts", schematic = path .. ".mts",
initial_stuff = initial_stuff and initial_stuff:split(","), initial_stuff = initial_stuff and initial_stuff:split(","),
treasures = treasures, treasures = treasures,