ID:261288
 
I know that i have been on the forum alot but this will be the last time for a while. i keep getting a inconsistant indentation error for this, can anyone give me an example of how to indent it?

Thanks



mob/create_character
var/mob/character
Login()
var/charactername = input("What is your name?","Name",src.key)
switch(input("What do you want?") in list("Communist","Nazi",) if("Nazi")
input("Which Nazi")in list("Hitler","Goebbels","Goering")
if ("Hitler")
icon='Hitler.dmi'
if("Goebbels")
icon='G.dmi'
Super saiyan3 wrote:
I know that i have been on the forum alot but this will be the last time for a while. i keep getting a inconsistant indentation error for this, can anyone give me an example of how to indent it?

Thanks



mob/create_character
var/mob/character
Login()
var/charactername = input("What is your name?","Name",src.key)
switch(input("What do you want?") in list("Communist","Nazi",) if("Nazi")
input("Which Nazi")in list("Hitler","Goebbels","Goering")
if ("Hitler")
icon='Hitler.dmi'
if("Goebbels")
icon='G.dmi'

Each "if" clause of a "switch" statement requires a full indent relative to that switch statement, and the statements for the "if" clause require yet another full indent relative to the "if" clause itself. It also appears that you wanted to use the result of your third input as the expression for another switch statement. The following code should do what you want:

mob/create_character
var/mob/character
Login()
var/charactername = input("What is your name?","Name",src.key)
switch(input("What do you want?") in list("Communist","Nazi"))
if ("Nazi")
switch (input("Which Nazi")in list("Hitler","Goebbels","Goering"))
if ("Hitler")
icon='Hitler.dmi'
if ("Goebbels")
icon='G.dmi'

In response to Pmikell
Thank you very much, for your help.
In response to Pmikell
Yay! Pmikell is back! We've missed you around here. :)
In response to Shadowdarke
One last thing i still have the inconsistant indentation, but only for the communsit icon(Stalin and the solider) and line below it. Can some again please reply with an example of how it should be set.
Thank you.

mob/create_character
var/mob/character
Login()
var/charactername = input("What is your name?","Name",src.key)
switch(input("What do you want?") in list("Nazi","Communist"))
if ("Nazi")
switch (input("Which Nazi")in list("Hitler","Goerring","Goebbels","Reichsman",))
if ("Hitler")
icon='Hitler.dmi'
if ("Goerring")
icon='G.dmi'
if("Goebbels")
icon='Nail.dmi'
if("Reichsman")
icon='R.dmi'
if("Communist")
switch (input("Which One")in list("Stalin","Soldier"))
if("Stalin")
icon='Stalin.dmi'
if("Soldier")
icon='Soldier.dmi'