ID:157521
 
well this is a problem i come across while using isometric.
to check the user's pixel_z you have to read a turf. what if there 2 turf in the same location with different pixel_z e.g 1 with 32 pixel_z, one with 64 pixel_z. how will i be able to deal with that problem. any thought would be helpful.
XnathanielX wrote:
(...)to check the user's pixel_z you have to read a turf

I'm not sure how you came to this conclusion, but it isn't exactly valid. To access an atom's pixel_z variable, you just check an atom's pixel_z variable.


XnathanielX wrote:
what if there 2 turf in the same location

That's impossible. There can only ever be one turf at any given location by definition. Everything else is just a graphical effect.
There are never two turfs in the same location. When you put one turf on top of another in the map editor, the old turf becomes an underlay.

Lummox JR
In response to Schnitzelnagler (#1)
what about obj then?
In response to XnathanielX (#3)
btw since my game is gonna be up to probally 1280 pixel_z levels in total all full of objs

edit
obj
var
pixelfloat

New()
..()
src.pixelfloat = src.pixel_z + 32 / 32

Entered(atom/O)
if(src.density == 1)
var/check = src.pixelfloat * 32
var/check2 = O.pixel_z + 2
var/check3 = check - check2
if(check == check2 & check3 > 0)
O.pixel_z = check
if(check3 < 0)
while(src.density == 1)
O.pixel_z -= 16
if(src.pixel_z == check)
return

well here a snip of the gravity system. as you see the problem is if multi obj are on the same tile what would happen.
In response to XnathanielX (#4)
...nothing, because Entered() isn't called for objs when you move to their location?
In response to Garthor (#5)
what can you use for obj then?
In response to XnathanielX (#6)
You can write a Stepped_On() proc like so:

turf
Entered(atom/movable/A)
..()
for(var/atom/movable/M in src)
if(A == M) continue
M.Stepped_On(A)

atom/movable
proc/Stepped_On(atom/movable/M)
In response to Garthor (#7)
for an OBJ!... because i need an stack of objs, not a turf.
In response to XnathanielX (#8)
The problem here is that you are supposed to try and understand what Gathor is suggesting here instead of lindly copy and pasting. If you did so, you'd see how his last posting in combination with his previous reply would kind of fit to your request. Even though your request was rather not what you really wanted, but that's an entirely different topic.