ID:170571
 
I have the following code:

mob/var/list/races = list("Man","Dwarf","Elf","Halfling")
mob/var/race
mob
Login()
Move(locate("Temple of Calandrial"))



usr.name = input("Choose a name for your character.","Your Name",usr.name)
usr.gender = input("Select a gender for your character.","Your Gender",usr.gender) in list("male","female","neuter")
usr.race = input("Choose a race for your character.","Your Race",usr.race) in list("Man","Dwarf","Elf","Halfling")


I want to know how I would make classes for each different race. I tried:

if(usr.race == "Race of Men")
usr.class = input(...blah)


But when I run it, nothing comes up... help
First, don't use usr. Use src.

A better way to accomplish what you want would be to add to the list that they select from.
mob/Login()
var/list/classes=list("Generic Class1","Generic Class2")
switch(race)
if("Man")classes.Add("Specific Class1")
if("Elf")classes.Add("Specific Class1","Specific Class2")
//and so on
class=input("Select a class")in classes
In response to Loduwijk
Loduwijk wrote:
First, don't use usr. Use src.


If you're going to tell him not to use usr in a proc, then don't turn around and do it yourself =P. The default argument for input() is usr, not src, which is why your example should instead have been:

mob/Login()
var/list/classes=list("Generic Class1","Generic Class2")
switch(race)
if("Man")classes.Add("Specific Class1")
if("Elf")classes.Add("Specific Class1","Specific Class2")
//and so on
class=input(src,"Select a class") in classes
In response to Wizkidd0123
I didn't use it, just had my null get defaulted to it in the function. It's a result of all the time I didn't understand the stuff in the past creating habits that pop up whenever I don't have them in mind. The tutorials really should make use of that first, optional argument instead of letting people think for the longest time that the input goes to src.

Either way, I'm on an anti-roll today. =/