ID:173238
 
Is there a way to tell the max x/y in a given z level? I know you can check world maxx/maxy, but that obviously isn't just for one z level, unless you have all the exact same size maps, in which case you are boring. I'm looking for a way to use block to read turfs, and I made a low-end cap, but I'm not sure how to make a high-end cap.


~Pola~

[EDIT] I know that I can do this using get_step, or locate(coords), I'm just wondering if there is a cleaner way.
I dont know if this is possible, but can you make 2 for loops with each checking the current value(x/y for loops) and when each value is increased, also check whether the turf is null or not?
What you want is the max turf x and y huh?
Only way to do this is by looping trough the turfs and check what the max and min is in there x/y cords.
Appears that byond loops trough tiles horizontal (for(var/turf/T in world)) so you can stop the loop as soon as it had checked more turfs than you world_max-x and then check what the heighest x is but in order to check the max Y you will need to still loop trough the rest. Think your get_step method is the best and most efficient way to do it.

Greetz Fint
Wouldn't a map smaller than world.maxx and world.maxy get all the null spaces filled up with /world/turf ?
Polatrite wrote:
Is there a way to tell the max x/y in a given z level? I know you can check world maxx/maxy, but that obviously isn't just for one z level, unless you have all the exact same size maps, in which case you are boring. I'm looking for a way to use block to read turfs, and I made a low-end cap, but I'm not sure how to make a high-end cap.

The world map is a rectancular prism, not a stack of z levels. When you change maxx or maxy, you change it for all z levels.

To use smaller maps, you have to implement boundaries.

Lummox JR