But that would mean I get the same height for every X, Z coordinate in the chunk? Would this work if I want to get a different height for every block?:
Hurray I have something that actualy works
local CoordX = tonumber(ChunkX .. "." .. X) local CoordZ = tonumber(ChunkZ .. "." .. Z) math.randomseed(((CoordX % 1234567) + (CoordZ % 7654321) * 321));
Hurray I have something that actualy works
ChunkDesc:SetUseDefaultHeight(false) for X=0, 15 do for Z=0, 15 do if ChunkDesc:GetBiome(X, Z) == biSwampland then ChunkDesc:SetUseDefaultFinish(false) local Calculation = math.sqrt(((ChunkX % 1234567) + (ChunkZ % 7654321) * ((X + 1) * (Z + 1)))) / (ChunkX + (X + 1)) / (ChunkZ + (Z + 1)) math.randomseed(Calculation); math.random() local Height = math.random(60, 61) ChunkDesc:SetHeight(X, Z, Height) for Y=2, Height -3 do ChunkDesc:SetBlockTypeMeta(X, Y, Z, E_BLOCK_STONE, 0) end for Y=Height-3, Height-1 do ChunkDesc:SetBlockTypeMeta(X, Y, Z, E_BLOCK_DIRT, 0) end ChunkDesc:SetBlockTypeMeta(X, Height, Z, E_BLOCK_GRASS, 0) ChunkDesc:SetBlockTypeMeta(X, 1, Z, E_BLOCK_BEDROCK, 0) for Y=61, Height, -1 do local Block = ChunkDesc:GetBlockType(X, Y, Z) print(Y, Height) if Block == E_BLOCK_AIR then ChunkDesc:SetBlockTypeMeta(X, Y, Z, E_BLOCK_WATER, 0) elseif Block == E_BLOCK_GRASS and Y < Height then ChunkDesc:SetBlockTypeMeta(X, Y, Z, E_BLOCK_DIRT, 0) elseif Block ~= E_BLOCK_WATER then --break; end end Height = ChunkDesc:GetHeight(X, Z) local HighestBlock = ChunkDesc:GetBlockType(X, Height, Z) if HighestBlock == E_BLOCK_LILY_PAD then if ChunkDesc:GetBlockType(X, Height -1, Z) ~= E_BLOCK_WATER then end ChunkDesc:SetBlock(X, Height, Y, E_BLOCK_AIR, 0) end end end end