when saving to a savefile...
does it save all the vars or do I have to tell it to save the vars??
ID:266648
![]() May 3 2002, 1:20 pm
|
|
![]() May 3 2002, 1:24 pm
|
|
It saves all non-global, non-tmp vars.
|
Note: He never said using the Write() proc but yes if you do it does what Nadrew said. It also doesn't save const vars which there is no reason to if the value is constant.
|
ok tell me if this should work for saving all mobs and making sure their owner var is saved... plus typechar...
ok here we go... client/proc/Saveworld(mob/M as mob) world<<"World saving!! Lag monster coming!! Please hold." var/savefile/F=new("Save Files/AGameofKings.sav") for(M in world) F<<M F<<M.x F<<M.y F<<M.z F<<M.name F<<M.owner F<<M.typechar this should work right? |
Make life easy and look at this save code.
mob/proc/Save() var/savefile/F = new("[ckey].sav") Write(F) F["x"]<<x F["y"]<<y F["z"]<<z F["icon"]<<icon That's all you need for a save verb now for load mob/proc/Load() var/savefile/F = new("[ckey].sav") Read(F) var thex they thez F["x"]>>thex F["y"]>>they F["z"]>>thez F["icon"]>>icon var/mov=locate(thex,they,thez) Move(mov) Now for saving when ever something happens either logging out or getting kicked off or server froze.. client/Del() mob.Save() ..() :) |
why ckey.sav?!
I need to save everything even the things that don't have a user currently playing them. |