ID:2545142
 
Code:
    for(var/mob/P as mob in range(2,usr))

if(usr.evil && M.indemonschool){P.inmagicschool=1; usr.inmagicschool=1}
if(usr.good && M.inmagicschool){P.inmagicschool=1; usr.inmagicschool=1}
if(M.inhell){P.inhell = 1; usr.inhell = 1}
if(!M.inhell){P.inhell = 0; usr.inhell = 1}
if(P.shimerexept)
var/obj/A = new(locate(P.x,P.y,P.z))
var/obj/B = new(locate(usr.x,usr.y,usr.z))
A.layer = 1000; P.Freeze = !usr.Freeze; usr.Freeze = !usr.Freeze
A.icon = 'magicgood2.dmi'
B.icon = 'magicgood2.dmi'
B.layer = 1000
flick("[usr.Teleport]",A)
flick("[usr.Teleport]",B)
hearers()<< "[P] teleports out!"
spawn(5)
P.invisibility = !P.invisibility
del A; del B
sleep(7)
P.x = M:x
P.y = M:y+1
P.z = M:z
usr.x = M:x
usr.y = M:y+1
usr.z = M:z
P.dir = SOUTH
usr.dir = SOUTH
M << "[P] teleported behind you!"
A = new(locate(P.x,P.y,P.z))
A.layer = 1000
A.icon = 'magicgood2.dmi'
flick("[usr.Teleport]",A)
B.layer = 1000
B.icon = 'magicgood2.dmi'
flick("[usr.Teleport]",B)
hearers()<< "[P] teleports in!"
spawn(5)
del A; del B; P.Freeze = !P.Freeze; usr.Freeze = !usr.Freeze
P.invisibility = !P.invisibility; usr.invisibility = !usr.invisibility
return


Problem description:
Ok so I'm trying to make this teleport verb that teleports the usr and anyone withing range(2) of usr. So the problem I'm having is trying to get the icon over the mobs. I've tried using flick(), overlays, flicking the icon over an invisible obj ontop of the usr. When I use overlays it rushes the icon for some reason so I've been using flick, but it still rushes when use on the mob so I use the flick on an obj that's over that mob for my other teleports, except now adding more people idk... confuses it? And only does one at a time idk. There's probably many WAY more efficient ways of doing this lol but this is what I have so far.
oh and I've also tried doing just obj A and using 'A = new' on P's loc but that didn't work either. Thanks for any help guys!!
I don't follow what you mean by "rushes". Personally I would just add objs to the map for the special effect, and let the objs disappear in their own good time, unless you need those objs to track with the mobs they're on.

If you need the effects to track, then my suggestion would be visual contents. The downside to this is that the effects will disappear from the old location as soon as the mobs they're attached to are relocated, which might not be what you want visually.

I think my preferred method would be to create two effect objects: one for visual contents on the mob, one for the destination. At whatever time looked right, I'd move the mob to the new location and move the second effect object to where the mob used to be. Then at the end I'd move the effect objs to a null location so the GC deletes them on its own.
Well I don't need the effect to linger, them being deleted when the mob relocates is fine. And by rushes I mean the effects don't complete before they are removed. I've been looking into visual contents and that seem like the best approach so far, thanks for the help ^^.