Hello,
I'm a complete newb to this, so bear with me. Please.
I want to add 'clothing' to this game, and I thought setting overlays was the best way to do it. So I followed this:
http://www.byond.com/ members/?command=reference&path=atom%2Fvar%2Foverlays
I pretty much did what the second example states.
The problem is, every time the user logs out the game and re-enters, the overlay cannot be removed with the 'remove_clothes()' verb.
Upon reading note 2 at the bottom, it says that I have to do something to keep the overlay separate from the icon file, by messing around in the Write and Read procs.
But, I have NO clue what to add to these.
Can someone help? I've been trying to think of ways, but it's such a brain hurter. :D
EDIT: Forgot to mention, the removing verb works if I save the game with a save() verb though, just when logging out and logging in, it seems to not want to work. It does auto-save when logging off, mind.
Thank you!
Basically, whenever you save a datum (the most basic, low level type in DM. All atoms, turfs, objects, mobs, ect inherit from it) with either Datum.Write(Savefile) or Savefile<<Datum, the datum's Write() process gets called. By overriding this process, we can temporarily empty out the overlays lists, let it do its normal thing, and then add the overlays back. This way, the saving routine won't blend them into the icon.
The reason you only saw the problem when you re-logged, was you had to load the icon from the savefile.
Also, I believe it's generally a bad idea to save icons at all, unless it's absolutely necessary. It bloats the savefiles.