ID:169204
 
mob
Login()
usr.icon_state = input("What gender?") in list ("male","female")
usr.Move(locate(1,1,1)

Im trying ot make it so that i can have six classes to choose from after the male female choice is chosen can someone help me please thanks.
http://byondscape.com/ascape.dmb/LummoxJR.2002-1104/

No put usr in proc.

Additionally, it is always a good thing to put a ..() in in-built procs, so you don't stop them doing things you want them to do.
switch(input("Which class would you like to be in?","Class") in list("Class1","Class2","Class3","Class4","Class5","Class6"))
if("Class1") //if we selected class1 from the options
src << "You chose Class 1"
if("Class2") //if we selected class2 from the options
src << "You chose Class 2"

/*
The way the switch input bit works is:

Message, Title, Options(as a list)

In our case:

Message = "Which class would you like to be in?"
Title = "Class"
Option(as a list) = in list("Class1"...)
*/
In response to DeathAwaitsU
mob
Login()
src.icon_state = input("What gender?") in list ("male","female")
switch(input("Which class would you like to be in?,"Class") in list("Class1","Class2","Class3","Class4","Class5","Class6"))
if("Class1") //if we selected class1 from the options
src << "You chose Class 1"
if("Class2") //if we selected class2 from the options
src << "You chose Class 2"

I have this but i get 2 errors
In response to Thedmof2000
Possibly because you copied and pasted what I showed you.

Firstly, put code in DM tags like so:

<DM>

*Code*

</DM>

Secondly, go back to my post and look at how my indentation is done.
In response to Thedmof2000
Thedmof2000 wrote:
mob
Login()
src.icon_state = input("What gender?") in list ("male","female")
switch(input("Which class would you like to be in?,"Class") in list("Class1","Class2","Class3","Class4","Class5","Class6"))
if("Class1") //if we selected class1 from the options
src << "You chose Class 1"
if("Class2") //if we selected class2 from the options
src << "You chose Class 2"

I have this but i get 2 errors

You spaced it wrong. class one and two should be indented twice or so. so that they're tabsed one more time than the switch() proc.
In response to Reinhartstar
The errors i get are

Class: missing comma ',' or right paren ')'
In response to Thedmof2000
You need another right bracket on the line with the switch statement.

EDIT: Actually, scratch that. The way it isn't in DM tags screws up reading it. DeathAwaitsU is right, you need to close up the quotation marks.

Also, input defaults to usr. The first argument should be src, otherwise you have usr abuse. Change the input to

input(src,"What class?","Some Game","Forum Lurker") in list("Forum Lurker","DBZer","Idiot","Republican")


(note that those classes are entirely for demonstartion purposes. And republicans can be happy that the "Republican" class is seperate from the "Idiot" class. :P)
In response to Thedmof2000
You need a " at the end of the message part of the input.
In response to Jp
allright, here is a login code example like the one you are looking for:
mob/Login()
src.icon_state=input("What is your gender?","Gender") in list("male","female","neuter")//I added neuter
switch(input("What is your class?") in list("Rein","Hart","Start"))
if("Rein")
src << "You chose rein!"
if("Hart")
src << "Yo chose hart!"
if("Star")
src << "You chose star!"
src.loc=locate(1,1,1)
<\DM>
Also, I may as well bring up now that there is another way to use switch, like so:
mob/Login()
src.icon_state=input("What is your gender?","Gender")in list("male","female")
var/class = input("What class?") in list("Rein","Hart","Star")
switch(class)
if("Rein")
src << "You chose rein!"
//etc etc.
<\DM>
It might be more usefull to do it the way on top., but i prefer the way on the bottom. Also no put usr in proc, as jp has said. notice i used "src". usr is usually safe in a login proc, but not when using savefiles. your not using savefiles, but its better to be safe than crack your head on your keyboard in frustration.

--The Reinhart.

<dm>
In response to Reinhartstar
Ok i got that now how to i make it so there is an icon for each class?
In response to Reinhartstar
Ummm... You have usr abuse in that login() proc. Look up input in the reference.
In response to Reinhartstar
you still didn't use the dm tags right.
// this opens the dm tags; everything below it will be shown just like Dream maker.

so the code should be in here.
 // closes the dm tag; everything below will turn out normal.


O-matic
In response to O-matic
For the code, I would set [iconname].dmi to the gender, and the class to icon_state=[class]. Though this beginner could be wrong!