ID:176220
 
Here is my Login + creating character codes:

#include

world
mob = /mob/creating_character

client/base_save_verbs = 0
client/base_num_characters_allowed = 10


mob/creating_character
base_save_allowed = 0

Login()
spawn()
src.CreateCharacter()


proc/CreateCharacter()
var/prompt_title = "New Character"
var/help_text = "What do you want to name the character?"
var/default_value = key
var/char_name = input(src, help_text, prompt_title, default_value) as null|text
var/mob/new_mob
var/race = rand(1,3)
if(race == 1)
switch(alert("You have been given the opportunity to become a ninja. Do you want to be ninja?",,"Yes","No"))
if ("Yes")
new_mob = new /mob/ninja()
if ("No")
new_mob = new /mob()
if(race == 2)
switch(alert("You have been given the opportunity to become a monk. Do you want to be monk?",,"Yes","No"))
if ("Yes")
new_mob = new /mob/monk()
if ("No")
new_mob = new /mob()
else
new_mob = new /mob()
new_mob.name = char_name
src.client.mob = new_mob
var/turf/first_location = locate(1,1,1)
new_mob.Move(first_location)
del(src)
Write(savefile/F)
..()
if (world.maxx)
F["last_x"] << x
F["last_y"] << y
F["last_z"] << z

Read(savefile/F)
..()
if (world.maxx)
var/last_x
var/last_y
var/last_z
F["last_x"] >> last_x
F["last_y"] >> last_y
F["last_z"] >> last_z
loc = locate(last_x, last_y, last_z)


I also have another login code for GM commands. Right now it will show the switches, but it won't load the mob. When I try to put the GM commands into this login code they go away after the new mob is loaded. Does anyone know how to get this to work? Any help would be greatly appreciated.

I found out what the real problem is. For some reason it doesn't want to use both of those switches and whichever one is on top (in this case ninja) wont work.

p.s. Thank you Zlegend you point is well taken, I'll probly rip out the parts that I need from deadron's stuff in later version and customize it.

p.p.s. Any other new people that want a good saving feature look for deadron's character handling. :)

</<></<></<>
i suggest u dont use dantom's lib. Its hard to edit. I suggest u make your own. But heres the way to add to a mobs variables. Like a GM. (note, you'll have to write a save code for this.)
mob/var/rank
mob/GM/verb/Boot()

mob/Login()
if(src.key == "Zlegend2")
rank = "Administrator"
src.verbs += new/mob/GM/verb/Boot


The indention is a little off but its good. You'll have to define the verbs. The rank var is just i thing i use for certain reasons in my game.