ID:1958790
 
(See the best response by Ter13.)

i dont know if im blind or its not in there. But can someonw tell the number to directions values please and thank you
Best response
NORTH = 1
SOUTH = 2
EAST = 4
WEST = 8


These are bitflags. So diagonals are combinations of these:

NORTHEAST = NORTH|EAST = 1|4 = 5
NORTHWEST = NORTH|WEST = 1|8 = 9
SOUTHEAST = SOUTH|EAST = 2|4 = 6
SOUTHWEST = SOUTH|WEST = 2|8 = 10
Fun with undocumented features: In your project, create a new file called stddef.dm. It will be filled in with the current stddef.dm that BYOND uses as part of every project.

Dir bitflags are fairly easy to manipulate. My favorite way of dealing with them is this check to see if a dir is diagonal: dir & (dir-1)

It's also easy to remember the numbers based on how they're organized:

Bit 0: y+1 (NORTH)
Bit 1: y-1 (SOUTH)
Bit 2: x+1 (EAST)
Bit 3: x-1 (WEST)
Bit 4: z+1 (UP)
Bit 5: z-1 (DOWN)