ID:168674
 
ok, say we have a monster defined called skeleton. the main purpose of the skelton is to walk back and forth n a platform, damagin any player it bumpbs into. say we have a platform turf defined(reference it as "p"). the look of the platforms together looks like the following:

S
PPPPPPPPPPPPPPPP

the ps are made into one big platform, and the S stands for the skeleton. now the question is, how would i make it so that the skeleton would walk back and forth on the platform, reaching one point were it ends, STOP, and begin walking in the other direction? i have tried, lost the code, but i do remeber he kept falling off and notturning back. cna dsomeone help me with this?
You had him walking? Easy for me then.

proc/getturf(atom/A,X,Y)
return locate(A.x+X, A.y+Y, A.z)

mob
Skeleton
Move()
..()
var/X
var/Y = -1
if(src.dir == WEST)
X = -1
if(src.dir == EAST)
X = 1
var/turf/Turf = getturf(src,X,Y)
if(!Turf.density)
src.TurnAround()
proc
TurnAround()
if(src.dir == WEST)
src.dir = EAST
if(src.dir == EAST)
src.dir = WEST