ID:1275344
 
(See the best response by Neimo.)



Problem description:I'm trying to make a game and I don't know how to make a save file. I want to create a folder that holds all saves in a folder within the hosting folder. I also want for players to have they're own saved folder with their name on it.

Queries on savefile exporting. A library that provides some of the things you're asking for as well.

var/savefile/F = new("folder/[src.key].sav")
okay but how do i save things like location with that? like I want to save player's stats too. I've dl some tut but they don't really explain.
Best response
I particularly like this search find, read through this and it might help you out.
Thanks will do.
I'm a bit confused.

1) If possible can you explain how it's coded. Cause I'm trying to learn how to save the player's stats, contents, and location, and guild/squad. I'm not sure how exactly to code it in.

2) I also want to make an object that store iteams. e.i. dresser on the map. I want the dresser to store the condition the item was received etc. First I was like to learn how to save mob's info
In response to Alex Ovide
How do you want me to explain how it's programmed? It's shown in the post I provided. It already does what you want it to do.
So at this point it saves everything the player has under mob vars?
what does the "F" represent? file= "F"?
The variable's name.

var/mob/m // you reference like so:
m.stamina -= src.strength

var/savefile/f = new(...)
f["something"] << src.something
Okay I kinda understand it better. Can you assist me with "list".
I'm trying to make a list for GM in the game where it saves added GMs so I don;t have to constantly hard code them in...


so far I have
 
var/list/Staff
Staff = list("Alex Ovide", "kryu","")
proc/StaffCheck()
if(usr.key=usr.Staff)
world<<"An staff member has logged online
You should definitely visit the DM Guide and the Reference. You don't quite know how the language works and you surely should not be on the subject of "GMs" with your level of knowledge.
In response to Albro1
Let's let him slide. It's late, lol. I just hope he has a little knowledge towards the language, it's better than nothing.

var/list/blacklist = list("Darkwizrd", "Hitler", "Bush")
// check whether or not you're in the list
if(src.key in blacklist)
or
if(blacklist.Find(src.key))
src << "You are not welcomed."
// purge that bastard
del(src)

var/list/list = new
// adding/removing from lists
list.Add(a)
list.Remove(a)
list += a
list -= a

// modifying things inside the list
list[a] = "first"
list[b] = "second"
world << "index 1: [list[a]]<br>index 2[list[b]]"
you flippin rock NEIMO ^_^
now how would I code add/subtract to/from list as a verb?
the "list.Add(a)" i don't understand that part, nor know where to place it
In response to Alex Ovide
Push F1 and look up the Add() proc.