ID:1229608
 
(See the best response by Albro1.)
Code:
//This is what i use to remove the overlay from the player icon

usr.overlays-=icon(icon)

//This is is what I save
F["Player"] << src
F["Verbs"] << verbs


Problem description:
The problem has to do with my equip system. I have one system that does all the work and just list of weapons and stats for it and run it threw the equip system.

I can equip and unequipped everything fine until I save and log-out, if I leave something equipped and try to unequipped it all the stats do what they should do but the overlay won't be removed. I've even tried it with just a single sword and it does the same thing it works fine until i save and log out and then it won't remove the overlay.

Code:
obj/Equip
Blazing_Sword
icon = 'BlazingSword.dmi'
icon_state = "show"
verb
Get()
set src in oview(1)
usr.contents+=new/obj/Equip/Blazing_Sword
usr.UpdateInventory()
del src
Drop()
src.Move(usr.loc)
usr.overlays-=icon(icon)
usr.verbs -= /mob/Skill/verb/Blazing_Cannon
usr.UpdateInventory()
Equip()
usr<<"You equiped [src]."
usr.overlays+=icon(icon)
usr.verbs += /mob/Skill/verb/Blazing_Cannon
usr.UpdateInventory()
UnEquip()
usr<<"You unequiped [src]."
usr.overlays-=icon(icon)
usr.verbs -= /mob/Skill/verb/Blazing_Cannon
usr.UpdateInventory()


If any more info is needed let me know. Thanks
Best response
You don't need to call icon() every time you add/remove an overlay. Simply doing usr.overlays += src will suffice. That way, you are adding an object that can be referenced - because creating a new icon and trying to remove it will make nothing happen because that icon you just created isn't in the overlays.
Yeah you have a good point. But even when trying that it doesn't work. The problem isn't that I can not add and remove the overlay, it's that after I save and log out of the game and then log back in and try to remove the weapon the overlay is still there. For both usr.overlays -= src & usr.overlays-=icon(icon) . It's after you log out and back in the problem happens.
Then the problem is in your saving. Make sure you aren't saving the overlays list. You can copy it (or even better, keep a list maintained of what you have equipped) and save that list, then use that to repopulate the overlays when they log in.
Well saving isn't really my strong point but I found away around the problem by using usr.overlays += I and just defining I as the 'sword.dmi'. and it seems to be working just fine. The trade off is that I can't really use the RBG thing to change the colors of the equipment. Well i can but once i logout then back in it has the same problem. So i guess everyone is going goth and just wearing black for a while.
I'd recommend learning how to use datums. Here's a non-plug-'n-play example of what you could do:

equipment
parent_type = /obj
var
red = 0
green = 0
blue = 0
proc
color(r=0,g=0,b=0)
//color the item

shirt
icon = 'bleh.dmi'


Not that you have to use datums, but they come in handy for organization.

This way, you can save the RGB values in the object.
Well I know how to add color to it but I tried it and it would work until I logout and back in again and it would give me the same problem again. So I just decided to take what works and just run with it. I've try to modify the way I safe to the way you first told me but I failed doing it that way too.
In response to Archfiend Master
You basically just repeated the same thing after I told you a possible solution. Some things aren't going to come quick, and datums can very often be one of them. You have to seek out knowledge about them. I believe there are one or two articles written about datums if you search the Resources, and plenty of posts here in the forums about them.
Well no, the usr.overlays += src acted worse then the way I had it to begin with, it would give me an overlay but then would sometimes act like and underlay which threw me off but still gave me the same problem. The changing the way I save kind of just confused me because I just couldn't figure out now not to save the overlay when saving the entire mob. However I did get the idea to use I as a var and define as the icon file usr.overlays += I from your usr.overlays += src. But yeah I think your right when you say it must be how I save but saving is just one of my weak points for some reason. But yeah wouldn't of found this make shift fix with your talk to you so thanks.
In response to Archfiend Master
For your "underlay problem" - check the layer on your object.

For your saving problem, try looking up savefile variables like dir.

Alternatively, read this section of the Guide.