ID:179720
 
When i use this code form deadrons CH
#include



// How many characters is a player allowed to have?
client/base_num_characters_allowed = 3


world/mob = /mob/creating_character



/***********
Example character creation
--------------------------
The code below gives an example of setting up a character.
This is just to give you ideas for how you can do it yourself.
************/
mob/creating_character
base_save_allowed = 0 // If player quits before choosing, don't want to save this mob.

Login()
// Spawn here to avoid problems with calling prompts during login.
spawn()
src.CreateCharacter()
src.contents = null

proc/CreateCharacter()
// In this case, the code creates a /mob/human or /mob/ogre with the specified attributes.

// Get the character information from them. (You would probably want to do with this a browser page.)
var/prompt_title = "New Character"
var/help_text = "What is the name?"
var/default_value = key
var/char_name = input(src, help_text, prompt_title, default_value) as null|text

if (!char_name)
// Guess they don't want to create a new character after all, so send them to choose a character.
client.base_ChooseCharacter()
return

// Make sure there isn't already a character named that.
// Character names are stored as ckey, so get the ckey version of the name.
var/ckey_name = ckey(char_name)
var/list/characters = client.base_CharacterNames()
if (characters.Find(ckey_name))
alert("You already have a character named that! Please choose another name.")
src.CreateCharacter()
return

var/list/classes = list("Human", "Namek","Majin","Ginyu","Android","Changling","Saiyin")
help_text = "Which class would you like to be?"
var/char_class = input(src, help_text, prompt_title, default_value) in classes

// Okay we have enough information, so it's time to create the character and switch the player to it.
var/mob/new_mob
switch(char_class)
if ("Human")
switch(input("Which human would you like.")in list("Krillen","Tien","Yamtcha"))
if("Krillen")
new_mob=new/mob/Krillen
usr.loc=locate("Start")
if("Tien")
new_mob=new/mob/Tien
usr.loc=locate("Start")
if("Yamtcha")
new_mob=new/mob/Yamtcha
usr.loc=locate("Start")
if("Namek")
switch(input("Which namek would you like to be.")in list("Piccolo","Nail"))
if("Piccolo")
new_mob = new/mob/Piccolo
usr.loc=locate("Start")
if("Nail")
new_mob = new/mob/Nail
usr.loc=locate("Start")
if("Changling")
alert("You are Frieza.That is the only one of the changlings i have.")
new_mob = new/mob/Frieza
usr.loc=locate("Start")
if("Majin")
switch(input("Who would you like to be.")in list("Dabura","Majin Vegeta","Buu"))
if("Dabura")
new_mob = new/mob/Dabura
usr.loc=locate("Start")
if("Majin Vegeta")
new_mob = new/mob/Majinvegeta
usr.loc=locate("Start")
if("Buu")
new_mob = new/mob/Buu
usr.loc=locate("Start")
if("Ginyu")
switch(input("Which ginyu force member would you like to be.")in list("Guldo","Recoom","Burter","Jeice","Ginyu"))
if("Guldo")
new_mob = new/mob/Guldo
usr.loc=locate("Start")
if("Recoom")
new_mob = new/mob/Recoom
usr.loc=locate("Start")
if("Burter")
new_mob = new/mob/Burter
usr.loc=locate("Start")
if("Jeice")
new_mob = new/mob/Jeice
usr.loc=locate("Start")
if("Ginyu")
new_mob = new/mob/Ginyu
usr.loc=locate("Start")
if("Android")
switch(input("Wich android would you like.")in list("Android 16","Android 18"))
if("Android 16")
new_mob = new/mob/Android16
usr.loc=locate("Start")
if("Android 18")
new_mob = new/mob/Andriod18
usr.loc=locate("Start")
if("Saiyan")
switch(input("Which Saiyan would you like.")in list("Goku","Vegeta","Gohan","Trunks"))
if("Goku")
new_mob = new/mob/Goku
usr.loc=locate("Start")
if("Vegeta")
new_mob = new/mob/Vegeta
usr.loc=locate("Start")
if("Gohan")
new_mob = new/mob/Gohan
usr.loc=locate("Start")
if("Trunks")
new_mob = new/mob/Trunks
usr.loc=locate("Start")
// Set the attributes.
new_mob.name = char_name

// Now switch the player client over to the new mob and delete myself since I'm no longer needed.
src.client.mob = new_mob
var/turf/first_location = locate("Start")
new_mob.Move(first_location)
del(src)

