ID:2295042
 
(See the best response by Klogaum.)
Code:
var/icon/i=new()

var/n=1
for(var/j=0; j<=16; j+=1)
if(1)
var/t; if(j<10){t="000[j]"} else if(j<100){t="00[j]"} else {t="0[j]"}
i.Insert("[t].png","asd",1,n,0,0.33)
n+=1
sleep(1)


Problem description:

So my code just creates an animation and then stores it in my computer. It used to work for some pretty big animations like 500 frames but now it always crashes on about 20. What am I getting wrong??
Best response
At some point the loop rotates without sleep by turns enough to fall ( crash )

Probably if () == false == crash

var/icon/i=new()

var/n=1
mob/verb/test()
for(var/j=1 to 16)
if(1)//Probably here
var/t;if(j<10){t="000[j]"}else if(j<100){t="00[j]"}else{t="0[j]"}
i.Insert("[t].png","asd",1,n,0,0.33)
n+=1
sleep(1)

Twenty laps without sleep would never cause a crash

I've used a thousand laps in a tick and no problem

for(var/j=0; j<=16; j+=1)

The limit here is 16 laps without sleep

Send more pieces of code
i.Insert("[t].png","asd",1,n,0,0.33)


"[t].png" is not a valid argument. icon.Insert doesn't take strings as an argument. You need to load the file via the icon() proc first.
Thanks for the replies this used to work and now works again miraculously after switching to 411.1364.

just noticed the if(1) well it serves no purpose forgot to remove it after modifying code :)

Yes you are right just noticed the 1st parameter of Insert is an icon file.

Anyway thx for the help