ID:155015
 
ok so im making a new game that uses roads but theres a problem

i have no idea how to find the obj next to the road aka
theres 2 roads facing north right by eachother i want to make it so they auto connect

so
this
|
||
turns to this
L

can someone tell me a simple code for finding the obj next to them in a certain direction?also more then 1 direction?
There's a library for this, search for autojoin and other similar phrases in the resources.
In response to Robertbanks2
kk thx
If I remember correctly you do something like this:
//set start_loc to the other road obj
for(var/obj/Road/o in get_step(start_loc, EAST))//Looks for any road obj's to the right of the starting location(start_loc)
o.icon_state = "whatever"


That's a simple way to check in one direction. I'll let you figure out the rest from here unless I get more time to write something up.