anonymoushamster wrote:moderror: failed to load and run C:/Minetest/t/bin/./mods/villages-master/init.lua
Check debug.txt for details
O.o
I'm sort of... new and an idiot... I don't understand this.
philipbenr wrote:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
-- thanks to sfan5 for this advanced code that reads the size from schematic files
local read_s16 = function(fi)
return string.byte(fi:read(1)) * 256 + string.byte(fi:read(1))
end
local function get_schematic_size(f)Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
10:32:09: ERROR[main]: ServerError: LuaError: error: ...- Copy\bin\..\games\minetest_game\mods\villages\init.lua:289: bad argument #1 to 'byte' (string expected, got nil)
This is an error I got. I'm thinking "What the..." :\ help please?
17:41:15: ERROR[main]: ServerError: LuaError: error: ...netest-0.4.7-2170c99-win32\bin\..\mods\villages\init.lua:289: bad argument #1 to 'byte' (string expected, got nil)error:...inetest-0.4.7-2170c99-win32\bin\..\builtin/serialize.lua:168: attempt to index local 'sdata' (a nil value)
error:...inetest-0.4.7-2170c99-win32\bin\..\builtin/serialize.lua:168: attempt to index local 'sdata' (a nil value)paramat wrote:Sokomine, here's a modified version of mg_villages that uses spawner nodes, abm and the non 'mapgen object' voxelmanip, hopefully no griefing by mudflow or cavegen, needs further testing.
paramat wrote:I'm just posting this here because you don't have a mg_villages topic.
paramat wrote:I'm just posting this here because you don't have a mg_villages topic.
paramat wrote:My edited version had a problem, the spawner nodes were placed at chunk centres, since ABM range is 32 nodes by default players often could not get close enough to trigger the spawners and generate the village because there is a huge vertical wall there at the chunk border. This is why it only worked with 'active block range' increased to 3+ in minetest.conf.
Now solved by using 4 spawner nodes per mapchunk, placed at each mapchunk corner, no need for a non-default active block range. I have also added a basic WIP terrain blend. My version is found here stored in my wieldhand repo https://github.com/paramat/wieldhandsam2 All edited or added code is marked between '-- PM v' and '-- PM ^', there are 4 spawner nodes in nodes.lua and i have edited and added various functions in mapgen.lua.
Krock wrote:Interesting but your villages mod has the same problem:
paramat wrote:Sokomine, i updated my version with partial terrain blend that leaves some cliffs, also any trees removed are replanted as saplings, in this repo as before https://github.com/paramat/wieldhandsam2.
paramat wrote:Will next add a narrow border cliff to hide the village and irrigation layers being visible when surrounding terrain is lower than the village.
paramat wrote:Terrain blending doesn't work now when the original terrain is lower than the village, don't yet know why. The village is a 1 node thick platform floating above the original terrain with a big gap below it.
paramat wrote:As far as i can tell there's no cave griefing or mudflow inside the village border (but it's hard to find stone in the buildings, don't know where to look). There are mudflow ridges on the blended terrain.
paramat wrote:There are a few floating jungletree roots above the village.
paramat wrote:However compared to my version it generates the village sooner and is visually cleaner because it's on-generated.
No lighting glitches.
paramat wrote:I spawned high above the village and fell to the village level, possibly enough to kill a player if damage was enabled. This message appeared in terminal 'CHANGING HEIGHT from 39 to 8'.
Sokomine wrote:Your terrain blending works very fine already if the terrain is higher than the village. Now, if you add the same for terrain that is lower, things will improve further.
local function spawnplayer(player)
local noise1 = minetest.get_perlin(12345, 6, 0.5, 256)
local min_dist = math.huge
local min_pos = {x = 0, y = 3, z = 0}
for bx = -40, 40 do
for bz = -40, 40 do
local minp = {x = -32 + 80 * bx, y = -32, z = -32 + 80 * bz}
for _, village in ipairs(mg_villages.villages_at_point(minp, noise1)) do
if math.abs(village.vx) + math.abs(village.vz) < min_dist then
min_pos = {x = village.vx, y = village.vh + 2, z = village.vz}
min_dist = math.abs(village.vx) + math.abs(village.vz)
end
end
end
end
player:setpos(min_pos)
endmg_villages.VILLAGE_CHANCE = 400mg_villages.villages_at_point = function(minp, noise1)
if not is_village_block(minp) then return {} end
local noiseb = minetest.get_perlin(-8017, 4, 0.4, 2048)
local noisec = minetest.get_perlin(300707, 5, 0.4, 4096)
local vcr, vcc = mg_villages.VILLAGE_CHECK_RADIUS, mg_villages.VILLAGE_CHECK_COUNT
-- Check if there's another village nearby
for xi = -vcr, vcr, vcc do
for zi = -vcr, 0, vcc do
if xi ~= 0 or zi ~= 0 then
local mp = {x = minp.x + 80*xi, z = minp.z + 80*zi}
local pi = PseudoRandom(mg_villages.get_bseed(mp))
local s = pi:next(1, 400)
local x = pi:next(mp.x, mp.x + 79)
local z = pi:next(mp.z, mp.z + 79)
if s <= mg_villages.VILLAGE_CHANCE
and math.abs(noiseb:get2d({x = x, y = z})) <= 0.02
and math.abs(noisec:get2d({x = x, y = z})) <= 0.01 then
return {}
end
end
end
end
local pr = PseudoRandom(mg_villages.get_bseed(minp))
if pr:next(1, 400) > mg_villages.VILLAGE_CHANCE then
return {} -- No village here
end
local x = pr:next(minp.x, minp.x + 79)
local z = pr:next(minp.z, minp.z + 79)
if math.abs(noiseb:get2d({x = x, y = z})) > 0.02
or math.abs(noisec:get2d({x = x, y = z})) > 0.01 then
return {}
end

Users browsing this forum: No registered users and 7 guests