ID:263127
 
Code:
mob
proc
Load()
src.frozen=1
switch(alert("Which Savefile do you wish to load?","Load?","SaveSlot 1","SaveSlot 2","SaveSlot 3"))
if("SaveSlot 1")
if(fexists("savefiles/[src.ckey]1.sav"))
var/savefile/F = new("savefiles/[src.ckey]1.sav")
Read(F)
F["usr"] >> src
F["last_x"] >> src.x//line 104
F["last_y"] >> src.y
F["last_z"] >> src.z
else
alert("No savefile found in the directory","ERROR")
return


Problem description:runtime error: Cannot modify null.x.
proc name: Load (/mob/proc/Load)
source file: Clicks.dm,104
usr: the juex (/mob/ChoosingCharacter)
src: null
call stack:
Load()
Load (9,6,2) (/turf/Load): Click(Load (9,6,2) (/turf/Load))well for some reason its not wanting to changeing clients x plese help


F["usr"] == null

null >> src

src == null

F["last_x"] >> null

null doesn't have a variable x!

==> error

That's my interpretation.
In response to PirateHead
Likewise, maybe you should have a line saying:
if(!F["usr"]){src<<"\red There's no mob saved!";return}
- GhostAnime
Your saving code is doomed to fail in its current state. First, you're loading directly to src, which is a huge no-no. Load to a local var. You're also not checking to see if anything was loaded.

After that, you need to load to local vars for x,y,z as well, and set the location all at once. If you try setting x, y, and z in turn, instead of at the same time via locate(), then if the mob has a null location it will stay there.

Lummox JR