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.
ID:98610
Jul 14 2010, 7:39 am
|
|||||||
| |||||||
Jul 14 2010, 8:07 am
|
|
I support this. (Block only returns turfs)
|
proc 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) |