turf
var
saveX = 0 //saves for the doormatt's 'x','y', and 'z'
saveY = 0
saveZ = 0
list
owner = list() //A list with all the people allowed in the house
doormatt //The "door matt" that the player will step on to see if he owns the house and if he wants to buy it
icon_state = "doormatt"
Enter(mob/M) //When the player attempts to enter the house
if(src.owner.len == 0) //if no one owns the house
switch(alert(M,"Do you wish to buy this house?","Buying House","Yes","No")) //makes a pop up that will as if the player wishes to buy the house, comes with two options..Yes and No
if("Yes") //if the player picked Yes
M<<"Welcome to your new house"
src.owner.Add(M.key) //Adds M.key to the owner list
return 1 //lets the player enter the loc of the doormatt
if("No") //if the player chose No
return 0 //won't let the player enter doormatt's loc
else //if it is owned by somebody
if(M.key in src.owner) //if M.key is the src.owner's list
return 1 //it lets the player in
else //if they player does not own the house
M<<"This isn't your house!!!"
return 0 //it won't let the player in
var/list/HouseStuff = list() //the variable that will store all the information
world/New() //when the world is created
if(fexists("House.sav")) //if the file "House.sav" exists
var/savefile/F = new("House.sav") //makes F equal what's in "House.sav"
F >> HouseStuff //Takes what is in F and puts it in HouseStuff
for(var/obj/Housestuff1/O in HouseStuff) //for all the objects in HouseStuff
if(istype(O,/obj/Housestuff1)) //if O is an object
O.loc = locate(O.saveX,O.saveY,O.saveZ) //Places O where it last was
for(var/turf/T in HouseStuff) //For all the turfs in HouseStuff
if(istype(T,/turf/doormatt)) //Make sure T is a turf
for(var/turf/S in world) //For all the turfs in world's contents
if(istype(S,/turf/doormatt)) //Make sure S is a doormatt
if(S.loc == locate(T.saveX,T.saveY,T.saveZ)) //if S's loc equals T's last loc
S.owner = T.owner //S's owner now becomes T's owner
HouseStuff.Remove(T) //Removes T from HouseStuff
world/Del() //When the world is deleted
var/savefile/F //creates a variable F, which is a savefile
F = new("House.sav") //F is "House.sav"
for(var/turf/T in world) //for all the turf in the world
if(istype(T,/turf/doormatt)) //make sure T is a tuf
T.saveX = T.x //T's last loc is recorded with these
T.saveY = T.y
T.saveZ = T.z
HouseStuff.Add(T) //Add T in HouseStuff
if(istype(T,/turf/house/woodfloor)) //if T is a woodenfloor
for(var/obj/Housestuff1/O in T) //for all objects that are at T's loc
O.saveX = O.x //records the object's last location
O.saveY = O.y
O.saveZ = O.z
HouseStuff.Add(O) //Adds O to HouseStuff
F << HouseStuff
obj
icon = 'objs.dmi'
Housestuff1
chair
icon_state = "Chair"
table
icon_state = "table"
density = 1
bookcase
icon_state = "Bookcase"
density= 1
verb
Get_Book()
set src in oview(1)
switch(input("What book do you want to get?") in list("Dark Forces","Healing","Serpants"))
if("Dark Forces")
new/obj/Items/Books/Dark_Forces(usr.loc)
if("Healing")
new/obj/Items/Books/Healing(usr.loc)
if("Serpants")
new/obj/Items/Books/Serpants(usr.loc)
jukebox
icon_state = "Jukebox"
density= 1
verb
MusicPlay(S as sound)
set src in oview(1)
set name = "Music Play"
set category = "Commands"
view(src) << sound(S,0)
view(src) << "[src.name] plays [S] for us!"
MusicStop()
set src in oview(1)
set name = "Music Stop"
set category = "Commands"
view(src) << sound(null)
view(src) << "[src.name] has stopped the music!"
var
saveX = 0
saveY = 0
saveZ = 0
turf
house //adding another part of the path
woodfloor //this is where the objects have to be on to be saved
icon = 'turfs.dmi'
icon_state = "WoodenFloor"
Problem description:When i log in and play it says do i want the house i click ok then i close the game open it up again and it asks me it again it should have saved but i dont think it did.