ID:142303
 
Ok so i finally figured out what exactly was wrong with my save proc and what was happening and figure I would post the results so anybody else with similar problems might get the answer.

Problem description:
Sometimes the loc would get messed up and wouldnt load, or it would load someone elses mob along with yours. As if the players are linked.

Solution:
So after waiting until there was the problem with a file I went through and took out every load var one by one to figure out which var was calling the rollback and figured out what was causing it.
When i was defining my Spawn var i was using the mobs current loc as the reference. If there is a mob on the location when you save it you save the mob as well. So you dont want to save the location of the spawn with a variable. Unless somebody knows a way to save a loc to a var so you can use "usr.loc=usr.Spawn" but as of now i cant so i dont save my Spawn var and just redefine it in my load proc.

F["mob"] << src


That would cut your code down...alot.
In response to Jeff8500
actually i went away from doing that cause i dont want to save all variables and when i did i got more problems so i went to saving the specific variables that i want to save
In response to NightJumper88
Set the vars you don't want to save as tmp vars.
In response to Jeff8500
i have them set as tmp but i was still getting stuff coming back i just dont trust the built in save stuff
In response to NightJumper88
Stuff was "coming back" because you kept the same save files most likely. There's no reason not to trust DM's built in functions.
In response to Jeff8500
whats wrong with keeping the save files they should still work shouldnt they
In response to NightJumper88
and this is getting away from my question anyways i need to figure out why sometimes the loc is messed up
In response to NightJumper88
It's fine, yes, but as I said, stuff kept "coming back" because you never overwrote/removed those parts of the files.
In response to Jeff8500
ok so how would i do that
In response to NightJumper88
Delete the save folder, and then open your world...
In response to Naokohiro
Ok i need to figure out whats going on with this it sometimes links players together but there are no variables that are saved that link players and it happens quite often now.
In response to NightJumper88
What exactly do you mean by, "links players together?"
In response to Naokohiro
when one player loads it effects another player and sometimes reverts back to old state. But lately its been saying its logged out
In response to NightJumper88
It happens the same with me... Whenever someone logs in, a random player logs out, and sometimes they lose their Character:

http://www.byond.com/developer/forum/?id=628408
NightJumper88 wrote:
Ok so ive had this problem for awhile now but it doesnt always do it. Sometimes the save or load doesnt work for the location and it will load all the stats but not the mob location and then go to the logout proc.

Code:
> Load()
> if(fexists("Players/[src.ckey].sav")) //check if they have a file
> //placing a \n in a popup will cause the text to jump to the next line
> var/savefile/F = new("Players/[src.ckey].sav") //load up the players file
> var/LastX //these 3 variables are here since you cant directly save a players location
> var/LastY
> var/LastZ
> var/list/tempverbs
> F["verbs"] >> tempverbs
> for(var/v in tempverbs)
> if(text2path("[v]"))
> verbs += v
> F["LastX"]>>LastX //this saves a variable to the savefile, the << point at where youre sending the data
> F["LastY"]>>LastY
> F["LastZ"]>>LastZ
> F["name"]>>src.name
> F["dir"]>>src.dir
> F["Level"]>>src.Level
> F["Stamina"]>>src.Stamina
> F["MaxStamina"]>>src.MaxStamina
> F["Chakra"]>>src.Chakra
> F["MaxChakra"]>>src.MaxChakra
> F["Exp"]>>src.Exp
> F["NExp"]>>src.NExp
> F["yen"]>>src.yen
> F["Ninjutsu"]>>src.Ninjutsu
> F["Taijutsu"]>>src.Taijutsu
> F["Genjutsu"]>>src.Genjutsu
> F["Seal_Speed"]>>src.Seal_Speed
> F["contents"]>>src.contents
> F["Bloodline"]>>src.Bloodline
> F["kills"]>>src.kills
> F["deaths"]>>src.deaths
> F["D_mission"]>>src.D_mission
> F["C_mission"]>>src.C_mission
> F["B_mission"]>>src.B_mission
> F["A_mission"]>>src.A_mission
> F["S_mission"]>>src.S_mission
> F["weaponequip"]>>src.weaponequip
> F["jutsu"]>>src.jutsu
> F["Village"]>>src.Village
> F["Chakratype1"]>>src.Chakratype1
> F["Chakratype2"]>>src.Chakratype2
> F["Chakratype3"]>>src.Chakratype3
> F["Spawn"]>>src.Spawn
> F["rank"]>>src.rank
> F["goukakyu"]>>src.goukakyu
> F["bugs"]>>src.bugs
> F["shino"]>>src.shino
> F["sasuke"]>>src.sasuke
> F["hyuuga"]>>src.hyuuga
> F["haku"]>>src.haku
> F["Sharuse"]>>src.Sharuse
> F["activesharingan"]>>src.activesharingan
> F["pet"]>>src.pet
> F["dogname"]>>src.dogname
> F["guild"]>>src.guild
> F["guildowner"]>>src.guildowner
> F["guildtitle"]>>src.guildtitle
> F["Henge"]>>src.Henge
> F["waterwalk"]>>src.waterwalk
> F["onwater"]>>src.onwater
> F["ccontrol"]>>src.ccontrol
> F["thunderattack"]>>src.thunderattack
> F["OOC"]>>src.OOC
> F["villagekills"]>>src.villagekills
> F["kageuse"]>>src.kageuse
> F["icon"]>>src.icon
> F["icon_state"]>>src.icon_state
> F["hair"]>>src.hair
> F["skills"]>>src.skills
> F["Gateslearned"]>>src.Gateslearned
> F["Screen"]>>src.client.screen
> src.overlays+=src.hair
> src.loc=locate(LastX,LastY,LastZ)
>

