Alkan
|
  |
| Joined: 04 Dec 2008 |
| Total Posts: 907 |
|
|
| 15 Dec 2015 07:36 PM |
I checked the wiki and can't figure out how people get their terrain to be made so smooth by script.
for x=1, 100 do for y=x/2, -10, -.5 do for z=1, 10 do workspace.Terrain:SetCell(x, y+10, z, 1, 0, 0) end end end
I'd like that to turn into a smooth ramp, but it turns into a staircase instead. Help? |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2015 07:39 PM |
I was playing around with the numbers a bit and I actually managed to do it:
for x=1, 100 do for y=x/2, -10, -.5 do for z=1, 10 do workspace.Terrain:SetCell(x/2, y+10, z, 1, 0, 0) end end end
I cut the X in half when the terrain was generated. |
|
|
| Report Abuse |
|
|
Alkan
|
  |
| Joined: 04 Dec 2008 |
| Total Posts: 907 |
|
|
| 15 Dec 2015 07:41 PM |
| No I mean making terrain smooth in any situation, my code was just an example. You undid the y iteration's x/2 with your x*2. |
|
|
| Report Abuse |
|
|
Alkan
|
  |
| Joined: 04 Dec 2008 |
| Total Posts: 907 |
|
|
| 15 Dec 2015 07:42 PM |
| I mean your x/2 made the ramp steeper, that's why it looked like a ramp instead of a staircase. Not exactly a fix. |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2015 07:43 PM |
| Oh. If it isn't a slope of 1 I don't think it can be perfectly smooth. |
|
|
| Report Abuse |
|
|
Alkan
|
  |
| Joined: 04 Dec 2008 |
| Total Posts: 907 |
|
|
| 15 Dec 2015 07:45 PM |
| But then how is terrain generated smooth by plugins? I see large plains that have the slightest change in elevation and I have no idea how to do this with x,y,z integer setcell. |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2015 07:48 PM |
| I actually crashed Studio trying to get that answer, it may take some time before I find out how. If you know an example of a game that did this please link me ^-^ |
|
|
| Report Abuse |
|
|
Alkan
|
  |
| Joined: 04 Dec 2008 |
| Total Posts: 907 |
|
|
| 15 Dec 2015 07:50 PM |
| Just generate some terrain and see how it is smooth and not blocky with traditional setcell(x,y,z) |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2015 07:55 PM |
| You're using whole integers which is probably positioning your terrain using a grid system, so you're getting static-y jump-y cell placement. ROBLOX's generation probably uses a bunch of float value to tween terrain to wear it wants. Even that isn't perfect (ROBLOX-generated mountains are jumpy like your terrain is). |
|
|
| Report Abuse |
|
|
Alkan
|
  |
| Joined: 04 Dec 2008 |
| Total Posts: 907 |
|
|
| 15 Dec 2015 08:00 PM |
| That makes sense. How do I make the terrain accept non-integers? |
|
|
| Report Abuse |
|
|
|
| 15 Dec 2015 08:00 PM |
the bottom script under "Procedual terrain generation" creates smooth terrain
how do it do that?
http://wiki.roblox.com/index.php?title=Smooth_terrain |
|
|
| Report Abuse |
|
|
Alkan
|
  |
| Joined: 04 Dec 2008 |
| Total Posts: 907 |
|
|
| 15 Dec 2015 08:08 PM |
| Thanks, that will work great for my project. I figured roblox didn't allow people to set more than individual cells by integer directly. |
|
|
| Report Abuse |
|
|