ID:98610
 
Applies to:Dream Seeker
Status: Open

Issue hasn't been assigned a status value.
line(start,distance,direction) would work something like view(), returning a list of everything in a straight line from an object.
for(var/obj/Bomb/B in line(src,3,src.dir)) B.Explode()
Something similar could be written in DM, but would probably be more efficient and accessible if built in.
I support this. (Block only returns turfs)
Support too.
proc
line(atom/start,distance=0,direction)
var/list/tmplist=new
for(var/atom/a in view(distance,start)
if(get_dir(start,a)==direction)
tmplist.Add(a)
return tmplist


This could give you what you wanted however since direction is estimated when dealing with diagonal directions, it may not give you the results you wanted.
I do have a system that can do just what you need if it has to be precise. It's called scope. Does the same thing, however it's accurate to 360 degrees. So a direction of 216.75 is an accurate direction. The actual range of what is checked too can be changed so, I can make a 45 degree "cone" to check and it will return all the atoms within that cone. So with me, the line procedure would be something like "line(src,3,90)" 90 would be north, however I have it set that Directions are automatically changed into their angular values. so if you put in NORTH, it will change it to 90 and then search that angle.

AbyssDragon.BasicMath has a getline() proc. It's obvious that it can and has been done with DM. It's clearly being requested that it should be a built-in proc.

This would also be nice in the map editor. Just sayin.

d('-'d)
That thing you posted would return wonky results, Bravo1. And it doesn't look like it will even compile.
proc/GetLine(var/atom/A,var/Dist,var/Dir)
if(!A) return
A=locate(A.x,A.y,A.z)
var/list/LineList=list()
for(var/i=1;i<=Dist;i++)
LineList+=A;LineList+=A.contents
A=get_step(A,Dir)
if(!A) break
return LineList

//Doesn't include areas though
Very true, Areas would be tricky.. we'll see what happens, if it become built-in the chances are they'll make sure to cover areas with it