ID:167218
 
I've been busy writing up a basic isometric thingy for BYOND recently, and it mostly works - things draw, yay. But it isn't that interesting until you start giving turfs elevations, and at that point interesting things happen with some turfs overlaying others in the isometric display. The display is a screen image, and I've been calculating what layer (Using the in-built layer var) to display the turfs on using this formula:

round((3+dim+dim)-((y+x)*0.03125),1)


Where dim is the dimensions of the display (It's a square, so dim is the same for both sides), y is the isometric y co-ordinate of the object in pixels, and x is the isometric x coordinate of the object in pixels (Hence the division by 32).

I'm trying to set it up so that objects closer to the 'bottom' of the diamond overlay objects further away from it, but it don't work. There's a host of interesting errors, and I'm not sure what formula I should use. Any suggestions?
I've fixed this. There were a variety of problems with the formula.