ID:263269
 
Code:
var/mob/character
mob
Login()
src.loc = locate(47,47,2)
..()
obj/Start//makes the name
icon = 'archangel.bmp'//the pic file
density = 1
Click()//you click it it'll do the following below
usr.loc=locate(9,9,1)
switch(input("Continue Or Begin?","New or Load?") in list ("New","Load","Quit"))
if("New")
usr.ChooseCharacter()
if("Load")
usr.LoadCharacter()
if("Quit")
usr.Exit()
mob
proc/ChooseCharacter()
usr << "<font size = 3><b><font color=blue>Welcome to Elemental Warfare.(or i think it is the name is still out there). If you find any bugs or have any ideas contact me. Thanks"
world << "<font size = 2><b><font color=blue><b>[usr] has logged in!"
char_name
var/user_name = input("What would you like your name to be? Please choose a Role Playing name. That means no numbers and also no HTML in your name.","Character Creation",usr.key)as text
if(!user_name)
goto char_name
if(lentext(user_name) > 20)
usr <<"Name too long."
goto char_name
if(lentext(user_name) < 2)
usr <<"Name too short."
goto char_name
for(var/N in un_wanted_names && html)
if(findtext(user_name,N))
alert("That name is not allowed.","Name")
goto char_name
else
usr.name = html_encode(user_name)
world<<"<font size = 2><b><font color=blue>[name] has join the world!"
switch(input("Please choose a Gender.","Gender") in list("Male","Female"))
if("Male")
switch(input("What Class would you like to be?","Class")as null|anything in list("Fire","Water","Wind"))
if("Fire")character=new/mob/characters/Male/Fire()
if("Water")character=new/mob/characters/Male/Water()
if("Wind")character=new/mob/characters/Male/Wind()
else
del(usr.client.mob)
if("Female")
switch(input("What Class would you like to be?","Class")in list("Fire","Water"))
if("Fire")character=new/mob/characters/Female/Fire()
if("Water")character=new/mob/characters/Female/Water()
else
del(src)
character.name = usr.name
src.client.mob = character


usr.loc=locate(9,9,1)

mob/characters
Male
Fire
icon='Fire.dmi'
Element = "Fire"
Gender = "Male"
Water
icon='Water.dmi'
Element = "Water"
Gender = "Male"
Wind
icon='Wind.dmi'
Element = "Wind"
Gender = "Male"

Female
Fire
icon='Fire.dmi'
Element = "Fire"
Gender = "Female"
Water
icon='Water.dmi'
Element = "Water"
Gender = "Female"

var/list/html = list("<",">","font","size")

var
list
un_wanted_names = list("")

name_length
maximum_name_length_amount = 20


Problem description:
After you make your guy you go back to the login page. And it keeps happening over on over again.

It keeps looping because you're using the same mob type for your login mob as your playing mob. To fix this, create a new path type for the mob who is going to be loging in (ie. mob/choosing_character). You will also have to set world/mob to /mob/choosing_character so players will login to that mob by default.

On the other hand, you have a lot of usr abuse in procs (such as ChoosingCharacter() usr is not always the player who will be choosing the character. Also, input() and alert() by default send the boxes to "usr" so you will have to specify who to send the box to. (look them up for information about that)

You also have unneeded goto statements when you can easily use a while statement to catch unwanted inputs.

~~> Unknown Person
In response to Unknown Person
i don't know if i'm doing it wrong but when i do that it puts me right into the game. And it gives me nothing. but thanks anyways.
Perhaps I can shed a little light on this.

Take this code:

world
mob
newbie


And modify your current code to:

mob/newbie
Login()
src.loc = locate(47,47,2)
..()


And voila! It SHOULD work. What it's doing here, it setting a default mob, which people become when they log in. When you choose a character, however, it will log you on as s different mob and won't restart at the title screen.

Oh and you're gonna have problems with your code here:
switch(input("Please choose a Gender.","Gender") in list("Male","Female"))
if("Male")
switch(input("What Class would you like to be?","Class")as null|anything in list("Fire","Water","Wind"))
if("Fire")character=new/mob/characters/Male/Fire()
if("Water")character=new/mob/characters/Male/Water()
if("Wind")character=new/mob/characters/Male/Wind()
else
del(usr.client.mob)
if("Female")
switch(input("What Class would you like to be?","Class")in list("Fire","Water"))
if("Fire")character=new/mob/characters/Female/Fire()
if("Water")character=new/mob/characters/Female/Water()
else
del(src)


Your if-else conditions are put wrong. When your program runs it is going to check Fire, then Water, and if the previous two were correct it's going to delete your mob anyway because that else will only apply to the last if statement (Wind).

If you want to avoid that error, then do this:
switch(input("Please choose a Gender.","Gender") in list("Male","Female"))
if("Male")
switch(input("What Class would you like to be?","Class")as null|anything in list("Fire","Water","Wind"))
if("Fire")character=new/mob/characters/Male/Fire()
else
if("Water")character=new/mob/characters/Male/Water()
else
if("Wind")character=new/mob/characters/Male/Wind()
else
del(usr.client.mob)

And repeat for female!
Like, no. D:

gender = lowertext(input(src,"What would you like to be?") in list("Male", "Female"))
var/race = input(src,"Race?") in list("Elf", "Gnome", "TheOtherElf+lol")
var/final_result = "/mob/[gender]/[race]" //the mob
client.mob = new final_result //client.mob is now a new final_result


There we go!
In response to DivineO'peanut
Peanut, that way is good, it's excellent even, but you screwed it up. You're making the mob a new .. eurr... text-string.

text2path(), anyone?
In response to Mysame
0.o... But it works perfectly well, test it for yourself!

mob/toby
verb/am_i_toby_questionmark() world << "you an a toby!"

mob/Stat()
statpanel("mysame is wrong and peanut is right! nananananana")
stat(client.mob)

mob/verb/change()
var/pancakes = "/mob/toby"
client.mob = new pancakes


Although text2path() is a perfectly vaild option for this kind of case, my peanutish senses tell me not to use it, and show everyone how special I am not using there... pfft... 'text2path()'
In response to Mysame
Mysame wrote:
Peanut, that way is good, it's excellent even, but you screwed it up. You're making the mob a new .. eurr... text-string.

text2path(), anyone?

Actually, DM allows you to create objects like that. You can supply in a text string, and it will automatically "text2path" it for you. It's been here before text2path.

~~> Unknown Person