Just out of curiosity, should I be using tmp when creating projectiles?
var/obj/L=new/obj/Knife(loc)
L.owner=src
walk(L,dir)
As Opposed To
var/obj/tmp/L=new/obj/Knife(loc)
L.owner=src
walk(L,dir)
The function of knife is just to do damage when it collides with a player. Would tacking on the tmp at the end do anything? The knife would be true for no longer than 1.5 seconds, if that.
Okay, consider the following subroutine:
damage() Would the tmp on the damage var be useful here? Or does it only apply to mob/vars? Apologies if this is coming off as a stupid question, I've been ignoring tmp for a long time, and want to go back and put it everywhere it needs to be |
tmp is used by savefiles and issaved() only. It has no other effect.
When you save an object to a savefile (with object.Write(savefile) or savefile << object), all of its savable variables are automatically written to the file. Declaring a variable as tmp makes it non-savable. And no, it's not just for mob variables. All datums, which have variables, can be saved. |
One last question. Saving as least much as possible is the right way to go, correct?
|
In response to SinfulPhoenix
|
|
Save according to your game's design.
|
So
Means that when you call mob.Write() it will ignore health when saving the mob to a savefile.