> mob/proc
> Save()
> if(src.z==16||src.z==17||src.z==18)
> return //we dont want to save them at the title screens!
> var/savefile/F = new("Players/[src.ckey].sav") //creates a new savefile or overwrites an old one
> F["verbs"] << verbs
> F["LastX"]<<src.x //this saves a variable to the savefile, the << point at where youre sending the data
> F["LastY"]<<src.y
> F["LastZ"]<<src.z
> F["name"]<<src.name
> F["dir"]<<src.dir
> F["Level"]<<src.Level
> F["Stamina"]<<src.Stamina
> F["MaxStamina"]<<src.MaxStamina
> F["Chakra"]<<src.Chakra
> F["MaxChakra"]<<src.MaxChakra
> F["Exp"]<<src.Exp
> F["NExp"]<<src.NExp
> F["yen"]<<src.yen
> F["Ninjutsu"]<<src.Ninjutsu
> F["Taijutsu"]<<src.Taijutsu
> F["Genjutsu"]<<src.Genjutsu
> F["Seal_Speed"]<<src.Seal_Speed
> F["contents"]<<src.contents
> F["Bloodline"]<<src.Bloodline
> F["kills"]<<src.kills
> F["deaths"]<<src.deaths
> F["D_mission"]<<src.D_mission
> F["C_mission"]<<src.C_mission
> F["B_mission"]<<src.B_mission
> F["A_mission"]<<src.A_mission
> F["S_mission"]<<src.S_mission
> F["weaponequip"]<<src.weaponequip
> F["jutsu"]<<src.jutsu
> F["Village"]<<src.Village
> F["Chakratype1"]<<src.Chakratype1
> F["Chakratype2"]<<src.Chakratype2
> F["Chakratype3"]<<src.Chakratype3
> F["Spawn"]<<src.Spawn
> F["rank"]<<src.rank
> F["goukakyu"]<<src.goukakyu
> F["bugs"]<<src.bugs
> F["shino"]<<src.shino
> F["sasuke"]<<src.sasuke
> F["hyuuga"]<<src.hyuuga
> F["haku"]<<src.haku
> F["Sharuse"]<<src.Sharuse
> F["activesharingan"]<<src.activesharingan
> F["pet"]<<src.pet
> F["dogname"]<<src.dogname
> F["guild"]<<src.guild
> F["guildowner"]<<src.guildowner
> F["guildtitle"]<<src.guildtitle
> F["Henge"]<<src.Henge
> F["waterwalk"]<<src.waterwalk
> F["onwater"]<<src.onwater
> F["ccontrol"]<<src.ccontrol
> F["thunderattack"]<<src.thunderattack
> F["OOC"]<<src.OOC
> F["villagekills"]<<src.villagekills
> F["kageuse"]<<src.kageuse
> F["icon"]<<src.icon
> F["icon_state"]<<src.icon_state
> F["hair"]<<src.hair
> F["skills"]<<src.skills
> F["Gateslearned"]<<src.Gateslearned
> F["Screen"]<<src.client.screen
> src<<"<font size=1><font color=red><B>Info: <font color=green>Your game has been saved"
>

Problem description:
try to use the Read()/Write() procs
In response to Cybork
Did you ever find a way to solve it
In response to NightJumper88
Lately I added a turf/obj save system and it looks to be working...
In response to NightJumper88
Try to override the Read and Write procs.
mob
Read() //do nothing!
Write() //same with you!