Blue boxes show 5x5 random zone and the missing tiles is just tiles ive not made yet but its fully random and only one of each.
If anyone is interested in having mutiple static maps randomly assigned to a few locations then i will leave the map file i made with comments.
Code: Select all
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011, 2012 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org L
-- Table contains all the possible maps to be used. all 5x5
myTable = { "zones/akarastent", "zones/blacksmith", "zones/gheedscart", "zones/wasteland" }
--tile defines
defineTile("A", "WOODWALL1")
defineTile("B", "WOODWALL2")
defineTile("C", "WOODWALLSTART")
defineTile("D", "WOODWALLEND")
defineTile("E", "WOODWALLCORNER1")
defineTile("F", "WOODWALLCORNER2")
defineTile("G", "WOODWALLCORNER3")
defineTile("H", "WOODWALLCORNER4")
defineTile("I", "MLTENT1", nil, "KASHYA", nil, def)
defineTile("J", "MLTENT2")
defineTile("K", "MLTENT3")
defineTile("L", "MLTENT4")
defineTile("M", "MLTENT5")
defineTile("N", "MLTENT6")
defineTile("O", "MLTENT7")
defineTile("P", "MLTENT8")
defineTile("Q", "MLTENT9")
defineTile("R", "ROCKFEATL")
defineTile("S", "ROCKFEATR")
defineTile("T", "ACT1STASH")
defineTile("U", "GRASSTPON")
defineTile("V", "COBEND1")
defineTile("W", "COBEND2")
defineTile("X", "COBCORNER1")
defineTile("Y", "COBEND3")
defineTile("Z", "COBEND4")
defineTile("1", "COBCORNER3")
defineTile("2", "MTENT1")
defineTile("3", "MTENT2")
defineTile("4", "MTENT3")
defineTile("5", "MTENT4")
defineTile("6", "CART1")
defineTile("7", "DIRT")
defineTile("8", "CAMPFIRE")
defineTile("9", "DIRT", nil, "WARRIV", nil, def)
defineTile("?", "DIRT", nil, "DECKARD", nil, def)
defineTile("#", "WALL")
defineTile("+", "LOCK")
defineTile(".", "GRASS")
defineTile("-", "FLOOR")
startx = 7
starty = 1
endx = 1
endy = 1
--Randomly select a possible map
subgen1 = math.random(table.getn(myTable))
--Now find which one it matches
choice = myTable[subgen1]
table.remove(myTable, subgen1) --Remove that mapfrom the list if you do not want the same map to appear at another location
subGenerator{
x = 2, y = 2, w = 5, h = 5, --location.
generator = "engine.generator.map.Static",
data = {
map = choice, --load from our 'choice' var
zoom = 5,
},
}
--exactly the same again.
subgen2 = math.random(table.getn(myTable))
--Now find which one it matches
choice = myTable[subgen2]
table.remove(myTable, subgen2) --Remove that mapfrom the list if you do not want the same map to appear at another location
subGenerator{
x = 17, y = 2, w = 5, h = 5, --location.
generator = "engine.generator.map.Static",
data = {
map = choice, --load from our 'choice' var
zoom = 5,
},
}
--exactly the same again.
subgen3 = math.random(table.getn(myTable))
--Now find which one it matches
choice = myTable[subgen3]
table.remove(myTable, subgen3) --Remove that mapfrom the list if you do not want the same map to appear at another location
subGenerator{
x = 17, y = 12, w = 5, h = 5, --location.
generator = "engine.generator.map.Static",
data = {
map = choice, --what ever our subgen is.
zoom = 5,
},
}
--since ive removed from the list only 1 remains. else ud do the same as the last one.
choice = myTable[1]
subGenerator{
x = 2, y = 12, w = 5, h = 5, --location.
generator = "engine.generator.map.Static",
data = {
map = choice, --what ever our subgen is.
zoom = 5,
},
}
-- ASCII map section
return [[
FAAAAAAAAAAAAAAAAAAAAAAE
B......................B
B.#####.RS.OPQ...#####.B
B.#####....LMN.U.#####.B
B.#####....IJK...#####.B
B.#####.XV..7....#####.B
B.#####.WT..7....#####.B
C777777.....7...7777777C
.7.D..7....97?..7...D.7.
77.B6.77777787777.6.B.77
...C.......777......C...
D............7.........D
B.#####...23.7.Y.#####.B
B.#####...45.7Z1.#####.B
B.#####......7...#####.B
B.#####..........#####.B
B.#####...RS..6..#####.B
B......................B
GAAAAAAAAAAAAAAAAAAAAAAH]]