ID:156836
 
Alright, I activate a technique that gives me an overlay. When I save my character and re-log, the overlay appears on my character even though I set this code to remove the overlay from the player.

src.overlays-=/obj/certainoverlay


I set this to the login code and I know for a fact that it's removing the overlay but I think it might be that the overlay is blended in with the icon. One way I can remove the overlay is by removing all overlays from the player but I want to know if it's possible just to remove this one overlay.

All I did to add the overlay in the first place is:
src.overlays+=new/obj/certainoverlay
AbdelJN wrote:
Alright, I activate a technique that gives me an overlay. When I save my character and re-log, the overlay appears on my character even though I set this code to remove the overlay from the player.

> src.overlays-=/obj/certainoverlay

I set this to the login code and I know for a fact that it's removing the overlay but I think it might be that the overlay is blended in with the icon. One way I can remove the overlay is by removing all overlays from the player but I want to know if it's possible just to remove this one overlay.

All I did to add the overlay in the first place is:
> src.overlays+=new/obj/certainoverlay


Nope. Can't do that. Once you add an obj onto a player and logout, it's done. I personally only like adding ".dmi" to character's overlays anyhow. You should have some way of tracking what the player has equipped, should you not?
Although you don't want to remove all overlays when saving it is advised to do so for many reasons and there are countless ways to re-add them on a relog.

The main reason you should remove all is because the entire .dmi gets saved to the directory.

But anyways onto what you wanted in the first place.

removing the object wont work (or at the very least its an ineffective method)

just go and do

src.overlays -= 'overlayfile.dmi'


this will remove the entire overlay at the source instead of fiddling with objects etc.
In response to Teh Governator
Teh Governator wrote:
Nope. Can't do that. Once you add an obj onto a player and logout, it's done. I personally only like adding ".dmi" to character's overlays anyhow. You should have some way of tracking what the player has equipped, should you not?

Nope. You can. The issue is that overlays don't get saved (or loaded, one or the other) properly. It's a BYOND bug. I describe the workaround in [link]