ID:178673
 
when i log on my screen turns all black but this has only happened since i sent my friend the ".dmb" file....
my other friend says its from the login...
please check this and see if it is....

Login()
var/class = input("Who do you want to be?","Welcome to [world.name]!") in list ("Wizard","Hero","Warrior","Quit")
..()
switch(class)
if("Hero")
icon='hero.dmi'
icon_state = "not sleeping"
src.name = input("What is your name?") as text
world<<"[src] enters!"
src.loc=locate(14,2,1)
usr <<"Welcome [name]!"

if("Wizard")
icon = 'wizard.dmi'
icon_state = "not sleeping"
src.name = input("What is your name?","Name") as text
world <<"
[src] enters!"
src.loc=locate(14,2,1)
usr<<"Welcome [name]!"

if("Warrior")
icon = 'warrior.dmi'
icon_state = "not sleeping"
src.name = input("What is your name?","Name") as text
world <<"[src] enters!"
src.loc=locate(14,2,1)
usr<<"Welcome [name]!"

if("Quit")
del(src)
..()
try putting ..() after the usr<<"welcome [usr]"
if("Quit")
del(src)
..()

why would you ..() again?
In response to Winbiko
var/class = input("Who do you want to be?","Welcome to [world.name]!") in list ("Wizard","Hero","Warrior","Quit")
..()
switch(class)

Those lines may have been why. Calling a var then telling it to go through Login then calling something may disrupt login so I would say you place it like this.

..()
then the code
(Thought I'd take a moment to simplify it while I was at it.)

mob/Login()
var/list/LoginChoices = list("Wizard","Hero","Warrior","Quit")
switch(input("Who do you want to be?","Welcome to [world.name]!")) in LoginChoices
if("Hero")
icon = 'hero.dmi'
if("Wizard")
icon = 'wizard.dmi'
if("Warrior")
icon = 'warrior.dmi'
if("Quit")
src << "Come again!"
del(src)
icon_state = "not sleeping"
src.name = input("What is your name?","Name") as text
world << "[src] enters!"
src << "Welcome, [name]!"
src.loc = locate(14,2,1)
You don't need "..()" included in this Login() proc anywhere, since you are manually setting the location of the player when they log in using "src.loc = locate(14,2,1)". Assuming the location 14,2,1 exists, you should be able to log in just fine. The default "..()" prodecure is just to find a place to put the player. If you're moving them on your own, you don't need it.

(As for the smaller code) If you're doing the same thing regardless of the class they choose, such as setting their starting location and prompting for their name, just put those things after the class choice and it will save space. (Unless you're being paid to program by the line, of course.)
In response to Thief Jack
yes, my screen is always black too. it started after i put in my special icons code, i doubt it was that though. ill put the code in here.
mob
Login()
..()//!!!Leave that in!!!
var/usricon = input ("Which game do you want to get icons from?", "Choose.") in list ("Final Fantasy", "Dragon Warrior")
if (usricon == "Final Fantasy")
icon= 'ghost.dmi'
src.loc = locate(155,42,3)//whatever
if (usricon== "Dragon Warrior")
icon= 'goofoff.dmi'
src.loc = locate(155,42,3)//whatever
src.name = input("Choose a name for your character.", "Your Name")