mob
Login()
usr.AL() // Admin Load
dir/Char.New()
text2file("[usr.key] from [usr.client.address] logged into NSD at [ReportDate()]<BR>", "Hosting/NSDSF/[usr.key]/Logging.html")
..()
Logout()
text2file("[usr.key] logged out of NSD at [ReportDate()]<BR>", "Hosting/NSDSavedfiles/[usr.key]/Logging.html")
..()
turf/
Finish
Click()
dir/Char.Tutorial1()
Char/
parent_type = /mob
New()
Start()
..()
Del()
Save()
..()
var/
SName
SName1
SName2
Slot1
Slot2
OnS
list/HP = list()
Tutorial
proc/Tutorial1()
if(Tutorial)
alert(src,"Since this is your first time playing, you have to do the tutorial.")
usr.Move(locate(75,75,2))
alert(src,"Follow the path to your first instructor")
else
switch(input("Would you like to do the tutorial?","Tutorial", "Yes","No"))
if("Yes")
usr.Move(locate(75,75,2))
alert(src,"Please follow the path to your first instructor")
proc/Customize(type)
src.Move(locate(125,125,1))
if(type == "New")
alert(src, "Now, let's get started by custmizing your character, click Finish when your done.")
Tutorial=1
else
alert(src, "Now, it's time to customize your character, click Finish when your done.")
proc/Create(type)
if(type == "New")
src.name = input("Since this is your first time playing on this server, what would you like the community to call you?","Name",src.name)
switch(input("Which character slot would you like to save on","Char. Slot", "Slot 1", "Slot 2"))
if("Slot 1")
HP += src.key
Slot1=1
Save()
Customize("New")
if("Slot 2")
HP += src.key
Slot2=1
Save()
Customize("New")
else
src.name = input("What would you like to call your character?","Name",src.name)
switch(input(src, "Since this is your first time playing, would you like to take the tutorial?","Tutorial", "Yes", "No"))
if("Yes")
Customize()
if("No")
Customize()
proc/Save()
var/savefile/Z = new ("Hosting/NSDSavedfiles/[src.key]/[OnS]/[SName].savv")
Z["x"] << src.x
Z["y"] << src.y
Z["z"] << src.z
alert("[SName] has been saved on [OnS]!")
proc/Start()
var/options = list()
options += "Quit"
if(!src in HP)
Create()
else
if(src.Slot1&&src.Slot2)
options += "Load Slot 1"
options += "Load Slot 2"
options += "Delete"
goto A
if(src.Slot1&&src.Slot2 == null)
options += "Load Slot 1"
options += "Create"
options += "Delete"
goto A
if(src.Slot2&&src.Slot1 == null)
options += "Load Slot 2"
options += "Create"
options += "Delete"
goto A
A
var/Choice = src.ListSplitter("What would you like to do?",options) as null
if(Choice == "Quit")
del(src)
if(Choice == "Create")
Create()
if(Choice == "Load Slot 1")
src.OnS="Slot1"
Read("Hosting/NSDSF/[src.key]/[SName1].savv")
if(Choice == "Load Slot 2")
src.OnS="Slot2"
Read("Hosting/NSDSF/[src.key]/[SName2].savv")
if(Choice == "Delete")
var/list/options2 = list()
if(Slot1)
options2+= "Delete Slot 1"
if(Slot2)
options2+= "Delete Slot 2"
if(Slot1 == null&&Slot2 == null)
alert("You have nothing to delete!")
Start()
var/Choice2 = src.ListSplitter("What would you like to do?",options2) as null
if(Choice2 == "Delete Slot 1")
fdel("Hosting/NSDSF/[src.key]/[SName1].savv")
if(Choice2 == "Delete Slot 2")
fdel("Hosting/NSDSF/[src.key]/[SName2].savv")
if(Choice2 == null)
Start()
Problem description:
I can't get it to work properly, is there a better way to do this or am I doing this incorrectly?
Note:
It wont load properly, my first attempt I used dir/Char.Start()
Also, when you are checking one and the same variable for more than two values, use the switch() proc. Look it up by clicking on Help in Dream Maker and then selecting "Help on".
Also, don't use usr in procs, use src in stead. Usr is only for verbs.
Try using mob/Char in stead of Char/parent_type = /mob, and get rid of the dir/Char accordingly.
And "if(!src in HP)" will never work, it should be
if(!(src in HP))
or even
if(!HP.Find(src))