ID:262685
 
Code:
for(var/atom/a in oview(1))
a.overlays += new/obj/boom/boom()


Problem description:
this little snippit of code is giving me problems, when i run it, it gives the overlay to EVERYTHING on the map, instead of next to this one mob

oview(Dist,Center=usr)

- Dist = 1
- Center = ??? are you sure that usr is vaild here? if its not you will have to set the center
In response to Zmadpeter
new code:
for(var/atom/a in oview(1,m))
a.overlays += new/obj/boom/boom()

still doesnt work
You are looping through all atoms around usr, amoung these atoms is/are the area(s) surrounding the usr. I'm guessing you only use one /area in your entire map, and that will cause overlays to be added to that entire area (the whole map).

A continue statement will solve this.
for(var/atom/a in oview(1),src)
//Notice src. This may not be valid on your code.
if(isarea(a)){continue}
a.overlays += new/obj/boom/boom()


Also, using overlays might not be the best idea for your explosion effect (which I'm guessing '/obj/boom/boom' is). If you're using any overlays on anything in your game, then removing the boom overlay will also remove all the other overlays. Instead, make a graphical object that deletes itself after the effect is over:
obj/effect
icon = 'effects.dmi'
var/durration = "30"
New()
.=..()
spawn(durration)
Del()
In response to IainPeregrine
it works, except i have no idea what you are talking about the grahpical overlay.
In response to Rky_nick
I think he is suggesting that you just delete all the booms at the same time. A graphical overlay is for graphical purposes only(otherwise you cant interact with it). This may be a better code for graphical overlays:

for(var/atom/a in oview(1),src)
if(isarea(a)){continue}
var/icon/I = new('boom.dmi')//or the file name of your icon
a.overlays += I
spawn(30)
del(I)

Now this is untested though it should work and if it doesnt you should get the idea.

<font color=red><font size=5>ADT_CLONE</font></font>