#perlin noise
22 messages · Page 1 of 1 (latest)
not quite, i got it sent by Alek in a help thread yesterday
i dont know if its just based off yours or if this is just kinda >>the way<< to do it tho
ah i see, its just because those are exactly the variable and function names i use
and the logic is almost exactly the same for the loop
exact same size and the use of hardcoded numbers
the tileHeight * 0.75 is the same workaround i used too
yeah im like 90% sure that its based off mine
yeah i can see that
looks like
for the math.noise?
yeah thats what docs say
tysm!!
epic
local tiles = {}
local ServerScriptService = game.ServerScriptService
local WorldGen = script
local RanGenLib = script.RanGenLib
local Grassland = script.RanGenLib.GrasslandBiome
local GeneratedGrass = workspace.GeneratedGrassland
local OGRef = workspace.OriRefPoint
local OGChunk = workspace.OriChunkPoint
local GrasslandSizeMax = 120
local ChunksSpawned = 0
local FolLimitPerGrass = 10
local MaxAttempts = 100
local ErrorLog = {}
local ForceQueue = false
local FailuresInARow = 0
local GrassChunkLimit = GrasslandSizeMax
local FoliageList = Grassland.Nature.Foliage:GetChildren()
local GrassChunks = Grassland.Chunks:GetChildren()
local PrevChunkPos = CFrame.new(-54, 1003, 83)
local MinNatureScale = 1
local MaxNatureScale = 4
local tileWidth = 76
local tileHeight = 76
local spawnTileForest = function(position)
local IsLake = math.random(1,5)
local RanScale = math.random(MinNatureScale,MaxNatureScale)
local RanRotation = math.random(-180,180)
local PropLimit = 5
local hexagon = GrassChunks[math.random(1, #GrassChunks)]
local newHexagon = hexagon:Clone()
local waterHexagon = Grassland.WaterHex:Clone()
local worldPosition = position * Vector2.new(tileWidth,tileHeight * 0.75)
local water = false
if position.Y % 2 == 0 then
worldPosition += Vector2.new(tileWidth / 2, 0)
end
local NewFrame = CFrame.new(Vector3.new(worldPosition.X, math.noise(worldPosition.X, .5, worldPosition.Y) * 30, worldPosition.Y))
if NewFrame.Y == -15 then
waterHexagon:PivotTo(NewFrame)
waterHexagon.Parent = GeneratedGrass.Chunks
water = true
end
if water == true then return
else
newHexagon:PivotTo(NewFrame)
newHexagon.Parent = workspace.GeneratedGrassland.Chunks
newHexagon.TerrainSurface.BrickColor = BrickColor.new("Parsley green")
newHexagon.TerrainUnder.BrickColor = BrickColor.new("Medium brown")
newHexagon.TerrainRock.BrickColor = BrickColor.new("Dark stone grey")
end
end
for x = -15, 15 do
for y = -15, 15 do
local newTile = {Position = Vector2.new(x,y)}
spawnTileForest(newTile.Position)
end
end
that looks cool
seeing a problem though...
you are creating 2 hexagons for every tile without using both
so you have double the instances
even though half of those arent parented
oh, where is that happening