ID:262511
 
Code:
pet
density=0
icon='pet.dmi'
parent_type=/mob
var
id
mob/owner
hp
mhp
mp
mmp=0
slugby
name="Slugby"
mhp=25
New()
..()
id="[rand(0,9)]"
while(id in ids)
for(var/i=1 to 9)id+="[rand(0,9)]"
ids+=id
icon_state=ckey(name)
hp=mhp
mp=mmp
mob
icon='player.dmi'
Move(l,d)
var/oldloc=loc
.=..()
if(.&&pets.len)
for(var/pet/pet in pets)
var/h=pet.loc
pet.loc=oldloc
oldloc=h
var
list/pets[0]
verb
makepet()
if(pets.len>2)return
var/pet/slugby/s=new(loc)
s.owner=src
pets+=s
savefile()
if(save())src<<"Saved file"
loadfile()
if(load())src<<"Loaded file"
proc
save()
if(!pets.len)return 0
var/savefile/s=new("/players/[key]/[ckey].sav")
for(var/pet/pet in pets)
s["[pet.id]"]<<pet
s["[pet.id]x"]<<pet.x
s["[pet.id]y"]<<pet.y
s["[pet.id]z"]<<pet.z
s["pets"]<<pets
s["x"]<<x
s["y"]<<y
s["z"]<<z
return 1
load()
if(!fexists("/players/[key]/[ckey].sav"))return 0
var/savefile/s=new("/players/[key]/[ckey].sav")
var{a;b;c}
s["pets"]>>pets
s["x"]>>a
s["y"]>>b
s["z"]>>c
for(var/pet/pet in pets)
var{d;e;f}
s["[pet.id]"]>>pet
s["[pet.id]x"]>>d
s["[pet.id]y"]>>e
s["[pet.id]z"]>>f
pet.loc=locate(d,e,f)
world<<"[a] [b] [c] [d] [e] [f]"
loc=locate(a,b,c)
return 1


Problem description:
I know this is simple, but, whenever I load the numbers are outputted correctly, yet there's [pet#] mobs at start when I load the thing, and the location of the player is whacked. :/
I'd help you if my eyelids weren't itchy... i'm good with savefiles... I learnt mine from scratch, and they work perfectly... if you still need my help when I wake up, i'll be glad to give it to you.
So basically
pet.loc=oldloc
is not working? Are you sure you are saving the oldloc into the save file?

~>Jiskuha
In response to Jiskuha
"pet.loc=oldloc" is the Move() proc. :/
In response to Ol' Yeller
Why when they move? Just make it when the mob is loaded in login it check the save for the pet and places the location of the pet on the map with the player.

~>Jiskuha
In response to Jiskuha
You don't understand what the oldloc thingie is for, it's making it a caterpillar style movement making it look like better eyecandy.
In response to Ol' Yeller
Ol' Yeller wrote:
You don't understand what the oldloc thingie is for, it's making it a caterpillar style movement making it look like better eyecandy.

Change it and see if thats where you screwed up ;).

~>Jiskuha
In response to Jiskuha
Any updates? Did you manage to fix this at all?

~>Jiskuha