ID:144322
 
Code:
mob/verb/test()
// start with a non-animated arrow icon
var/icon/I = new('arrow.dmi')
// make a new state called "blink"
var/icon/J = new('arrow.dmi')
I.Insert(J, "blink", delay=-1) // set rewind flag
// create darker shades of the arrow
var/n = 2
for(var/light=9, light>=5, light--)
J = new('arrow.dmi')
J.SetIntensity(light/10)
I.Insert(J, "blink", frame=n++)
// congratulations, you have a pulsating arrow
icon = I


Problem description:
I made an icon named arrows.dmi and drew an arrow icon_state in it, the icon_state has no name. When I run this code, nothing is inserted into the icon and the players icon is'nt blinking/pulsating. I've used this example in the past and I've come back to it now and now I can't get it to work.
The code looks okay, so I'm guessing the error is in the code using this icon. Try using ftp() to send yourself the icon file, and then check to see if it is producing the correct result. If not, it should at least be able to provide info on what really is happening.

Lummox JR
In response to Lummox JR
ftp() fixes the problem, thanks for the help.
In response to Zaltron
Zaltron wrote:
ftp() fixes the problem, thanks for the help.

ftp() shouldn't fix it outright; it should just send you a copy of the icon to look at. If it actually fixed the problem, then that's kind of strange.

But if ftp() is sending you a copy of the icon you expect it to, then that means the issue with the icon is elsewhere in your code.

Lummox JR
In response to Lummox JR
I used the example code for the Insert(icon) proc. I've used it before where it's worked. That with an older version of byond thuogh, I don't know if the later version of byond as messed with it. I even tried making a nw DM environment to test the Insert function. It still wouldn't work. ftp() does send me a copy though with all the icons I generated in DS.