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. :/