mob/var/obj/GM_Star // to keep track of the object.
mob/Login()
..()
loc = locate(4,4,1)
if(usr.key=="ElderKain")
usr.GM_Star = new /obj/GM/Star // create a new instance of it.
spawn() usr.gmoverlay() // kick off the loop.
src.overlays -= GM_Star
mob/Logout()
src.overlays -= src.GM_Star
del(src.GM_Star) // remove the star when you log out.
..()
obj/GM/Star
icon='turfs.dmi';icon_state="star";layer=MOB_LAYER;density=0 // we only need one.
mob/proc/gmoverlay()
src.overlays -= GM_Star // remove the star.
src.GM_Star.pixel_y=32 // adjust the offsets.
src.GM_Star.pixel_x=0
src.overlays += GM_Star // add the star again.
sleep(1) // wait 1 tick and do it again for the new position.
src.overlays -= GM_Star
src.GM_Star.pixel_y=32
src.GM_Star.pixel_x=32
src.overlays += GM_Star
sleep(1)
src.overlays -= GM_Star
src.GM_Star.pixel_y=0
src.GM_Star.pixel_x=32
src.overlays -= GM_Star
sleep(1)
src.overlays -= GM_Star
src.GM_Star.pixel_y=-32
src.GM_Star.pixel_x=32
src.overlays += GM_Star
sleep(1)
src.overlays -= GM_Star
src.GM_Star.pixel_y=-32
src.GM_Star.pixel_x=0
src.overlays += GM_Star
sleep(1)
src.overlays -= GM_Star
src.GM_Star.pixel_y=-32
src.GM_Star.pixel_x=-32
src.overlays += GM_Star
sleep(1)
src.overlays -= GM_Star
src.GM_Star.pixel_y=0
src.GM_Star.pixel_x=-32
src.overlays += GM_Star
sleep(1)
src.overlays -= GM_Star
src.GM_Star.pixel_y=32
src.GM_Star.pixel_x=-32
src.overlays += GM_Star
sleep(1)
spawn() usr.gmoverlay() // call the proc again to make the start go around agan.
ID:171491
Sep 16 2004, 8:00 am (Edited on Sep 16 2004, 9:11 am)
|
|
It goes through the loops just fine, its just when i log out then back in, it leaves a trace star that won't disappear.
|
Sep 16 2004, 1:49 pm
|
|
Don't use usr in procs.
|
In response to Garthor
|
|
Garthor wrote:
Don't use usr in procs. I desided just to make it where it the icon was animated and went around the character automaticly on login. so this is what i'm using now, and it works just fine. mob/Login() |