ID:263116
 
Code:
turf/New
Click()
alert("Are you sure you want to make a new character?","?","Yes","No")
if("Yes")
alert("Which SaveSlot do you wish to Make this new character in?","?","SaveSlot 1","SaveSlot 2","SaveSlot 3")
if("SaveSlot 1")
usr.SaveSlot=1
usr.Create()
if("SaveSlot 2")
usr.SaveSlot=2
usr.Create()
if("SaveSlot 3")
usr.SaveSlot=3
usr.Create()


mob/var/char_name
mob/proc/Create()
char_name=input(src,"What do you want your to be?","Name?") as text
if(!char_name)
alert("You most enter a name!","ERROR")
return
else src.loc=locate(20,7,2)

turf
riku
icon='players.dmi'
icon_state="Riku"
Click()
var/mob/new_mob = new()
new_mob.name=usr.char_name
new_mob.icon='players.dmi'
new_mob.icon_state="Riku"
usr.loc=locate(15,1,1)
usr.client.mob = new_mob
del(src)


sora
icon='players.dmi'
icon_state="sora"

kairi
icon='players.dmi'
icon_state="kairi"


Problem description:Ok for some reason no matter what i do the name input will never close even when i click ok how can i fix this?

1) Eww, change those alerts into switch(input( ...or atleast switch(alert(

2) I THINK the problem is that because of the lack of switches, it goes into the next coding blocks so input MAY BE happening 3 times (too tired to confirm this hypothesis)

- GhostAnime
mob/proc/Create()
char_name=input(src,"What do you want your to be?","Name?") as text
while(!char_name)
char_name=input(src,"please choose a name")
src.loc=locate(20,7,2)


-.-
Well, one major problem is that you've chosen turf/New as a type path. Problem is, turf/New() is already a proc, so this is just going to confuse the living crap out of DM. Choose something different for a name like NewCharacter or something.

Lummox JR
In response to DivineO'peanut
that still didnt fix this problem it keeps poping up no matter what i do.
In response to National Guardsmen
You need to turn alert() into switch(alert()), and indent everything in the switch() statement.

The way you have it that DM thinks that you're checking if the if() statements aren't 0, null, or "", which in this case, aren't either of those, so the statement passes.