ID:1358350
 
(See the best response by Kaiochao.)
I'm currently trying to scale an icon after uploading it, but for some reason it isn't working... I used to do something simillar in the past, and it worked, so I wondered where's the error.

mob/proc
Upload_Icon(F as icon)
Icons.Add(F) // this is is for a var list which includes some mob's icons.
var/icon/S = new/icon (F) // this is for creating a new icon using the previous file (I do this so I can have a thumbnail)
S.Scale(96, 96)
Thumbnails.Add(S)


For some reason when I try to display S I get nothing, I don't really know where's the error because I've tried some other ways, but none worked. F is showed correctly, but I never get it to work with S, any idea? :S

Thank you!
Try adding fcopy_rsc(S) instead of S.

Using fcopy_rsc on S would return the S graphic in an equivalent format as F, so it should probably work.
In response to Kaiochao
Kaiochao wrote:
Try adding fcopy_rsc(S) instead of S.

Using fcopy_rsc on S would return the S graphic in an equivalent format as F, so it should probably work.

Like this? var/icon/S = fcopy_rsc(F)

If so, it didn't work either :S I tried before but the icon wasn't shown either, and Scale gives me then an error. I can't understand where's the problem. I do the same on a different game, but I don't save it to a var, I download the scaled image and everything works well, I have no idea why it isn't working now. Adding an icon to a list can bug the whole proc?
Try the same image passed to F on the other game to see if an error occurs. Or try lots of different DMI files from different time periods. Some DMI files are little problem children.
In response to Eternal_Memories
Best response
When I said adding, I actually meant for inside Add().
Thumbnails.Add(fcopy_rsc(S))
In response to Kaiochao
Kaiochao wrote:
When I said adding, I actually meant for inside Add().
> Thumbnails.Add(fcopy_rsc(S))
>


Thank you a lot! This worked :)