ID:140145
 
Code:
mob/proc/IconSwitch(mob/icon1,icon2,state)
icon1.icon -= icon1.overlays
icon1.icon = icon2
icon1.icon_state = "[state]"


mob
icon = 'randomguy.dmi'
mob/verb/Switch_Icon()
IconSwitch(usr,'randomgirl.dmi', "")

turf/Grass
icon = 'test.dmi'


Problem description:
I cannot seem to get this to work.
For those that do not see what I am trying to do here...
I am trying to create a simple procedure to change the icon of any mob I want, whenever I want, with one line of code.
I thought of this while riding my fourwheeler, so I expected there to be problems.
I did not expect to not be able to know how to fix it.
Can anyone provide help?

Removing overlays from something's icon will do nothing, as overlays is a list and (icon) -= (list) is not defined.
In response to Garthor
Ok thank you, I got the answer from you and someone else.
I deleted that line and it worked fine.
Thanks a lot. I will just have to remove overlays before calling the procedure.