always adjust height to terrain for new village type 'single'; added pseudo-village type single; added nomirror option for buildings; removed obsolete size parameters from buildings.lua

master
Sokomine 2014-10-24 18:10:31 +02:00
parent 7c25dbcc3e
commit 1ca538da70
3 changed files with 138 additions and 114 deletions

View File

@ -29,82 +29,82 @@ mg_villages.medieval_subtype = false;
mg_villages.BUILDINGS = {
-- the houses the mod came with
{sizex= 7, sizez= 7, yoff= 0, ysize= 9, scm="house", orients={2}, weight={nore=1 }, inh=4},
{sizex= 9, sizez= 9, yoff= 0, ysize= 2, scm="wheat_field", weight={nore=1 }},
{sizex= 9, sizez= 9, yoff= 0, ysize= 2, scm="cotton_field", weight={nore=1 }},
{sizex= 3, sizez= 3, yoff= 1, ysize= 4, scm="lamp", no_rotate=true, weight={nore=1/5 }},
{sizex= 4, sizez= 4, yoff=-5, ysize=11, scm="well", no_rotate=true, pervillage=1, weight={nore=1 }},
{sizex= 7, sizez= 7, yoff= 0, ysize=11, scm="fountain", pervillage=3, weight={nore=1/4 }, axis=1},
{sizex= 5, sizez= 5, yoff= 0, ysize= 6, scm="small_house", orients={3}, weight={nore=1 }, axis=1, inh=2},
{sizex= 6, sizez=12, yoff= 0, ysize= 7, scm="house_with_garden", orients={1}, weight={nore=1 }, axis=1, inh=3},
{sizex=16, sizez=17, yoff= 0, ysize=12, scm="church", orients={3}, pervillage=1, weight={nore=1 }, axis=1, inh=-1},
{sizex= 5, sizez= 5, yoff= 0, ysize=16, scm="tower", orients={0}, weight={nore=1/7 }, inh=-1},
{sizex= 8, sizez= 9, yoff= 0, ysize= 6, scm="forge", orients={0}, pervillage=2, weight={nore=1 }, inh=-1},
{sizex=11, sizez=12, yoff= 0, ysize= 6, scm="library", orients={1}, pervillage=2, weight={nore=1 }, axis=1, inh=-1},
{sizex=15, sizez= 7, yoff= 0, ysize=12, scm="inn", orients={1}, pervillage=4, weight={nore=1/2 }, axis=1, inh=-1}, -- has room for 4 guests
{sizex=22, sizez=17, yoff= 0, ysize= 7, scm="pub", orients={3}, pervillage=2, weight={nore=1/3 }, axis=1, inh=-1},
{yoff= 0, scm="house", orients={2}, weight={nore=1, single=2 }, inh=4},
{yoff= 0, scm="wheat_field", weight={nore=1 }},
{yoff= 0, scm="cotton_field", weight={nore=1 }},
{yoff= 1, scm="lamp", no_rotate=true, weight={nore=1/5 }},
{yoff=-5, scm="well", no_rotate=true, pervillage=1, weight={nore=1 }},
{yoff= 0, scm="fountain", pervillage=3, weight={nore=1/4 }, axis=1},
{yoff= 0, scm="small_house", orients={3}, weight={nore=1, single=2 }, axis=1, inh=2},
{yoff= 0, scm="house_with_garden", orients={1}, weight={nore=1, single=2 }, axis=1, inh=3},
{yoff= 0, scm="church", orients={3}, pervillage=1, weight={nore=1 }, axis=1, inh=-1},
{yoff= 0, scm="tower", orients={0}, weight={nore=1/7, single=1 }, inh=-1},
{yoff= 0, scm="forge", orients={0}, pervillage=2, weight={nore=1, single=1/3 }, inh=-1},
{yoff= 0, scm="library", orients={1}, pervillage=2, weight={nore=1 }, axis=1, inh=-1},
{yoff= 0, scm="inn", orients={1}, pervillage=4, weight={nore=1/2, single=1/3 }, axis=1, inh=-1}, -- has room for 4 guests
{yoff= 0, scm="pub", orients={3}, pervillage=2, weight={nore=1/3, single=1/3 }, axis=1, inh=-1},
-- log cabins by Sokomine (requiring cottages, glasspanes)
{sizex= 6, sizez= 4, yoff= 0, ysize= 5, scm="logcabin1", orients={1}, weight={logcabin=1}, axis=1, inh=2},
{sizex= 6, sizez= 6, yoff= 0, ysize= 6, scm="logcabin2", orients={1}, weight={logcabin=1}, axis=1, inh=2},
{sizex= 6, sizez= 6, yoff= 0, ysize= 6, scm="logcabin3", orients={1}, weight={logcabin=1}, axis=1, inh=3},
{sizex= 5, sizez= 7, yoff= 0, ysize= 7, scm="logcabin4", orients={1}, weight={logcabin=1}, axis=1, inh=3},
{sizex= 5, sizez= 5, yoff= 0, ysize= 5, scm="logcabin5", orients={1}, weight={logcabin=1}, axis=1, inh=1},
{sizex= 5, sizez= 7, yoff= 0, ysize= 5, scm="logcabin6", orients={1}, weight={logcabin=1}, axis=1, inh=1},
{sizex= 7, sizez= 7, yoff= 0, ysize= 7, scm="logcabin7", orients={1}, weight={logcabin=1}, axis=1, inh=2},
{sizex= 5, sizez= 6, yoff= 0, ysize= 5, scm="logcabin8", orients={1}, weight={logcabin=1}, axis=1, inh=2},
{sizex= 5, sizez= 5, yoff= 0, ysize= 6, scm="logcabin9", orients={1}, weight={logcabin=1}, axis=1, inh=1},
{sizex= 5, sizez= 8, yoff= 0, ysize= 7, scm="logcabin10", orients={2}, weight={logcabin=1}, inh=3},
{sizex= 7, sizez= 10, yoff= 0, ysize= 7, scm="logcabin11", orients={2}, weight={logcabin=1}, inh=6},
{sizex= 7, sizez= 7, yoff= 0, ysize= 5, scm="logcabinpub1", orients={1}, weight={logcabin=1/6}, pervillage=1, typ='tavern', axis=1, inh=1}, -- +5 guests
{sizex= 7, sizez= 8, yoff= 0, ysize= 7, scm="logcabinpub2", orients={1}, weight={logcabin=1/6}, pervillage=1, typ='tavern', axis=1, inh=2}, -- +8 guests
{sizex= 7, sizez= 8, yoff= 0, ysize= 7, scm="logcabinpub3", orients={1}, weight={logcabin=1/6}, pervillage=1, typ='tavern', axis=1, inh=2}, -- +12 guest
{yoff= 0, scm="logcabin1", orients={1}, weight={logcabin=1, single=1}, axis=1, inh=2},
{yoff= 0, scm="logcabin2", orients={1}, weight={logcabin=1, single=1}, axis=1, inh=2},
{yoff= 0, scm="logcabin3", orients={1}, weight={logcabin=1, single=1}, axis=1, inh=3},
{yoff= 0, scm="logcabin4", orients={1}, weight={logcabin=1, single=1}, axis=1, inh=3},
{yoff= 0, scm="logcabin5", orients={1}, weight={logcabin=1, single=1}, axis=1, inh=1},
{yoff= 0, scm="logcabin6", orients={1}, weight={logcabin=1, single=1}, axis=1, inh=1},
{yoff= 0, scm="logcabin7", orients={1}, weight={logcabin=1, single=1}, axis=1, inh=2},
{yoff= 0, scm="logcabin8", orients={1}, weight={logcabin=1, single=1}, axis=1, inh=2},
{yoff= 0, scm="logcabin9", orients={1}, weight={logcabin=1, single=1}, axis=1, inh=1},
{yoff= 0, scm="logcabin10", orients={2}, weight={logcabin=1, single=1}, inh=3},
{yoff= 0, scm="logcabin11", orients={2}, weight={logcabin=1, single=1}, inh=6},
{yoff= 0, scm="logcabinpub1", orients={1}, weight={logcabin=1/6, single=1}, pervillage=1, typ='tavern', axis=1, inh=1}, -- +5 guests
{yoff= 0, scm="logcabinpub2", orients={1}, weight={logcabin=1/6, single=1}, pervillage=1, typ='tavern', axis=1, inh=2}, -- +8 guests
{yoff= 0, scm="logcabinpub3", orients={1}, weight={logcabin=1/6, single=1}, pervillage=1, typ='tavern', axis=1, inh=2}, -- +12 guest
-- grass huts (requiring cottages, dryplants, cavestuff/undergrowth, plantlife)
{sizex= 6, sizez= 6, yoff= 0, ysize= 5, scm="grasshut1", orients={2}, weight={grasshut=1}, inh=3},
{sizex= 9, sizez= 9, yoff= 0, ysize= 8, scm="grasshut2", orients={2}, weight={grasshut=1}, inh=10}, -- community hut for meetings
{sizex= 7, sizez= 7, yoff= 0, ysize= 7, scm="grasshut3", orients={2}, weight={grasshut=1}, inh=3},
{sizex= 7, sizez= 7, yoff= 0, ysize= 7, scm="grasshut4", orients={2}, weight={grasshut=1}, inh=3},
{sizex= 5, sizez= 5, yoff= 0, ysize= 6, scm="grasshut5", orients={2}, weight={grasshut=1}, inh=1},
{sizex= 5, sizez= 5, yoff= 0, ysize= 6, scm="grasshut6", orients={2}, weight={grasshut=1}, inh=3},
{sizex= 7, sizez= 7, yoff= 0, ysize= 2, scm="grasshutcenter", orients={2}, pervillage=1, weight={grasshut=2}}, -- open meeting place
{yoff= 0, scm="grasshut1", orients={2}, weight={grasshut=1, single=1}, inh=3},
{yoff= 0, scm="grasshut2", orients={2}, weight={grasshut=1, single=1}, inh=10}, -- community hut for meetings
{yoff= 0, scm="grasshut3", orients={2}, weight={grasshut=1, single=1}, inh=3},
{yoff= 0, scm="grasshut4", orients={2}, weight={grasshut=1, single=1}, inh=3},
{yoff= 0, scm="grasshut5", orients={2}, weight={grasshut=1, single=1}, inh=1},
{yoff= 0, scm="grasshut6", orients={2}, weight={grasshut=1, single=1}, inh=3},
{yoff= 0, scm="grasshutcenter", orients={2}, pervillage=1, weight={grasshut=2}}, -- open meeting place
-- for the buildings below, sizex, sizez and ysize are read from the file directly;
-- schematics from Sokomines villages mod (requires cottages)
{scm="church_1", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='church', weight={medieval=4}, pervillage=1, inh=-1},
{scm="church_1", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='church', weight={medieval=4 }, pervillage=1, inh=-1},
-- {scm="church_2_twoelk", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='church', weight={medieval=4}, pervillage=1},
{scm="forge_1", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='forge', weight={medieval=2}, pervillage=1, inh=-1},
{scm="mill_1", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='mill', weight={medieval=2}, pervillage=1, inh=-1},
{scm="hut_1", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='hut', weight={medieval=1}, inh=1},
{scm="hut_2", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='hut', weight={medieval=1}, inh=2},
{scm="farm_full_1", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4}, inh=2},
{scm="farm_full_2", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4}, inh=5},
{scm="farm_full_3", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4}, inh=5},
{scm="farm_full_4", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4}, inh=8},
{scm="farm_full_5", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4}, inh=5},
{scm="farm_full_6", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4}, inh=5},
{scm="farm_tiny_1", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1}, inh=2},
{scm="farm_tiny_2", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1}, inh=6},
{scm="farm_tiny_3", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1}, inh=4},
{scm="farm_tiny_4", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1}, inh=4},
{scm="farm_tiny_5", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1}, inh=4},
{scm="farm_tiny_6", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1}, inh=4},
{scm="farm_tiny_7", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1}, inh=7},
{scm="taverne_1", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='tavern', weight={medieval=1/2}, pervillage=1, inh=6}, -- 19 beds: 10 guest, 3 worker, 6 family
{scm="taverne_2", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='tavern', weight={medieval=1/2}, pervillage=1, inh=2}, -- no guests
{scm="taverne_3", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='tavern', weight={medieval=1/2}, pervillage=1, inh=2}, -- no guests
{scm="taverne_4", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='tavern', weight={medieval=1/2}, pervillage=1, inh=1}, -- no guests
{scm="forge_1", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='forge', weight={medieval=2, single=1/2}, pervillage=1, inh=-1},
{scm="mill_1", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='mill', weight={medieval=2 }, pervillage=1, inh=-1},
{scm="hut_1", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='hut', weight={medieval=1, single=1 }, inh=1},
{scm="hut_2", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='hut', weight={medieval=1, single=1 }, inh=2},
{scm="farm_full_1", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4, single=1 }, inh=2},
{scm="farm_full_2", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4, single=1 }, inh=5},
{scm="farm_full_3", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4, single=1 }, inh=5},
{scm="farm_full_4", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4, single=1 }, inh=8},
{scm="farm_full_5", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4, single=1 }, inh=5},
{scm="farm_full_6", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='farm_full', weight={medieval=1/4, single=1 }, inh=5},
{scm="farm_tiny_1", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1, single=1 }, inh=2},
{scm="farm_tiny_2", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1, single=1 }, inh=6},
{scm="farm_tiny_3", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1, single=1 }, inh=4},
{scm="farm_tiny_4", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1, single=1 }, inh=4},
{scm="farm_tiny_5", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1, single=1 }, inh=4},
{scm="farm_tiny_6", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1, single=1 }, inh=4},
{scm="farm_tiny_7", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='farm_tiny', weight={medieval=1, single=1 }, inh=7},
{scm="taverne_1", yoff= 0, orients={0}, farming_plus=1, avoid='', typ='tavern', weight={medieval=1/2, single=1 }, pervillage=1, inh=6}, -- 19 beds: 10 guest, 3 worker, 6 family
{scm="taverne_2", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='tavern', weight={medieval=1/2, single=1/3}, pervillage=1, inh=2}, -- no guests
{scm="taverne_3", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='tavern', weight={medieval=1/2, single=1/3}, pervillage=1, inh=2}, -- no guests
{scm="taverne_4", yoff= 0, orients={0}, farming_plus=0, avoid='', typ='tavern', weight={medieval=1/2, single=1/3}, pervillage=1, inh=1}, -- no guests
{scm="well_1", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12}, pervillage=4},
{scm="well_2", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12}, pervillage=4},
{scm="well_3", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12}, pervillage=4},
{scm="well_4", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12}, pervillage=4},
{scm="well_5", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12}, pervillage=4},
{scm="well_6", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12}, pervillage=4},
{scm="well_7", yoff= -1, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12}, pervillage=4},
{scm="well_8", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12}, pervillage=4},
{scm="well_1", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12, single=1/2}, pervillage=4},
{scm="well_2", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12, single=1/2}, pervillage=4},
{scm="well_3", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12, single=1/2}, pervillage=4},
{scm="well_4", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12, single=1/2}, pervillage=4},
{scm="well_5", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12, single=1/2}, pervillage=4},
{scm="well_6", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12, single=1/2}, pervillage=4},
{scm="well_7", yoff= -1, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12, single=1/2}, pervillage=4},
{scm="well_8", yoff= 0, orients={0}, farming_plus=0, avoid='well', typ='well', weight={medieval=1/12, single=1/2}, pervillage=4},
{scm="tree_place_1", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='village_square', weight={medieval=1/12}, pervillage=1},
{scm="tree_place_2", yoff= 1, orients={0}, farming_plus=0, avoid='', typ='village_square', weight={medieval=1/12}, pervillage=1},
@ -160,33 +160,33 @@ mg_villages.BUILDINGS = {
{scm="field_4", yoff=-2, orients={0,1,2,3}, farming_plus=0, avoid='field', typ='field', weight={medieval=1/6}, pervillage=8},
-- hut and hills for charachoal burners; perhaps they could live together with lumberjacks?
{scm="charachoal_hut", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='hut', weight={charachoal=1}, inh=2},
{scm="charachoal_hill", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='hut', weight={charachoal=2}, inh=-1},
{scm="charachoal_hut", yoff= 0, orients={0,1,2}, farming_plus=0, avoid='', typ='hut', weight={charachoal=1, single=5}, inh=2, nomirror=1},
{scm="charachoal_hill", yoff= 0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='hut', weight={charachoal=2 }, inh=-1, nomirror=1},
-- lumberjacks; they require the cottages mod
{scm="lumberjack_1", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1}, axis=1, inh=3},
{scm="lumberjack_2", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1}, axis=1, inh=4},
{scm="lumberjack_3", yoff= 1, orients={1,2,3}, avoid='', typ='lumberjack', weight={lumberjack=1}, inh=3},
{scm="lumberjack_4", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1}, axis=1, inh=4},
{scm="lumberjack_5", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1}, axis=1, inh=9},
{scm="lumberjack_6", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1}, axis=1, inh=5},
{scm="lumberjack_7", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1}, axis=1, inh=5},
{scm="lumberjack_8", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1}, axis=1, inh=9},
{scm="lumberjack_pub_1", yoff= 1, orients={1}, avoid='', typ='tavern', weight={lumberjack=3}, pervillage=1, axis=1, inh=-1},
{scm="lumberjack_1", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1, single=3}, axis=1, inh=3},
{scm="lumberjack_2", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1, single=3}, axis=1, inh=4},
{scm="lumberjack_3", yoff= 1, orients={1,2,3}, avoid='', typ='lumberjack', weight={lumberjack=1, single=3}, inh=3},
{scm="lumberjack_4", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1, single=3}, axis=1, inh=4},
{scm="lumberjack_5", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1, single=3}, axis=1, inh=9},
{scm="lumberjack_6", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1, single=3}, axis=1, inh=5},
{scm="lumberjack_7", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1, single=3}, axis=1, inh=5},
{scm="lumberjack_8", yoff= 1, orients={1}, avoid='', typ='lumberjack', weight={lumberjack=1, single=3}, axis=1, inh=9},
{scm="lumberjack_pub_1", yoff= 1, orients={1}, avoid='', typ='tavern', weight={lumberjack=3, single=1}, pervillage=1, axis=1, inh=-1},
{scm="lumberjack_church_1", yoff= 1, orients={1}, avoid='', typ='church', weight={lumberjack=3}, pervillage=1, axis=1, inh=-1},
{scm="lumberjack_hotel_1", yoff= 1, orients={1}, avoid='', typ='house', weight={lumberjack=1}, axis=1, inh=16}, -- all 16 are guests
{scm="lumberjack_hotel_1", yoff= 1, orients={1}, avoid='', typ='house', weight={lumberjack=1, single=1}, axis=1, inh=16}, -- all 16 are guests
{scm="lumberjack_shop_1", yoff= 1, orients={1}, avoid='', typ='shop', weight={lumberjack=1}, pervillage=1, axis=1, inh=-1},
{scm="lumberjack_sawmill_1",yoff=-7, orients={1}, avoid='', typ='sawmill', weight={lumberjack=2}, pervillage=1, axis=1, inh=-1},
{scm="lumberjack_sawmill_1",yoff=-7, orients={1}, avoid='', typ='sawmill', weight={lumberjack=2, single=1}, pervillage=1, axis=1, inh=-1},
-- {scm="cow_trader_1", yoff= 0, orients={4}, avoid='', typ='trader', weight={lumberjack=1}},
-- clay traders depend on cottages as well
{scm="trader_clay_1", yoff= 1, orients={1}, avoid='', typ='trader', weight={claytrader=3}, axis=1, inh=1}, -- poor guy who has to live in that small thing
{scm="trader_clay_2", yoff= 1, orients={3}, avoid='', typ='trader', weight={claytrader=3}, axis=1, inh=1}, -- not that he'll live very comftable there...
{scm="trader_clay_3", yoff= 1, orients={0}, avoid='', typ='trader', weight={claytrader=3}, inh=2},
{scm="trader_clay_4", yoff= 1, orients={2}, avoid='', typ='trader', weight={claytrader=3}, inh=2},
{scm="trader_clay_5", yoff= 1, orients={1}, avoid='', typ='trader', weight={claytrader=3}, axis=1, inh=2},
{scm="trader_clay_1", yoff= 1, orients={1}, avoid='', typ='trader', weight={claytrader=3, single=3}, axis=1, inh=1}, -- poor guy who has to live in that small thing
{scm="trader_clay_2", yoff= 1, orients={3}, avoid='', typ='trader', weight={claytrader=3, single=3}, axis=1, inh=1}, -- not that he'll live very comftable there...
{scm="trader_clay_3", yoff= 1, orients={0}, avoid='', typ='trader', weight={claytrader=3, single=3}, inh=2},
{scm="trader_clay_4", yoff= 1, orients={2}, avoid='', typ='trader', weight={claytrader=3, single=3}, inh=2},
{scm="trader_clay_5", yoff= 1, orients={1}, avoid='', typ='trader', weight={claytrader=3, single=3}, axis=1, inh=2},
{scm="clay_pit_1", yoff=-3, orients={0,1,2,3}, avoid='', typ='pit', weight={claytrader=1}},
{scm="clay_pit_2", yoff=-2, orients={0,1,2,3}, avoid='', typ='pit', weight={claytrader=1}},
@ -196,18 +196,18 @@ mg_villages.BUILDINGS = {
-- Houses from Taokis Structure I/O Mod (see https://forum.minetest.net/viewtopic.php?id=5524)
{scm="default_town_farm", yoff= -1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1}, axis=1},
{scm="default_town_house_large_1", yoff= -4, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/4}, axis=1, inh=10},
{scm="default_town_house_large_2", yoff= -4, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/4}, axis=1, inh=8},
{scm="default_town_house_medium", yoff= -4, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/2}, axis=1, inh=6},
{scm="default_town_house_small", yoff= -4, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1}, axis=1, inh=4},
{scm="default_town_house_tiny_1", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1}, axis=1, inh=3},
{scm="default_town_house_tiny_2", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1}, axis=1, inh=3},
{scm="default_town_house_tiny_3", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1}, axis=1, inh=2},
{scm="default_town_park", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1}, axis=1},
{scm="default_town_tower", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/6}, axis=1, inh=-1},
{scm="default_town_well", yoff= -6, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/4}, axis=1},
{scm="default_town_fountain", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/4}, axis=1},
{scm="default_town_farm", yoff= -1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1, single=1}, axis=1},
{scm="default_town_house_large_1", yoff= -4, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/4, single=1}, axis=1, inh=10},
{scm="default_town_house_large_2", yoff= -4, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/4, single=1}, axis=1, inh=8},
{scm="default_town_house_medium", yoff= -4, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/2, single=1}, axis=1, inh=6},
{scm="default_town_house_small", yoff= -4, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1, single=1}, axis=1, inh=4},
{scm="default_town_house_tiny_1", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1, single=1}, axis=1, inh=3},
{scm="default_town_house_tiny_2", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1, single=1}, axis=1, inh=3},
{scm="default_town_house_tiny_3", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1, single=1}, axis=1, inh=2},
{scm="default_town_park", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1 }, axis=1},
{scm="default_town_tower", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/6, single=1}, axis=1, inh=-1},
{scm="default_town_well", yoff= -6, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/4 }, axis=1},
{scm="default_town_fountain", yoff= 1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/4 }, axis=1},
-- the hotel seems to be only the middle section of the building; it's build for another spawning algorithm
-- {scm="default_town_hotel", yoff= -1, orients={1}, farming_plus=0, avoid='', typ='house', weight={taoki=1/5}},
@ -236,14 +236,14 @@ mg_villages.BUILDINGS = {
{scm="field_3", yoff=-2, orients={0,1,2,3}, farming_plus=0, avoid='', typ='field', weight={fields=1}},
{scm="field_4", yoff=-2, orients={0,1,2,3}, farming_plus=0, avoid='', typ='field', weight={fields=1}},
{scm="tent_tiny_1", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1}, inh=1},
{scm="tent_tiny_2", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1}, inh=1},
{scm="tent_big_1", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1}}, -- no sleeping place
{scm="tent_big_2", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1}, inh=2},
{scm="tent_medium_1", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1/2}, inh=3},
{scm="tent_medium_2", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1/2}, inh=3},
{scm="tent_medium_3", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1/2}, inh=3},
{scm="tent_medium_4", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1/2}, inh=3},
{scm="tent_tiny_1", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1, single=1}, inh=1},
{scm="tent_tiny_2", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1, single=1}, inh=1},
{scm="tent_big_1", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1, single=1}}, -- no sleeping place
{scm="tent_big_2", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1, single=1}, inh=2},
{scm="tent_medium_1", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1/2, single=1}, inh=3},
{scm="tent_medium_2", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1/2, single=1}, inh=3},
{scm="tent_medium_3", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1/2, single=1}, inh=3},
{scm="tent_medium_4", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1/2, single=1}, inh=3},
{scm="tent_open_1", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1/5}},
{scm="tent_open_2", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1/5}},
{scm="tent_open_3", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1/5}},
@ -251,10 +251,10 @@ mg_villages.BUILDINGS = {
{scm="tent_open_big_2", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1/5}},
{scm="tent_open_big_3", yoff=0, orients={3}, farming_plus=0, avoid='', typ='tent', weight={tent=1/5}},
{scm="hochsitz_1", yoff=0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='tower', weight={tower=1}},
{scm="hochsitz_2", yoff=0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='tower', weight={tower=1}},
{scm="hochsitz_3", yoff=0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='tower', weight={tower=1}},
{scm="hochsitz_4", yoff=0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='tower', weight={tower=1}},
{scm="hochsitz_1", yoff=0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='tower', weight={tower=1, single=1/3}, nomirror=1},
{scm="hochsitz_2", yoff=0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='tower', weight={tower=1, single=1/3}, nomirror=1},
{scm="hochsitz_3", yoff=0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='tower', weight={tower=1, single=1/3}, nomirror=1},
{scm="hochsitz_4", yoff=0, orients={0,1,2,3}, farming_plus=0, avoid='', typ='tower', weight={tower=1, single=1/3}, nomirror=1},
}
@ -431,6 +431,7 @@ mg_villages.BUILDINGS["wall"] = {yoff = 1, ysize = 6, scm = wall}
print('[mg_villages] Will create villages of the following types: '..minetest.serialize( mg_villages.village_types ));
mg_villages.village_types[ #mg_villages.village_types+1 ] = 'single';
mg_villages.village_types[ #mg_villages.village_types+1 ] = 'fields';
mg_villages.village_types[ #mg_villages.village_types+1 ] = 'tower';
for j,v in ipairs( mg_villages.village_types ) do
@ -456,3 +457,5 @@ end
mg_villages.village_types[ #mg_villages.village_types ] = nil;
-- neither does the tower type
mg_villages.village_types[ #mg_villages.village_types ] = nil;
-- and neither does the "single" type (==lone houses outside villages)
mg_villages.village_types[ #mg_villages.village_types ] = nil;

View File

@ -451,11 +451,11 @@ mg_villages.village_area_get_height = function( village_area, villages, minp, ma
for village_nr, village in ipairs( villages ) do
if( village.optimal_height ) then
-- villages above a size of 40 are *always* place at a convenient height of 1
elseif( village.vs >= 40 ) then
elseif( village.vs >= 40 and not(village.is_single_house)) then
village.optimal_height = 2;
elseif( village.vs >= 30 ) then
elseif( village.vs >= 30 and not(village.is_single_house)) then
village.optimal_height = 41 - village.vs;
elseif( village.vs >= 25 ) then
elseif( village.vs >= 25 and not(village.is_single_house)) then
village.optimal_height = 36 - village.vs;
-- if no border height was found, there'd be no point in calculating anything;

View File

@ -141,7 +141,9 @@ local function choose_building_rot(l, pr, orient, village_type)
end
-- some buildings are mirrored
local mirror = nil;
if( pr:next( 1,2 )==1 ) then
-- some buildings may be too difficult for mirroring (=many nodebox-nodes that can't be mirrored well by rotation) or
-- be too symmetric to be worth the trouble
if( not(mg_villages.BUILDINGS[btype].nomirror) and pr:next( 1,2 )==1 ) then
mirror = true;
end
return btype, rotation, bsizex, bsizez, mirror
@ -684,14 +686,32 @@ mg_villages.houses_in_one_mapchunk = function( minp, mapchunk_size, villages, vn
-- this will force re-calculation of height
village.vs = 5;
-- store that this is not a village but a lone house
village.is_single_house = 1;
-- pseudorandom orientation
local orient1 = pr:next(0,3);
-- determine which kind of building to use
-- TODO: select only types fitting to that particular place
-- TODO: select only types that exist
local village_types = {'lumberjack','logcabin','medieval','trader','tent','tower'};
village.village_type = village_types[ pr:next(1, #village_types )];
btype, rotation, bsizex, bsizez, mirror = choose_building_rot({}, pr, orient1, village.village_type);
-- the village type is "single" here - since not all houses which might fit into a village might do for lone standing houses
-- (i.e. church, forge, wagon, ..)
btype, rotation, bsizex, bsizez, mirror = choose_building_rot({}, pr, orient1, 'single');
if( not( bsizex )) then
print('FAILURE to generate a building.');
btype, rotation, bsizex, bsizez, mirror = choose_building_rot({}, pr, orient1, 'lumberjack');
end
-- if no building was found, give up
if( not( bsizex ) or not(mg_villages.BUILDINGS[ btype ].weight)) then
return {};
end
-- find out the real village type of this house (which is necessary for the replacements);
-- the "single" type only indicates that this building may be used for one-house-villages such as this one
for k,v in pairs( mg_villages.BUILDINGS[ btype ].weight ) do
if( k and k ~= 'single' ) then
village.village_type = k;
end
end
-- the flattened area shall extend in front of the building (so that there's room for using the front entrance)
local bx = village.vx;
@ -711,6 +731,7 @@ mg_villages.houses_in_one_mapchunk = function( minp, mapchunk_size, villages, vn
-- adjust the size of the flattened area to the building's size
village.vs = pr:next( math.max( 2, math.floor(math.min( bsizex, bsizez )*0.3)), math.min( math.ceil( math.max( bsizex, bsizez )), 25));
-- TODO: if village.is_single_house==1, do another check (based on the houses only)
-- now check if this village can be placed here or if it intersects with another village in any critical manner;
-- the village area may intersect (=unproblematic; may even look nice), but the actual building must not be inside another village
for i,v in ipairs(villages) do