ID:1132984
 
(See the best response by LordAndrew.)
DM will let me turn icon variable into a tmp variable type but doesn't respect it...

player
parent_type = /mob
tmp/icon = 'whatever.dmi'

Logout()
var/savefile/s = new("players/[ckey].sav")
s << src
del src
..()


As long as icon is a valid file, it get's saved anyway...

This is either a compiler bug, user error (most likely?), or intended behavior not working properly... Not sure which!

Before you tell me to write my own Write() and Read(), please stay on topic.
The tmp type modifier indicates that an object variable should not be automatically written to the save file. This could mean that the variable is transient--that is, it is calculated at run-time and need not be saved. It could also indicated that the designer will handle saving of that variable specially and wishes to bypass the automated routine.

By the sounds of that, outside of Write() it will still save.
Best response
I don't think you can re-declare built-in variables using the tmp and global modifiers.
In response to A.T.H.K
A.T.H.K wrote:
The tmp type modifier indicates that an object variable should not be automatically written to the save file. This could mean that the variable is transient--that is, it is calculated at run-time and need not be saved. It could also indicated that the designer will handle saving of that variable specially and wishes to bypass the automated routine.

By the sounds of that, outside of Write() it will still save.

Yes, so why does it still save to the file?

I think that last part of the reference is simply iterating that setting something to tmp means BYOND, by default, will make NO attempt to save it, ever, unless you specifically do so.
In response to LordAndrew
LordAndrew wrote:
I don't think you can re-declare built-in variables using the tmp and global modifiers.

This is what I am leaning towards, but the compiler doesn't warn me or anything...
Work around for now: set icon to null before saving. Handle the icon your self after loading.
In response to FIREking
I'd just chalk it up to the compiler being weird. It doesn't give out warnings for a lot of things, like defining variables for the var type and doing things like proc::::::::::::::::.:::::::::::::::someFunction().
In response to LordAndrew
LordAndrew wrote:
I'd just chalk it up to the compiler being weird. It doesn't give out warnings for a lot of things, like defining variables for the var type and doing things like proc::::::::::::::::.:::::::::::::::someFunction().

Right then, thanks for swift replies gentlemen.