changeicon(i as icon)
set name = "Change Icon"
set category = "Player"
var/d="[i]"
if(findtext(d,".dmi"))
switch(alert("Are you sure?","Confirm","Yes","No"))
if("Yes")
var/icon/I = ("[i]")
var/w = I.Width()
var/h = I.Height()
if(w>=33||h>=33)
I.Scale(32,32)
src.icon = I
alert("You have successfully set your new icon.")
else
src.icon = i
alert("You have successfully set your new icon.")
else
alert("You can only set a .dmi file as your icon.")
Code:
runtime error: Cannot execute null.Width().
proc name: Change Icon (/mob/verb/changeicon)
usr: Blade (/mob)
src: Blade (/mob)
call stack:
Blade (/mob): Change Icon('blade_magus.dmi')
Problem description:
Top code is the actual code for my icon change verb, I'm trying to make it so it automatically resizes oversized icons to 32x32 (and also checks if the users on the other end are trying to use JPG images and such instead of dmi's.)
Bottom is the display in Dream Daemon.
It refuses to give me my icon, oversized or legal-sized, no matter what I change on it. Please help me understand and fix this. It's not doing what it claims it does in the examples in BYOND's reference.
edit: This problem has been fixed, read my response to Lummox JR for my current problem.
Not sure if that will fix it or not. :P