kornawe
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 1272 |
|
|
| 13 Jul 2011 08:25 PM |
| I'm working on a terrain generaor, it works, but I want a BIG area, so I want to make Only arounf the Player's Character. I'm not sure how to remove the bricks out size of the players' range and form a new row without compleatly re-doing the terrain arount the Character. But if I did that it would mess up there walking. I'll post my current Version(Yes IK it's not very adavced I just made it.) |
|
|
| Report Abuse |
|
|
kornawe
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 1272 |
|
| |
|
kornawe
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 1272 |
|
|
| 13 Jul 2011 09:01 PM |
XMin = -250 XMax = 250 YMin = -50 YMax = 100 ZMin = -250 ZMax = 250
D = 5 Size = 10
Water = true
Land = Instance.new("SpawnLocation") Land.Material = "Grass" Land.BrickColor = BrickColor.new("Bright green") Land.Anchored = true Land.CanCollide = true Land.Locked = true Land.Name = "Land" Land.formFactor = 3 Land.Size = Vector3.new(Size,Size,Size) Land.BottomSurface = 0 Land.TopSurface = 0
Colors = {"Earth green", "Bright green", "Reddish brown"} Materials = {"Slate", "Ice", "Grass"}
XVal = XMin YVal = math.random(YMin,YMax) ZVal = ZMin
Bricks = {} ZYS = {}
function MakeBrick() Brick = Land:Clone() Brick.BrickColor = BrickColor.new(Colors[math.random(1,#Colors)]) Brick.Material = Materials[math.random(1,#Materials)] Brick.Name = "Land" table.insert(Bricks,Brick) Brick.Parent = script return Brick end
N = 0
for XVal = XMin,XMax,Size do for ZVal = ZMin,ZMax,Size do Brick = MakeBrick() print("Brick Made") if XVal == XMin then Brick.CFrame = CFrame.new(Vector3.new(XVal,math.random(YVal-D,YVal+D),ZVal)) if Brick.Position.Y <= YMin then Brick.CFrame = CFrame.new(Vector3.new(Brick.CFrame.X, YMin, Brick.CFrame.Z)) if Water == true then Brick.BrickColor = BrickColor.new("Bright blue") Brick.Material = "Ice" end elseif Brick.Position.Y >= YMax then Brick.CFrame = CFrame.new(Vector3.new(Brick.CFrame.X, YMax, Brick.CFrame.Z)) end YVal = Brick.CFrame.Y table.insert(ZYS,YVal) else N = N+1 Y = (ZYS[N]+YVal)/2 Brick.CFrame = CFrame.new(Vector3.new(XVal,math.random(Y-D,Y+D),ZVal)) if Brick.Position.Y <= YMin then Brick.CFrame = CFrame.new(Vector3.new(Brick.CFrame.X, YMin, Brick.CFrame.Z)) if Water == true then Brick.BrickColor = BrickColor.new("Bright blue") Brick.Material = "Ice" end elseif Brick.Position.Y >= YMax then Brick.CFrame = CFrame.new(Vector3.new(Brick.CFrame.X, YMax, Brick.CFrame.Z)) end YVal = Brick.CFrame.Y table.insert(ZYS,YVal) end end end
for D = 1,#Bricks do if Bricks[D].Position.Y < YMin then Bricks[D].CFrame = CFrame.new(Vector3.new(Bricks[D].CFrame.X, YMin, Bricks[D].CFrame.Z)) elseif Bricks[D].Position.Y > YMax then Bricks[D].CFrame = CFrame.new(Vector3.new(Bricks[D].CFrame.X, YMax, Bricks[D].CFrame.Z)) end end
|
|
|
| Report Abuse |
|
|
kornawe
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 1272 |
|
| |
|
kornawe
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 1272 |
|
|
| 13 Jul 2011 11:01 PM |
| Why does noone post on my forums M=Well I fnoone responds I'm going to make a re-title post |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2011 11:37 PM |
| I think you need to make it so when you step on a floor, it will delete the opposite border and render the next one. o: |
|
|
| Report Abuse |
|
|
kornawe
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 1272 |
|
|
| 14 Jul 2011 08:26 AM |
| Well I was tinking make area's and when and have them over lap a little just so the player won't fall when they go from area to area. But I'm not sure how to form a new area make it line up with the other layer that they just cam from. and how to delet the old area. I could do it wil seprate area's all pre-made. But I want the script easy for others to edit that can't script. |
|
|
| Report Abuse |
|
|
kornawe
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 1272 |
|
|
| 14 Jul 2011 08:28 AM |
| Plus to do what you want I tried a loop to go through the parts, but without a wait() it would freeze the game for a few minets, but with a wait() it would take like 5 minuets to go through all the parts. |
|
|
| Report Abuse |
|
|
kornawe
|
  |
| Joined: 25 Nov 2008 |
| Total Posts: 1272 |
|
| |
|
|
| 15 Jul 2011 10:38 PM |
| Why would you need to loop through all parts? |
|
|
| Report Abuse |
|
|