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
ID:262685
Oct 18 2005, 2:27 pm
|
|
Code:
for(var/atom/a in oview(1)) 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 |
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) 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 |
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) 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> |
- Dist = 1
- Center = ??? are you sure that usr is vaild here? if its not you will have to set the center