ID:142108
 
Code:
mob
Login()
if(usr.key=="Monti")
usr.Owner_Commands()
switch(input("Welcome to Pokemon: The New Generation. What would you like to do?") in list("New", "Load", "Quit"))
if("New")
src.ChooseCharacter2()
if("Load")
src.Load()
if("Quit")
src.Logout()



proc/ChooseCharacter2()//This is the ChooseCharacter proc when it is called it will all the coding up below so a mob can create his/her character.
src.name = input("What would you like your name to be?","Name input")//Asks a mob what they want their name to be.
src.lastname = input("What would you like your last name to be?","Last Name Input")
src.age = input("How old are you?","Age Input")
src.nationality = input("What nation are you from?","Nationality input")
switch(input("What Gender are you?") in list("Male", "Female"))
if("Male")
src.gender1 = "Male"
icon = 'NPC.dmi'
icon_state = "trainer7"
usr.loc=locate(/turf/Area/Start)
world << "Welcome our newest player [src]/[key]to the game!"
if("Female")
src.gender1 = "Female"
icon = 'NPC.dmi'
icon_state = "trainer6"
usr.loc=locate(/turf/Area/Start)
world << "Welcome our newest player [src]/[src.key] to the game!"
proc/Load()
var/savefile/F = new("saves/[src.ckey].sav")//Overwrites their last save file to show they logged in again.
cansave = 1//This a var show that the mob can save their game.
Read(F)//Read the mobs save file.
var/lx,ly,lz//vars to that we dont have to put last_x and so on making it much easier
F["last_x"] >> lx//This is a desplay of what i have done above. These means your last locations.
F["last_y"] >> ly
F["last_z"] >> lz
loc = locate(lx,ly,lz)//Puts the mob in their last location,
world << "<small><font color = red><b>Login info: <font color = white>[src]/[key] has logged in."//Show the world a mob has logged in with an old save file.
Save()//Calls the save proc so the mob can save.
proc/Save()//The Save proc is inuse when called.
var/savefile/F = new("saves/[src.ckey].sav")//Overwrites their file with another location now
Write(F)//Write over their save file
F["last_x"] << x//Writes over their last with their new one.
F["last_y"] << y
F["last_z"] << z
// src << "<small><font color = red><b>Save info: <font color = white>Your game has been saved. "//says to the mob their game has been save
sleep(900)//sleep for 1 minute and a half.
Save()//Calls the proc again so that it will save the mobs x,y,z.
..()//Calls the history.
Logout()//The logout proc which is inbuilt in dream maker but is always save to have
if(cansave)//if the mob can save save them also if you put !cansave it means the mob cant save so bare this in mind.
Save()//Call the save proc.
world << "<small><font color = red><b>[src] has logged out."//Tell the world a mob has logged out of the world
..()//Call all the histy before logging out
del(src)//Delete the mob from the world note their save file will not go lol.


Problem description:
The game wont load. All the screen says when you click load is login info: and nothing else happens
Perhaps there isnt anything to load? You should include this statement in the load proc:
if(fexists("saves/[src.ckey].sav"))
else
src<<"You do not have a saved character!"

And I dont really like the way its coded, you should be using src.[var] it causes less problems and you wont get confused from global vars.
And it looks like you used this from a demo from all the commenting, so I hope you give them some sort of credit for using it.
Question, why do you save once loaded? thats pretty silly.
mob
Login()
if(usr.key=="Monti")
usr.Owner_Commands()
switch(input("Welcome to Pokemon: The New Generation. What would you like to do?") in list("New", "Load", "Quit"))
if("New")
src.ChooseCharacter2()
if("Load")
src.Load()
if("Quit")
src.Logout()



proc/ChooseCharacter2()//This is the ChooseCharacter proc when it is called it will all the coding up below so a mob can create his/her character.
src.name = input("What would you like your name to be?","Name input")//Asks a mob what they want their name to be.
src.lastname = input("What would you like your last name to be?","Last Name Input")
src.age = input("How old are you?","Age Input")
src.nationality = input("What nation are you from?","Nationality input")
switch(input("What Gender are you?") in list("Male", "Female"))
if("Male")
src.gender1 = "Male"
icon = 'NPC.dmi'
icon_state = "trainer7"
usr.loc=locate(/turf/Area/Start)
world << "Welcome our newest player [src]/[key]to the game!"
if("Female")
src.gender1 = "Female"
icon = 'NPC.dmi'
icon_state = "trainer6"
usr.loc=locate(/turf/Area/Start)
world << "Welcome our newest player [src]/[src.key] to the game!"
/*---------->*/usr.Save()// <------------------ you needed this here ^^ try it 20$ says it works.


Keep all your coding the same just add usr.Save() to the creat char thingy and it will save the char upon login and every minute after that. so you will be able to load.

Very simple ^^
In response to A.T.H.K
A.T.H.K wrote:
Question, why do you save once loaded? thats pretty silly.

oh and the save after loading is so it starts the auto save after you are loaded (and logged) into the game. so its not silly... it works =.= learn to help people rather than put them down for something even you dont understand.
In response to Bushuda94
it never had anything to load because it never saved lol, but i fixed it for him.
In response to Tijinn
No usr in procs. Replace usr with src.
In response to Andre-g1
funny thing is thats what i meant to put there. my mistake. it would be src.Save()