Better villages, use WE schematics for everything

This commit is contained in:
Novatux 2013-09-28 14:08:19 +02:00
parent f0638357e2
commit c99cf60651
8 changed files with 29 additions and 308 deletions

View File

@ -1,308 +1,11 @@
local W = minetest.get_content_id("default:wood")
local WS = minetest.get_content_id("default:water_source")
local S = minetest.get_content_id("farming:soil_wet")
local WH = minetest.get_content_id("farming:wheat_8")
local CO = minetest.get_content_id("farming:cotton_8")
local A = minetest.get_content_id("air")
local I = minetest.get_content_id("ignore")
local G = minetest.get_content_id("default:glass")
local C = minetest.get_content_id("default:cobble")
local T = minetest.get_content_id("default:tree")
local WG = minetest.get_content_id("wool:grey")
local FW = minetest.get_content_id("default:fence_wood")
local WF = minetest.get_content_id("default:water_flowing")
local BS = minetest.get_content_id("default:bookshelf")
local SW = minetest.get_content_id("stairs:slab_wood")
local TRXM = {node={name="default:torch", param2=2}, rotation = "wallmounted"}
local TRXP = {node={name="default:torch", param2=3}, rotation = "wallmounted"}
local TRZM = {node={name="default:torch", param2=5}, rotation = "wallmounted"}
local TRZP = {node={name="default:torch", param2=4}, rotation = "wallmounted"}
local TRU = {node={name="default:torch", param2=1}}
local SWXP = {node={name="stairs:stair_wood", param2=3}, rotation = "facedir"}
local SWXM = {node={name="stairs:stair_wood", param2=1}, rotation = "facedir"}
local SWZP = {node={name="stairs:stair_wood", param2=0}, rotation = "facedir"}
local SWZM = {node={name="stairs:stair_wood", param2=2}, rotation = "facedir"}
local field_cotton = {
{
{S, WS, S, S, WS, S, S, WS, S},
{S, WS, S, S, WS, S, S, WS, S},
{S, WS, S, S, WS, S, S, WS, S},
{S, WS, S, S, WS, S, S, WS, S},
{S, WS, S, S, WS, S, S, WS, S},
{S, WS, S, S, WS, S, S, WS, S},
{S, WS, S, S, WS, S, S, WS, S},
{S, WS, S, S, WS, S, S, WS, S},
{S, WS, S, S, WS, S, S, WS, S},
},
{
{CO, A, CO, CO, A, CO, CO, A, CO},
{CO, A, CO, CO, A, CO, CO, A, CO},
{CO, A, CO, CO, A, CO, CO, A, CO},
{CO, A, CO, CO, A, CO, CO, A, CO},
{CO, A, CO, CO, A, CO, CO, A, CO},
{CO, A, CO, CO, A, CO, CO, A, CO},
{CO, A, CO, CO, A, CO, CO, A, CO},
{CO, A, CO, CO, A, CO, CO, A, CO},
{CO, A, CO, CO, A, CO, CO, A, CO},
},
}
local field = {
{
{S, WS, S, S, WS, S, S, WS, S},
{S, WS, S, S, WS, S, S, WS, S},
{S, WS, S, S, WS, S, S, WS, S},
{S, WS, S, S, WS, S, S, WS, S},
{S, WS, S, S, WS, S, S, WS, S},
{S, WS, S, S, WS, S, S, WS, S},
{S, WS, S, S, WS, S, S, WS, S},
{S, WS, S, S, WS, S, S, WS, S},
{S, WS, S, S, WS, S, S, WS, S},
},
{
{WH, A, WH, WH, A, WH, WH, A, WH},
{WH, A, WH, WH, A, WH, WH, A, WH},
{WH, A, WH, WH, A, WH, WH, A, WH},
{WH, A, WH, WH, A, WH, WH, A, WH},
{WH, A, WH, WH, A, WH, WH, A, WH},
{WH, A, WH, WH, A, WH, WH, A, WH},
{WH, A, WH, WH, A, WH, WH, A, WH},
{WH, A, WH, WH, A, WH, WH, A, WH},
{WH, A, WH, WH, A, WH, WH, A, WH},
},
}
local house = {
{
{W, W, W, W, W, W, W},
{W, W, W, W, W, W, W},
{W, W, W, W, W, W, W},
{W, W, W, W, W, W, W},
{W, W, W, W, W, W, W},
{W, W, W, W, W, W, W},
{W, W, W, W, W, W, W},
},
{
{T, W, W, A, W, W, T},
{W, A, A, A, A, A, W},
{W, A, A, A, A, A, W},
{W, A, A, A, A, A, W},
{W, A, A, A, A, A, W},
{W, A, A, A, A, A, W},
{T, W, W, W, W, W, T},
},
{
{T, C, C, A, C, C, T},
{C, A, A, A, A, A, C},
{C, A, A, A, A, A, C},
{C, A, A, A, A, A, C},
{C, A, A, A, A, A, C},
{C, A, A, A, A, A, C},
{T, C, G, G, G, C, T},
},
{
{T, C, C, C, C, C, T},
{C, A, A, A, A, A, C},
{C, A, A, A, A, A, C},
{C, A, A, A, A, A, C},
{C, A, A, A, A, A, C},
{C, A, A, A, A, A, C},
{T, C, G, G, G, C, T},
},
{
{T, C, C, C, C, C, T},
{C, A, A, A, A, A, C},
{C, A, A, A, A, A, C},
{C, A, A, A, A, A, C},
{C, A, A, A, A, A, C},
{C, A, A, A, A, A, C},
{T, C, C, C, C, C, T},
},
{
{W, W, W, W, W, W, W},
{W, W, W, W, W, W, W},
{W, W, W, W, W, W, W},
{W, W, W, W, W, W, W},
{W, W, W, W, W, W, W},
{W, W, W, W, W, W, W},
{W, W, W, W, W, W, W},
},
{
{ SW, SWXM, SWXM, SWXM, SWXM, SWXM, SW},
{SWZP, W, W, W, W, W, SWZM},
{SWZP, W, I, I, I, W, SWZM},
{SWZP, W, I, I, I, W, SWZM},
{SWZP, W, I, I, I, W, SWZM},
{SWZP, W, W, W, W, W, SWZM},
{ SW, SWXP, SWXP, SWXP, SWXP, SWXP, SW},
},
{
{I, I, I, I, I, I, I},
{I, SW, SWXM, SWXM, SWXM, SW, I},
{I, SWZP, W, W, W, SWZM, I},
{I, SWZP, W, I, W, SWZM, I},
{I, SWZP, W, W, W, SWZM, I},
{I, SW, SWXP, SWXP, SWXP, SW, I},
{I, I, I, I, I, I, I},
},
{
{I, I, I, I, I, I, I},
{I, I, I, I, I, I, I},
{I, I, SW, SWXM, SW, I, I},
{I, I, SWZP, W, SWZM, I, I},
{I, I, SW, SWXP, SW, I, I},
{I, I, I, I, I, I, I},
{I, I, I, I, I, I, I},
},
}
local lamp = {
{
{I, I, I},
{I, FW, I},
{I, I, I},
},
{
{I, I, I},
{I, FW, I},
{I, I, I},
},
{
{I, I, I},
{I, FW, I},
{I, I, I},
},
{
{ I, TRXM, I},
{TRZP, WG, TRZM},
{ I, TRXP, I},
},
}
local well = {
{
{C, C, C, C},
{C, C, C, C},
{C, C, C, C},
{C, C, C, C},
},
{
{C, C, C, C},
{C, WS, WS, C},
{C, WS, WS, C},
{C, C, C, C},
},
{
{C, C, C, C},
{C, WS, WS, C},
{C, WS, WS, C},
{C, C, C, C},
},
{
{C, C, C, C},
{C, WS, WS, C},
{C, WS, WS, C},
{C, C, C, C},
},
{
{C, C, C, C},
{C, WS, WS, C},
{C, WS, WS, C},
{C, C, C, C},
},
{
{C, C, C, C},
{C, WS, WS, C},
{C, WS, WS, C},
{C, C, C, C},
},
{
{C, C, C, C},
{C, A, A, C},
{C, A, A, C},
{C, C, C, C},
},
{
{FW, A, A, FW},
{ A, A, A, A},
{ A, A, A, A},
{FW, A, A, FW},
},
{
{FW, A, A, FW},
{ A, A, A, A},
{ A, A, A, A},
{FW, A, A, FW},
},
{
{FW, A, A, FW},
{ A, A, A, A},
{ A, A, A, A},
{FW, A, A, FW},
},
{
{C, C, C, C},
{C, C, C, C},
{C, C, C, C},
{C, C, C, C},
},
}
local smallhouse = {
{
{C, C, C, C, C},
{C, C, C, C, C},
{C, C, C, C, C},
{C, C, C, C, C},
{C, C, C, C, C},
},
{
{T, W, W, W, T},
{W, A, A, A, W},
{W, A, A, A, W},
{W, A, A, A, W},
{T, W, A, W, T},
},
{
{T, W, W, W, T},
{W, A, A, A, W},
{G, A, A, A, G},
{W, A, A, A, W},
{T, W, A, W, T},
},
{
{W, W, W, W, W},
{W, A, A, A, W},
{W, A, A, A, W},
{W, A, A, A, W},
{W, W, W, W, W},
},
{
{ SW, SWXM, SWXM, SWXM, SW},
{SWZP, W, W, W, SWZM},
{SWZP, W, A, W, SWZM},
{SWZP, W, W, W, SWZM},
{ SW, SWXP, SWXP, SWXP, SW},
},
{
{I, I, I, I, I},
{I, SW, SWXM, SW, I},
{I, SWZP, W, SWZM, I},
{I, SW, SWXP, SW, I},
{I, I, I, I, I},
},
}
buildings = {
{sizex= 7, sizez= 7, yoff= 0, ysize= 9, scm=house, orients={0}},
{sizex= 9, sizez= 9, yoff= 0, ysize= 2, scm=field},
{sizex= 9, sizez= 9, yoff= 0, ysize= 2, scm=field_cotton},
{sizex= 3, sizez= 3, yoff= 1, ysize= 4, scm=lamp, weight=1/5, no_rotate=true},
{sizex= 4, sizez= 4, yoff=-5, ysize=11, scm=well, no_rotate=true, pervillage=1},
{sizex= 7, sizez= 7, yoff= 0, ysize= 9, scm="house", orients={2}},
{sizex= 9, sizez= 9, yoff= 0, ysize= 2, scm="wheat_field"},
{sizex= 9, sizez= 9, yoff= 0, ysize= 2, scm="cotton_field"},
{sizex= 3, sizez= 3, yoff= 1, ysize= 4, scm="lamp", weight=1/5, no_rotate=true},
{sizex= 4, sizez= 4, yoff=-5, ysize=11, scm="well", no_rotate=true, pervillage=1},
{sizex= 7, sizez= 7, yoff= 0, ysize=11, scm="fountain", weight=1/4, pervillage=3},
{sizex= 5, sizez= 5, yoff= 0, ysize= 6, scm=smallhouse, orients={2}},
{sizex= 5, sizez= 5, yoff= 0, ysize= 6, scm="small_house", orients={3}},
--{sizex=13, sizez= 6, yoff= 1, ysize= 7, scm=house_w_garden, orients={2}},
{sizex=6, sizez= 12, yoff= 0, ysize= 7, scm="house_with_garden", orients={1}},
{sizex=16, sizez=17, yoff= 0, ysize=12, scm="church", orients={3}, pervillage=1},
@ -324,7 +27,7 @@ for i = 1, 200 do
end
local rair = {}
for i = 1, 200 do
rair[i] = A
rair[i] = c_air
end
local rair2 = {}
for i = 1, 200 do

1
schems/cotton_field.we Normal file

File diff suppressed because one or more lines are too long

1
schems/house.we Normal file

File diff suppressed because one or more lines are too long

1
schems/lamp.we Normal file

File diff suppressed because one or more lines are too long

1
schems/small_house.we Normal file

File diff suppressed because one or more lines are too long

1
schems/well.we Normal file

File diff suppressed because one or more lines are too long

1
schems/wheat_field.we Normal file

File diff suppressed because one or more lines are too long

View File

@ -124,6 +124,7 @@ local function generate_road(vx, vz, vs, vh, l, pr, roadsize, rx, rz, rdx, rdz,
local exitloop = false
local bx
local bz
local tries = 0
while true do
if not inside_village(rx, rz, vx, vz, vs, vnoise) or road_in_building(rx, rz, rdx, rdz, roadsize, l) then
exitloop = true
@ -135,8 +136,13 @@ local function generate_road(vx, vz, vs, vh, l, pr, roadsize, rx, rz, rdx, rdz,
if placeable(bx, bz, bsizex, bsizez, l) and inside_village2(bx, bsizex, bz, bsizez, vx, vz, vs, vnoise) then
break
end
rx = rx + rdx
rz = rz + rdz
if tries > 5 then
rx = rx + rdx
rz = rz + rdz
tries = 0
else
tries = tries + 1
end
--goto loop
end
if exitloop then break end
@ -163,6 +169,7 @@ local function generate_road(vx, vz, vs, vh, l, pr, roadsize, rx, rz, rdx, rdz,
local exitloop = false
local bx
local bz
local tries = 0
while true do
if not inside_village(rx, rz, vx, vz, vs, vnoise) or road_in_building(rx, rz, rdx, rdz, roadsize, l) then
exitloop = true
@ -174,8 +181,13 @@ local function generate_road(vx, vz, vs, vh, l, pr, roadsize, rx, rz, rdx, rdz,
if placeable(bx, bz, bsizex, bsizez, l) and inside_village2(bx, bsizex, bz, bsizez, vx, vz, vs, vnoise) then
break
end
rx = rx + rdx
rz = rz + rdz
if tries > 5 then
rx = rx + rdx
rz = rz + rdz
tries = 0
else
tries = tries + 1
end
--goto loop
end
if exitloop then break end