verb/Attack()
set src in oview()
for(var/mob/unit/M in view(arange))
M.overlays += image('misc.dmi')
Problem description: The above code is SUPPOSED to give the overlay to all units within arange (which is 5), but it's not.
What's wrong?
ID:144591
![]() Oct 20 2006, 7:35 pm
|
|
Code:
verb/Attack() Problem description: The above code is SUPPOSED to give the overlay to all units within arange (which is 5), but it's not. What's wrong? |
![]() Oct 20 2006, 10:09 pm (Edited on Oct 20 2006, 10:25 pm)
|
|
Speaking of ranges, just out of curiousity, is a circular range possible, like a radius of 5 instead of a block distance of 5?
|
Returns: A list of objects within Dist tiles of Center. That's from the reference. You know what we call a list of objects within 'dist' tiles of 'centre'? A circle. Also, the documentation states that range() is the same as view(), but without visibility concerns. View is a circle, too. EDIT: Although view() is broken. I posted this in the Bug Reports forum before, this is just a warning - view() seems to ignore sight flags. EDITEDIT: I was wrong. Testing it in DM/DS indicates that it DOES produce a rectangle. |
View is a circle? That's odd......then it's possible to set the view of the camera/world to be a circle instead of rectangle?
|
The reference says "You may use any valid view size, so an explicit view size such as "11x17" is also valid. ". 11x17 is a rectangle, not a circle. For further proof; here's a post from one of the developers of BYOND [link].
|
range() and view() are rectangles, not circles. I made a mistake.
But there are procedures floating around to draw circles, like the following procedure, from AbyssDragon's BasicMath library: proc Although it can be done faster: getcircle(atom/M, radius) |