|
| 24 Aug 2016 11:17 AM |
So I have this map generation script and I would like to know is it possible to make it have a flat spot made out of like 4x4 parts in the middle and make the terrain correspond to it and look like its meant to be there? I know it's somehow do-able, but I don't know how to do it, I would appreciate any help
local MapModel = Instance.new("Model",workspace) MapModel.Name = "MapModel"
local Part = Instance.new("Part") --For cloning Part.Anchored = true Part.FormFactor = "Custom" Part.Size = Vector3.new(50,200,50) Part.TopSurface = "Smooth"
local seed = math.random(1, 10e6) local frequency = 3 local power = 10 local resolution = 100
for x = 1, resolution do wait() for z = 1, resolution do local y1 = math.noise( (x*frequency)/resolution, (z*frequency)/resolution, seed )
local y2 = math.noise( (x*frequency*.125)/resolution, (z*frequency*.125)/resolution, seed )
local y3 = math.noise( (x*frequency*4)/resolution, (z*frequency*4)/resolution, seed )
local y = (y1*y2*power*power)+y3
local Part = Part:Clone() Part.Parent = MapModel Part.CFrame = CFrame.new(x*50,y*15,z*50) if math.abs(y2) < .1 then Part.BrickColor = BrickColor.new("Bright green") elseif math.abs(y2) > .25 then Part.BrickColor = BrickColor.new("Earth green") elseif math.abs(y2) > .1 and math.abs(y2) < .25 then Part.BrickColor = BrickColor.new("Dark green") end end end
|
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Aug 2016 11:43 AM |
I don't know how to do this, but bump for you. (post farming)
"me caveman rawr" - Me |
|
|
| Report Abuse |
|
|
baa_aaa
|
  |
| Joined: 18 Nov 2015 |
| Total Posts: 491 |
|
|
| 24 Aug 2016 12:20 PM |
| You'd probably want to apply it after the fact. I would set the middle parts to the height you want, and then smooth it out around that. |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 12:23 PM |
I know how to set the middle parts height, but how would I smooth it out?
|
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 12:24 PM |
It's... really clunky but
you could number them all (the parts, from 1 - whatever) and figure out the middle then compress them after the map has been generated |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 12:27 PM |
Yes I know how to do that, but how would I compress it?
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 24 Aug 2016 01:18 PM |
| Sau sonkaulius kelis issioperuoji, ir pradedi byby savo ciulpt |
|
|
| Report Abuse |
|
|
| |
|
qqtt991
|
  |
| Joined: 14 Dec 2007 |
| Total Posts: 1387 |
|
|
| 24 Aug 2016 02:00 PM |
| ################################################################################################################################################################################################################################################# |
|
|
| Report Abuse |
|
|
qqtt991
|
  |
| Joined: 14 Dec 2007 |
| Total Posts: 1387 |
|
|
| 24 Aug 2016 02:01 PM |
| #################################################################################################################################################################################################################################################### |
|
|
| Report Abuse |
|
|
qqtt991
|
  |
| Joined: 14 Dec 2007 |
| Total Posts: 1387 |
|
|
| 24 Aug 2016 02:02 PM |
LORDY LOO FFFFFF
I'm .. working on it. No guarantees yet, but I've got a plateau generated, and I'm working on finding the correct level to set the surrounding blocks to before I can smooth down the rest.
i. imgu r. com/h76vxrb . png
|
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 02:24 PM |
Oh that's cool, what are those grey blocks in the middle?
|
|
|
| Report Abuse |
|
|
qqtt991
|
  |
| Joined: 14 Dec 2007 |
| Total Posts: 1387 |
|
|
| 24 Aug 2016 02:27 PM |
The flat area you're looking to generate. They're not colored yet so it's easier for me to see them while I work.
Found the correct height. Now I have to write the part that smooths the terrain.
|
|
|
| Report Abuse |
|
|
qqtt991
|
  |
| Joined: 14 Dec 2007 |
| Total Posts: 1387 |
|
|
| 24 Aug 2016 02:28 PM |
i . imgur. com / FHPBeSB . png
|
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 02:34 PM |
| you can just erode a round-ish space out of the terrain |
|
|
| Report Abuse |
|
|
qqtt991
|
  |
| Joined: 14 Dec 2007 |
| Total Posts: 1387 |
|
| |
|
|
| 24 Aug 2016 02:36 PM |
@TheDailyBlarg I wish I knew how to do that
and for the flat area I don't want it to be like a platform I just want it to be the same grass/green blocks but flat
|
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 02:37 PM |
easy
just generate the terrain and then grab a part of terrain using Region3 and ReadVoxels then you can write voxels to the average height and add terrain around the sides so that it doesnt look ugly |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 02:40 PM |
But readvoxels are for smooth terrain
|
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 02:42 PM |
just use region3 then and remove those parts and toss some back inside that are flat or cframe them to their average Y |
|
|
| Report Abuse |
|
|
qqtt991
|
  |
| Joined: 14 Dec 2007 |
| Total Posts: 1387 |
|
|
| 24 Aug 2016 02:54 PM |
You specified you wanted a flat plateau made out of 4x4 parts in the middle so I did just that. I removed the plateau though so it's just flat land now. To make it circular would take more effort than I'm willing to invest so hopefully it will look alright once I get the smoothing working. I've never done this before lol.
i . imgur . com / ssYZLIp . png
|
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 03:07 PM |
That's exactly how I wanted it, what I said was an example. Send me a pic once you get smoothing working :)
|
|
|
| Report Abuse |
|
|