ID:263908
 
Code:
obj
Gmicon
name = "King Killer<font color = lime>"
icon='GM_Trans.dmi'
density = 1
zer = 1
New()
spawn(20)
icon_state"1"
spawn(20)
icon=state"2"
spawn(20)
icon_state="3"
spawn(20)
icon_state="2"
spawn(20)
icon_state=""
spawn(5)
if(src)
del src


Problem description:
Pirata help me please?
Well I expect it to change icon state. but it doesn't.
I have tried flick("3",src)(including the other states) but that hasn't worked either.

Use sleep() instead of spawn(), because how you're using it, it looped through the whole thing in less than a second.
hmm

src.icon = "1"
shouldnt it be so??

it should be

src.icon_state = "1"


also

if(src)
you dont have to check if there src is alive

and i prefer to put...

del (src)


name = "King Killer<font color = lime>"
hmm that name looks weird try just putting

name = "King Killer"



also the procs like New()/Del() needs a ..() MOST of them
In response to Kaiochao
obj
Gmicon
name = "King Killer<font color = lime>"
icon='GM_Trans.dmi'
density = 1
zer = 1
New()
sleep(2)
src.icon_state="1"
sleep(2)
src.icon_state="2"
sleep(2)
src.icon_state="3"
sleep(2)
src.icon_state="2"
sleep(2)
src.icon_state=""
spawn(5)
if(src)
del src

This is another portion of the code... what i want Gmicon to do. This is the attack that goes with it
     new/obj/Gmicon(locate(usr.x+6,usr.y+4,usr.z))
new/obj/Gmicon(locate(M.x+1,M.y-1,usr.z))
new/obj/Gmicon(locate(M.x+1,M.y+1,usr.z))
new/obj/Gmicon(locate(M.x-1,M.y-1,usr.z))
new/obj/Gmicon(locate(M.x+1,M.y,usr.z))
new/obj/Gmicon(locate(M.x,M.y-1,usr.z))
new/obj/Gmicon(locate(M.x-1,M.y,usr.z))
new/obj/Gmicon(locate(M.x+1,M.y+1,usr.z))
new/obj/Gmicon(locate(M.x+1,M.y,usr.z))
new/obj/Gmicon(locate(M.x,M.y+1,usr.z))
new/obj/Gmicon(locate(M.x-1,M.y+1,usr.z))
new/obj/Gmicon(locate(usr.x+3,usr.y+1,usr.z))
new/obj/Gmicon(locate(usr.x+4,usr.y+2,usr.z))
new/obj/Gmicon(locate(usr.x+2,usr.y+5,usr.z))
new/obj/Gmicon(locate(usr.x+3,usr.y+5,usr.z))
new/obj/Gmicon(locate(usr.x+1,usr.y+5,usr.z))
new/obj/Gmicon(locate(usr.x+1,usr.y+5,usr.z))

Ok this here. Everything works alright but the objects spawn EXTREMELY slow
In response to CK Productions
Alright, here's the place to put the spawn. Right after New() for the Gmicon, tabbed. Tab everything under it in New() also.
In response to Kaiochao
Everything works right when i use spawn(x) but when i change it sleep(x) it takes 2 minutes to spawn one of them
In response to CK Productions
That's because when you create them, the sleeps pause the whole thing. The creating waits for the object's New() proc to finish.

spawn() makes it so whatever that is under it and tabbed will not pause the New().
What I meant in my previous post:
New()
..()
spawn
icon_state=""//blah blah blah

You might want to look up procedures or whatever you aren't sure about in the DM Reference.
In response to Kaiochao
obj
Gmicon
name = "King Killer<font color = lime>"
icon='GM_Trans.dmi'
density = 1
zer = 1
New()
..()
spawn()
sleep(20)
src.icon_state="1"
sleep(20)
src.icon_state="2"
sleep(20)
src.icon_state="3"
sleep(20)
src.icon_state="2"
sleep(20)
src.icon_state=""
spawn(5)
if(src)
del src


Is this it? If this is it, it is still taking me forever to spawn me each object.
In response to CK Productions
Pay attention to indentation. Like I said twice before, indent everything under spawn().
In response to Kaiochao
OOOH My bad. I had misread what you had said previously sorry about that. But, we never fixed the problem with it not changing icon states. I think I forgot to mention that. (sorry AGAIN)