ID:150282
 
Hey, how do i make it so that a person can make a character and keep that character? I need to make it so that they log in and make identity but don't have to repeat that process each time...
you need to create a save file that saves the character.
there is a fairly simple way to do this.

example:

mob
Login()
src.Menu()
proc
Menu()
var/list/menu = new
menu += "New Character!"
menu += "Load Character!"
menu += "Quit"
var/answer = input("What will you do?","[world.name]") in menu
switch(answer)
if("New Character!")
//character creation process here
if("Load Character!")
client.LoadMob()
if("Quit")
del(src)
verb
SaveCharacter()
client.SaveMob()
src << "Saved Character!"
client/proc/SaveMob()
var/savefile/F = new("[src.key].save")
F["char"] << mob
client/proc/LoadMob()
var/savefile/F = new("[src.key].save")
F["char"] >> mob

of course you will have to modify this a little, so that the login menu isnt called again, you can do this by setting a varaiable after character creation, then saving that variable with save mob, then when the mob is loaded, that variable wont be the defualt value, and the login menu wont be called, you can do that using an IF statement

FIREking