mob
Login()
for(var/obj/O in usr.contents)
del(O)
..()

// This is just here for this sample, to make it clear which mob you've logged into.
sample_report()

Write(savefile/F)
// This is sample code that keeps track of the player's last position on the map.
// Their last position is stored when the mob is saved, then reinstated when the mob
// is read in.

// First, call the default Write() behavior for mobs.
..()

// Now, if we have a map, remember their last location.
if (world.maxx)
F["last_x"] << x
F["last_y"] << y
F["last_z"] << z

Read(savefile/F)
// Call the default Read() behavior for mobs.
..()

// Now, if we have a map, put them back on the map in their last location.
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)

/*verb
add_save_verb()
set category = "Save Commands"
// Adds save_me verb to the mob, to show that verb saving works.
src.verbs += /mob/proc/save_me

remove_save_verb()
set category = "Save Commands"
src.verbs -= /mob/proc/save_me*/

proc
sample_report()
//src << "

"
src << "\blue Welcome [name]!."
//src << "\blue Your class is [type]."
//verb
//Save()
// set category = "Save Commands"
// This demonstrates verb saving and how to manually save the mob whenever you want..
// This proc gets added and saved as a verb only if add_verb is called by the player.
// src.client.base_SaveMob()
// src << "\red You saved your game."

mob
Krillen
icon = 'Krillen.dmi'
icon_state="Krillen"
Tien
icon = 'Tien.dmi'
icon_state="Tien"
Yamtcha
icon = 'Yamtcha.dmi'
icon_state="Yamtcha"
Goku
icon = 'Goku.dmi'
icon_state="Goku"
Vegeta
icon = 'Vegeta.dmi'
icon_state="Vegeta"
Trunks
icon = 'Trunks.dmi'
icon_state="Turnks"
Gohan
icon = 'Gohan.dmi'
icon_state="Gohan"
Recoom
icon = 'Recoom.dmi'
icon_state="Recoom"
Guldo
icon = 'Guldo.dmi'
icon_state="Guldo"
Burter
icon = 'Burter.dmi'
icon_state="Burter"
Jeice
icon = 'Jeice.dmi'
icon_state="Jeice"
Ginyu
icon = 'Ginyu.dmi'
icon_state="Ginyu"
Piccolo
icon = 'Piccolo.dmi'
icon_state="Piccolo"
Nail
icon = 'Nail.dmi'
icon_state="Nail"
Frieza
icon = 'Frieza.dmi'
icon_state="Frieza"
Dabura
icon = 'Dabura.dmi'
icon_state="Dabura"
Majinvegeta
icon = 'Majinvegeta.dmi'
icon_state="Majinvegeta"
Buu
icon = 'Buu.dmi'
icon_state="Buu"
Android16
icon = 'Android16.dmi'
icon_state="Android 16"
Andriod18
icon = 'Andriod18.dmi'
icon_state="Android 18"

When i person logs in it goes threw all the loginging stuff but it doesnt put the player on the location start,That i have it setup as. I have a start tag but it doesnt take them there it just puts them in a black screen so they cant do anything. Can some one please help me Thanks
</<></<></<>
that code is so massive, you are byond help

and another thought, how about leaving out code that doesnt matter?

i noticed towards the end it was nothing but

mob
icon
icon_state
mob
icon
icon_state

what does that have to do with anything pretaining to your question?
FIREking
In response to FIREking
So could someone please help me with this code
#include <deadron/characterhandling>



// How many characters is a player allowed to have?
client/base_num_characters_allowed = 3


world/mob = /mob/creating_character



/***********
Example character creation
--------------------------
The code below gives an example of setting up a character.
This is just to give you ideas for how you can do it yourself.
************/
mob/creating_character
base_save_allowed = 0 // If player quits before choosing, don't want to save this mob.

Login()
// Spawn here to avoid problems with calling prompts during login.
spawn()
src.CreateCharacter()
src.contents = null

proc/CreateCharacter()
// In this case, the code creates a /mob/human or /mob/ogre with the specified attributes.

// Get the character information from them. (You would probably want to do with this a browser page.)
var/prompt_title = "New Character"
var/help_text = "What is the name?"
var/default_value = key
var/char_name = input(src, help_text, prompt_title, default_value) as null|text

if (!char_name)
// Guess they don't want to create a new character after all, so send them to choose a character.
client.base_ChooseCharacter()
return

