ID:170755
 
Is it possible to save var's of an area? I currently have a house system that goes a little something like this:
area/house
House1
House2
var
owned
Enter(atom/movable/A)
if(ismob(A))
var/mob/M=A
if(owned)
if(M.owner=="House1")
return 1
else
switch(alert("",,"Yes","No"))
if("Yes")
M.owner="House1"
owned=1
else
M<<"You dont have enough G!"
if("No")
return 0
and i was wondering if it would be possible to set the owner of that house as a var and then save it some how. I haven't really touched on save files in awhile so could someone give me some information on if this can be done and if so how?

~>Jiskuha
Well, if you save the area itself, you also save its contents, the turfs. If you save the turfs, you save everything on the turf, the objs, and the mobs. If you save the mobs, you could be saving players, and then you get an ugly mess! :p

If the area already exists(is put on the map at compile time), then you just need to save some way to identify the area(possibly you could give each area a unique tag variable), and then the owner variable. When you load, find the area using the tag, and then set the owner.
In response to Jon88
Okay,Even so I'm not too sure on how to program this. Tips? Starter? Anything to help me along?


~>Jiskuha
In response to Jiskuha
Bump()! Anyone that could show me? I am lost.

~>Jiskuha