ID:164995
 
How can it be done? I realise I must use list but I don't know how to use then in the way I want. like I want to display the charecters a person has in charecter handling?
Miran94 wrote:
How can it be done? I realise I must use list but I don't know how to use then in the way I want. like I want to display the charecters a person has in charecter handling?

If each player has a separate file, and each file contains a character in separate directories of the file, then you could get a list of characters like so:

proc/SavedCharacters(savefile/S)
var/nm
S.cd = "/"
for(var/d in S.dir)
/*
Usually characters are saved like so:

Bob = object(".0")
.0
type = /mob
... etc.
*/

// change to character dir
S.cd = d
// change to the .0 dir (or what have you)
S.cd = S.dir[1]
// now we have access to the mob's data
S["name"] >> nm
if(!.) . = list()
. += nm


Lummox JR
In response to Lummox JR
this is a snippet:

mob
Login()
var/login = {"
<style>
BODY {background:#000000;color:white;}
.:link {text-decoration: none; color: silver;}
</style>
<a href=?Simple><center>Create New Character</a></center>
<a href=?quit><center>Leave Game</a></center>
"}

usr << browse(login,"Window=William Tuner,size=350x200;titlebar=0")




client
Topic(href)
if(href == "Simple")
usr << browse(null,"Window=William Tuner")
var/oname = input("What is your name?","[world.name]") as text
usr.name = oname
if(href == "quit")
del usr