runtime error: Cannot create objects of type null.
proc name: Load (/mob/proc/Load)
usr: (src)
src: SoulGamesProductions(/mob)
src.loc: Turf (653,6,4) (/turf/Grass)
call stack:
SoulGamesProductions(/mob): Load()
SoulGamesProductions(/mob): cLoad Character()
proc
Save()
if(In_Game)
var/savefile/S = new("Savefiles/[uppertext(copytext(key,1,2))]/[key].sav")
Write(S)
Load()
if(!In_Game)
var/savefile/S = new("Savefiles/[uppertext(copytext(key,1,2))]/[key].sav")
Read(S)
for(var/obj/Items/A in src.Inventory)
A.InInv = 1
usr.BankInUse = 0
usr.isingame = 1
loc = locate(Last_X,Last_Y,Last_Z)
cLoad_Character()
set hidden = 1
if(In_Game)return
if(fexists("Savefiles/[uppertext(copytext(key,1,2))]/[key].sav"))
winset(src,"Default","is-visible=true")
winset(src,"Login","is-visible=false")
winset(src,"NewChar","is-visible=false")
winset(src,"Login","is-default=false")
winset(src,"NewChar","is-default=false")
winset(src,"Default","is-default=true")
winset(src,"MapI","is-default=true")
winset(src,"MapII","is-default=false")
Load()
Problem description:Some players get rollback on the game and it just happens some times. Like there has a auto-save every 5 minutes and then the mob log-out it saves but they still back to the save of 3 days ago. What could it be?
No put usr in proc. Ungh.
With that out of the way, let's talk about rollbacks. What's happening here is that your players' mobs are saving more than you actually want them to: They're saving other players' mobs.
This usually happens when you save a turf instead of specific x,y,z vars; the turf saves, and if a mob is standing on it, the mob is included in the savefile. Such a var should be /tmp so that it doesn't save.
There are other ways for this to happen too. For instance, if your mob is carrying an obj that has a var pointing to its original owner instead of a key--surprise, you just saved the original owner too. If your mob has a datum pointing to their party, and the datum has a list of party members, and that datum saves, then every mob in the list saves too.
The good news is you don't have to do a pwipe to be rid of this. But you do have to go through your savefiles and rid them of excess mobs, by opening them up in a savefile editor. I would suggest looking through the biggest ones first, since they'll be the most broken. You should take a look at which vars are saving the extra mobs, and then take care to change those vars to /tmp so they don't save.
You can also override Read() so that before reading the mob, you Remove() any of those vars that shouldn't be saving (or, load only the parts you need; like for instance for a turf you could just grab its coordinates). If that's done properly, the old broken saves can still be used because they'll eventually be purged of all the data you don't want.