ID:139812
 
code
mob/white
icon = 'player_white.dmi'
icon += 'white_hood.dmi'


Ok, I thought this part would be rather simple but for some reason I cant find anyway to make it work. What I am attempting to do is I have characters with their heads cut out, and I am trying to add their head to the body icon on creation. They will have the ability to take their cloak off, and also change hair color. But I cannot get these two icons to "merge" on creation for some reason. Any help would be great B). Thanks!

these are the errors i get:
main.dm:363:error: icon: duplicate definition
main.dm:363:error: 'white_hood.dmi': duplicate definition
main.dm:363:error: +=: instruction not allowed here


What you should be looking at are overlays. As the DM Guide states: overlays are a list of icons which are displayed on top of the object's main icon. In your case, you would use the += operator to add the hood. However, because overlays is a list, you could also use overlays.Add().
In response to RJTaylor
mob/White
icon = 'playerwhite.dmi'
usr.overlays += 'whitehood.dmi'


this piece of code results in this error:
main.dm:364:error: usr.overlays: duplicate definition
main.dm:364:error: 'white_hood.dmi': duplicate definition
main.dm:364:error: +=: instruction not allowed here


and

mob/white
icon = 'player_white.dmi'
overlays.Add('white_hood.dmi')


results in this error:
main.dm:366:error: bad argument definition


Both of which i had previously tried before resorting to the forums. I have tried various other things all with no success either.

Im sure its a minor little thing i need to do to get this to work, but for some reason i cant figure it out at all. If there are any more suggestions out there im MORE then welcome to try, and thanks to all those that have already suggested!
In response to Vahn363
You can't set non-constant values at compile-time.

mob
New() // When the mob is created.
..() // Very important, calls the default parent
overlays += 'my_icon.dmi'