gijsbel11
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 4223 |
|
|
| 14 Oct 2012 12:08 PM |
How does it work? Can we manipulate it to use our own algorithm and functions?
I was gone when the terrain thing was added and mostlikely missed all this information. |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 14 Oct 2012 12:11 PM |
| Yeah, you can use SetCell(), GetCell() and a few other methods to create a ton of terrain types... |
|
|
| Report Abuse |
|
|
gijsbel11
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 4223 |
|
|
| 14 Oct 2012 12:17 PM |
so i can do things like :
for x = 1,100 do for z = 1,100 do terrain:SetCell(x,math.cos(x)+math.sin(z),z,1,0,0)--x,y,z,material,blocktype,orientation end end |
|
|
| Report Abuse |
|
|
eJorge
|
  |
| Joined: 09 Jun 2011 |
| Total Posts: 5966 |
|
|
| 14 Oct 2012 12:45 PM |
| Yes, my survival game uses it for pretty much everything. |
|
|
| Report Abuse |
|
|
gijsbel11
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 4223 |
|
|
| 14 Oct 2012 01:10 PM |
| EJorge May i look at the terrain generation code? I'm really interested in it.. |
|
|
| Report Abuse |
|
|
eJorge
|
  |
| Joined: 09 Jun 2011 |
| Total Posts: 5966 |
|
|
| 14 Oct 2012 01:19 PM |
I basically stole it from the PBS terrain generator :P
Then I randomized the sandiness, flatness and bumpiness. |
|
|
| Report Abuse |
|
|
gijsbel11
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 4223 |
|
| |
|
eJorge
|
  |
| Joined: 09 Jun 2011 |
| Total Posts: 5966 |
|
|
| 14 Oct 2012 01:24 PM |
| Yes, the default terrain generator for personal servers. To edit it, make (or reset) a place as a personal server starter kit and open it in studio mode. |
|
|
| Report Abuse |
|
|
gijsbel11
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 4223 |
|
|
| 14 Oct 2012 01:36 PM |
| What in god's name is a personal server o.o? |
|
|
| Report Abuse |
|
|
gijsbel11
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 4223 |
|
|
| 14 Oct 2012 01:37 PM |
| Personal server is BS only -.- |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2012 01:55 PM |
| You just won the award for latest toast ever. |
|
|
| Report Abuse |
|
|
gijsbel11
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 4223 |
|
| |
|
eJorge
|
  |
| Joined: 09 Jun 2011 |
| Total Posts: 5966 |
|
|
| 14 Oct 2012 02:10 PM |
| Wait, I'll make an uncopylocked PBS. |
|
|
| Report Abuse |
|
|
eJorge
|
  |
| Joined: 09 Jun 2011 |
| Total Posts: 5966 |
|
|
| 14 Oct 2012 02:11 PM |
| There you go: http://www.roblox.com/--place?id=95109276 |
|
|
| Report Abuse |
|
|
gijsbel11
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 4223 |
|
| |
|
kools
|
  |
| Joined: 11 Jan 2009 |
| Total Posts: 1659 |
|
|
| 14 Oct 2012 02:53 PM |
Check meh code out.
local pi = math.pi --I'm lazy. local Terrain = workspace.Terrain
function Round(Num, Interger) if Increment == nil then Increment = 1 end --Assume one if not defined. local Middle = Increment/2 if Num >= Middle then return math.ceil(Num/Interger)*Interger else return math.floor(Num/Interger)*Interger end end
function SetTerrain(IslandRadius)
local Rounded = Round(IslandRadius*2*pi, 1)
for i = 1, Rounded do
Cheat = CFrame.new(0, 0, 0)*CFrame.Angles(0, math.rad(i*(360/Rounded)), 0)*CFrame.new(0,0, IslandRadius)
Terrain:SetCell(Cheat.p.X, 2, Cheat.p.Z, 1, 0, 1)
end end
SetTerrain(13) |
|
|
| Report Abuse |
|
|
gijsbel11
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 4223 |
|
|
| 14 Oct 2012 03:17 PM |
That makes a circle :D!
Oh and here's my upgraded version of your code :P
local pi = math.pi --I'm lazy. local Terrain = workspace.Terrain
function SetTerrain(IslandRadius) local Rounded = math.floor(IslandRadius*2*pi+0.5) for i = 1, Rounded do Cheat = CFrame.Angles(0, math.rad(i*(360/Rounded)), 0)*CFrame.new(0,0, IslandRadius) Terrain:SetCell(Cheat.p.X, 2, Cheat.p.Z, 1, 0, 1) end end
SetTerrain(13) |
|
|
| Report Abuse |
|
|
gijsbel11
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 4223 |
|
|
| 14 Oct 2012 03:25 PM |
or here's one that uses cos and sinus plus some other features :
local Terrain = workspace.Terrain
function SetTerrain(IslandRadius,parts,autocalculateparts) if autocalculateparts then parts = math.floor(IslandRadius*2*math.pi+0.5) end for i = 1, parts do rot = math.rad(i*(360/parts)) Terrain:SetCell(math.cos(rot)*IslandRadius, 2, math.sin(rot)*IslandRadius, 1, 0, 1) end end
SetTerrain(20,0,true) |
|
|
| Report Abuse |
|
|
agent767
|
  |
| Joined: 03 Nov 2008 |
| Total Posts: 4181 |
|
|
| 14 Oct 2012 09:50 PM |
Since this might turn into an advertising-thread for Terrain-based places: http://www.roblox.com/cavegen-test2-place?id=33771402 |
|
|
| Report Abuse |
|
|
gijsbel11
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 4223 |
|
|
| 15 Oct 2012 04:52 AM |
| We woud be very happy if you could post the code too ;) |
|
|
| Report Abuse |
|
|
eJorge
|
  |
| Joined: 09 Jun 2011 |
| Total Posts: 5966 |
|
|
| 15 Oct 2012 11:01 AM |
| I actually suck at terrain generation algorithms :l |
|
|
| Report Abuse |
|
|
0LED
|
  |
| Joined: 15 Sep 2012 |
| Total Posts: 224 |
|
|
| 15 Oct 2012 11:04 AM |
I barely even use terrain unless for messing with making little lego boats.
☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞ |
|
|
| Report Abuse |
|
|