turf
titlescreen
density = 1
mainscreen
icon = 'titlescreen.png'
newchar
Click()
if(fexists("Playersavefiles/[usr.key].sav"))
if(alert("Character is found.\n Would you like to start a new character and overwrite previous savefile?","","Yes","No") != "Yes")
return
NEW
var/N = input("What is your character's name?","Character Name") as text
if(length(N) < 4 || length(N) > 16)
usr << "Character's name has to be between 4 to 16 characters in length..."
goto NEW
var/C = input("What is your character's class?","Class Selection") in list("Fighter","Defender","Black Mage","White Mage","Spellblade","Gunner")
switch(alert("Name: [N]\nClass: [C]\n","Confirmation","Yes","No"))
if("Yes")
if("No")
goto NEW
usr.name = "N"
usr.CLASS = "C"
usr = /mob/player/fighter()
usr.loc=locate(1,1,1)
usr.Save()
mob/player
CLASS = ""
ID = "hero"
icon = 'hero.dmi'
world
mob = /mob/player
Problem description:
I have several questions about this code. First of all, how do I make it so that even when I accidentally click on newchar like 3 or 4 times, the alert will just pop up once and finish the whole way through. Like I don't want to have go through "What is your character's name" 3 times before actually going to "What is your character's class?" Second question is concerning on the way I create new characters. As you see, you pick the class. I have it in my code in where it's like mob/player/fighter and mob/player/whitemage, etc, so how would I make it so the default mob/player will be mob/fighter, etc. when they create their character. Third question, if I have Stat() under mob/player, mob/player/fighter,etc. should be able to have that as well right?
Code:
okay for your third question I'm guessing you are asking if you could have different starting stats for each class, the answer to that is yes you can