// Make sure there isn't already a character named that.
// Character names are stored as ckey, so get the ckey version of the name.
var/ckey_name = ckey(char_name)
var/list/characters = client.base_CharacterNames()
if (characters.Find(ckey_name))
alert("You already have a character named that! Please choose another name.")
src.CreateCharacter()
return

var/list/classes = list("Human", "Namek","Majin","Ginyu","Android","Changling","Saiyin")
help_text = "Which class would you like to be?"
var/char_class = input(src, help_text, prompt_title, default_value) in classes

// Okay we have enough information, so it's time to create the character and switch the player to it.
var/mob/new_mob
switch(char_class)
if ("Human")
switch(input("Which human would you like.")in list("Krillen","Tien","Yamtcha"))
if("Krillen")
new_mob=new/mob/Krillen
usr.loc=locate("Start")
if("Tien")
new_mob=new/mob/Tien
usr.loc=locate("Start")
if("Yamtcha")
new_mob=new/mob/Yamtcha
usr.loc=locate("Start")
if("Namek")
switch(input("Which namek would you like to be.")in list("Piccolo","Nail"))
if("Piccolo")
new_mob = new/mob/Piccolo
usr.loc=locate("Start")
if("Nail")
new_mob = new/mob/Nail
usr.loc=locate("Start")
if("Changling")
alert("You are Frieza.That is the only one of the changlings i have.")
new_mob = new/mob/Frieza
usr.loc=locate("Start")
if("Majin")
switch(input("Who would you like to be.")in list("Dabura","Majin Vegeta","Buu"))
if("Dabura")
new_mob = new/mob/Dabura
usr.loc=locate("Start")
if("Majin Vegeta")
new_mob = new/mob/Majinvegeta
usr.loc=locate("Start")
if("Buu")
new_mob = new/mob/Buu
usr.loc=locate("Start")
if("Ginyu")
switch(input("Which ginyu force member would you like to be.")in list("Guldo","Recoom","Burter","Jeice","Ginyu"))
if("Guldo")
new_mob = new/mob/Guldo
usr.loc=locate("Start")
if("Recoom")
new_mob = new/mob/Recoom
usr.loc=locate("Start")
if("Burter")
new_mob = new/mob/Burter
usr.loc=locate("Start")
if("Jeice")
new_mob = new/mob/Jeice
usr.loc=locate("Start")
if("Ginyu")
new_mob = new/mob/Ginyu
usr.loc=locate("Start")
if("Android")
switch(input("Wich android would you like.")in list("Android 16","Android 18"))
if("Android 16")
new_mob = new/mob/Android16
usr.loc=locate("Start")
if("Android 18")
new_mob = new/mob/Andriod18
usr.loc=locate("Start")
if("Saiyan")
switch(input("Which Saiyan would you like.")in list("Goku","Vegeta","Gohan","Trunks"))
if("Goku")
new_mob = new/mob/Goku
usr.loc=locate("Start")
if("Vegeta")
new_mob = new/mob/Vegeta
usr.loc=locate("Start")
if("Gohan")
new_mob = new/mob/Gohan
usr.loc=locate("Start")
if("Trunks")
new_mob = new/mob/Trunks
usr.loc=locate("Start")
// Set the attributes.
new_mob.name = char_name

// Now switch the player client over to the new mob and delete myself since I'm no longer needed.
src.client.mob = new_mob
var/turf/first_location = locate("Start")
new_mob.Move(first_location)
del(src)

mob
Login()
for(var/obj/O in usr.contents)
del(O)
..()

// This is just here for this sample, to make it clear which mob you've logged into.
sample_report()

Write(savefile/F)
// This is sample code that keeps track of the player's last position on the map.
// Their last position is stored when the mob is saved, then reinstated when the mob
// is read in.

// First, call the default Write() behavior for mobs.
..()

// Now, if we have a map, remember their last location.
if (world.maxx)
F["last_x"] << x
F["last_y"] << y
F["last_z"] << z

Read(savefile/F)
// Call the default Read() behavior for mobs.
..()

// Now, if we have a map, put them back on the map in their last location.
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 cant seem to make it so when you log in it takes you the the Start location
In response to Gouku
Well to do this you would need to have to do one of the following things.

Option 1) Make a turf and call it "Start"


Option 2) Go to the place on the map where you want the character to start, right click, go to the icon at the bottom of the list, another list will appear, click edit, and where it says:

Tag ""

You will have to do this:

double click in between the "" then make it like this:

Tag "Start"

Hope that helps you out :)

Lee
In response to Mellifluous
Thats the problem i have that done but it puts me in a blacm screen and i cant fix it