generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: The Terrain Instance...

Previous Thread :: Next Thread 
gijsbel11 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. gijsbel11
Joined: 07 Feb 2009
Total Posts: 4223
14 Oct 2012 01:22 PM
PBS terrain generator?
Report Abuse
eJorge is not online. 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 is not online. 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 is not online. gijsbel11
Joined: 07 Feb 2009
Total Posts: 4223
14 Oct 2012 01:37 PM
Personal server is BS only -.-
Report Abuse
ArceusinatorB is not online. ArceusinatorB
Joined: 30 Mar 2010
Total Posts: 68
14 Oct 2012 01:55 PM
You just won the award for latest toast ever.
Report Abuse
gijsbel11 is not online. gijsbel11
Joined: 07 Feb 2009
Total Posts: 4223
14 Oct 2012 01:56 PM
sorry :P
Report Abuse
eJorge is not online. eJorge
Joined: 09 Jun 2011
Total Posts: 5966
14 Oct 2012 02:10 PM
Wait, I'll make an uncopylocked PBS.
Report Abuse
eJorge is not online. 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 is not online. gijsbel11
Joined: 07 Feb 2009
Total Posts: 4223
14 Oct 2012 02:13 PM
Thanks EJorge ^^
Report Abuse
kools is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image