ID:1541561
 
Code:
var/islands = 5
var/islandbasefailrate = 5
var/islandfailrate = 10
var/islanddeathtime = 4
var/islandspawnheight = 10
world
view = 15
New()
..()
WorldLoad()

proc
WorldLoad()
for(var/i, i<=islands,i++)
var/x = rand(10,world.maxx-10)
var/y = rand(10,world.maxy-10)
var/turf/islandspawn = new/turf/grass(locate(x,y,1))
islandgen(islandspawn, islandspawnheight)

islandgen(turf/T, H)
if(H <= islanddeathtime) return

for(var/turf/A in view(2,T))
if(!(isnull(A)))
if(A.type == /turf/water/middle && !(A.type == /turf/grass))
var/AH = H - rand(islandbasefailrate,islandfailrate) / 10
var/Tile = FindTile(AH)
var/turf/AT = new Tile(A)
islandgen(AT,AH)

FindTile(H)
if(H <= 4.20) return /turf/water/shore
if(H <= 4.30) return /turf/sand
if(H <= 100) return /turf/grass


So so, what im trying to do is generate a simple island for people to have fun on and it looks good, the problem? well everything i generate and island its comes out perfect... with 1 flaw, there is sand EVERYWHERE its like i went and put
turf
grass
New()
..()
if(rand(1,2)) new/turf/sand(src)

in my codes, which i didnt but still, if i can end up posting a picture i will right...
here:
 photo ErrorCode.png
if theres nothing there then i couldnt post a picture, but yeah, anyone know why or even have a tip for island genning? this is really my first time where ive gotten results near expectation with generating land btw, so im pretty nooby with generating land :S

I went ahead and made a quick simulation of the code that you provided here, and the results are pictured below.



(Note that the ugly tiles with the little red S in them are the 'shore' tiles.)

I can only assume that you meant shore when you said sand, or perhaps they are sharing the same icon, or there are other factors that I did not consider when making my quick simulation of it.

I went ahead and took the liberty of editing a few settings, after taking a close look at the code, and this is the island that ended up resulting:




    FindTile(H)
if(H <= 3.60) return /turf/water/shore
if(H <= 3.90) return /turf/sand
if(H <= 100) return /turf/grass

You'll note that there is quite a bit more grass and sand. In order to figure out how to 'fix' your specific problem, though, I do need to know what you actually want the behavior to be. Your code appears to be working, just not having the behavior that you wanted-- and it's important to know if these few edits give you the behavior you want, or if you should use a different method/find other edits to make.

Thoughts?
Hm no i meant sand, in my version its like i said, it is a mix of grass and sand, ill attempt to upload a picture in the OP also, my goal is to make a nice looking island, i thought that maybe it would be an island thats mainly grass, this grass is where i would randomly generate caves, trees, dirt patchs, ect, but thats for a later time, what i imagined this code to do is it make an island thats pure grass except for 2 blocks from the shore which would be sand, and then 2 blocks out from the sand would be shore, so it would be like OOSSGGGG O being shore, S being sand and G being grass of course since its random generation i dont wan it to be PURELY that, i wanted a bit of randomness, like maybe a piece of sand or 10 came in a bit, or the shore extended farther then it should have, just to make it feel real :s

Edit: Posted the pic in OP, the pic is after a while of me edit configs, but not even close to what i want, which is a nice looking island with sand and a shore that are remotely realistic