ID:140164
 

Code:mob/create_character
var/mob/character
Login()
var/charactername = input("What is your name?","Character Name?")
switch(input("Pick what race you wish to start out as.","Character Background?") in list("Human","Demon"))
if ("Human")
character = new /mob/You/Human()
if ("Demon")
switch(alert("What type of demon do you want to be?","Character Creation","Bat","Dog","Spider", ))
if("Bat")
character = new /mob/You/Demon()
if("Dog")
character = new /mob/You/Demon()
if("Spider")
character = new /mob/You/Demon()</b>


Problem description:

Ignore the repeated demon entries below, i'll change them later, for now I want them all to be the same icon.

Well, the problem is that when I try to compile the code I get these errors-
loading TheDemo.dme
TheDemo.dm:16:error: =: expected "if" or "else"
TheDemo.dm:17:error: if: expected code block
TheDemo.dm:18:error: : expected "if" or "else"
TheDemo.dm:18:error: =: expected code block
TheDemo.dm:20:error: =: expected "if" or "else"
TheDemo.dm:17:warning: "Dog": statement has no effect
TheDemo.dm:18:warning: character: statement has no effect
TheDemo.dm:18:warning: : operation has no effect here
you forgot to indent after the demons are chosen

this
                    if("Bat")
character = new /mob/You/Demon()


should be
                    if("Bat")
character = new /mob/You/Demon()


do that for all the demons
and this should all probably be in a proc...
Aside from indentation, you also have an extra comma in your second switch().
Thanks for the answers, really helped! (and that code is from zeta, i'm trying to learn how to code from it)
I'd like to know how the new created mob is connected to the players Client, I don't fully understand the concept behind this code you posted.
when you login you make the mob to /mob/create_character

add this into your code file:

world
mob = /mob/create_character

if somebody said this already my bad xD(didnt read replies)