for(var/atom/T in oview(5))
spawn()
var/ico = T.icon
T.overlays += /obj/Moku
T.icon = ico
sleep(200)
T.overlays -= /obj/Moku
T.icon = ico
Problem description:
I'm trying to avoid spawning 55 objects for one attack by using overlays and for some reason when I....
1. use turfs it deletes some turfs instead of overlaying them like i am spawning objects over them
2.use atom it spawns the overlay on every thing in the z level
any ideas?
This wouldn't do it. Check if the overlay you're adding is valid and doesn't make it look like that visually, perhaps.
Obviously it would (but not in the whole z level, but in range of 5). You don't need to tell us that looping through atoms is going to match Areas, Turfs, Objs and Mobs. That's fairly obvious. If you want to loop only through turfs, then loop only through turfs, not their parents. Looping through atoms would handle it the same way anyway, just will include more types of objects.
Note that you're using usr in the oview() call, and setting the turf's icon to its own, same icon, pointlessly. Just things to be aware of.