ID:1309728
 
Code: This is the Save proc and verb then I get this when I click the save verb: runtime error: bad savefile or list
proc name: SaveChar (/mob/proc/SaveChar)
usr: the gr3 (/mob)
src: the gr3 (/mob)
call stack:
the gr3 (/mob): SaveChar()
the gr3 (/mob): Save()
the gr3 (/mob): SaveChar()
the gr3 (/mob): Save()

mob/proc/SaveChar()
var/savefile/F = new("players/[src.ckey].sav")
F["name"] << name
F["X"] << usr.x
F["Y"] << usr.y
F["Z"] << usr.z
F["Mob"] << .client.mob
F["Rank"]<< usr.rank
F["Level"]<< usr.level
F["RP Points"]<< usr.rp
F["Shunpo"]<< usr.shunpo
F["Agility"]<< usr.agility
F["Reaction Speed"]<< usr.reaction
F["Sword Spirit Power"]<< usr.swpower
F["Sword Speed"]<< usr.swspeed
F["Hand-to-Hand Combat"]<< usr.handtohand
F["Spirit Power"]<< usr.sppower
F["Swordsmanship"]<< usr.swordsmanship
F["Experience"]<< usr.exp
F["Max Experience"]<< usr.mexp
mob/verb/Save()
usr.SaveChar()
usr << "Your character has been saved."


Code:This is the load file and this is what comes up when I click load on my login screen: runtime error: bad savefile or list
proc name: Click (/turf/Login/LoadChar/Click)
usr: Ersdfghj (/mob)
src: LoadChar (1,7,4) (/turf/Login/LoadChar)
call stack:
LoadChar (1,7,4) (/turf/Login/LoadChar): Click(LoadChar (1,7,4) (/turf/Login/LoadChar), "default.map1", "icon-x=24;icon-y=12;left=1;scr...")
LoadChar (1,7,4) (/turf/Login/LoadChar): Click(LoadChar (1,7,4) (/turf/Login/LoadChar), "default.map1", "icon-x=24;icon-y=12;left=1;scr...")
runtime error: bad savefile or list
proc name: Click (/turf/Login/LoadChar/Click)
usr: Ersdfghj (/mob)
src: LoadChar (1,7,4) (/turf/Login/LoadChar)
call stack:
LoadChar (1,7,4) (/turf/Login/LoadChar): Click(LoadChar (1,7,4) (/turf/Login/LoadChar), "default.map1", "icon-x=24;icon-y=12;left=1;scr...")
turf
Login
login1
icon='13722.jpg'
layer = 4
LoadChar
layer = 6
mouse_opacity = 2
density = 1
Click()
var/savefile/F = new("players/[usr.ckey].sav")
var/X
var/Y
var/Z
var/mob/newmob = new()
F["name"] >> usr.name
F["X"] >> usr.x
F["Y"] >> usr.y
F["Z"] >> usr.z
F["Mob"] >> newmob
F["Rank"] >> usr.rank
F["Level"] >> usr.level
F["RP Points"] >> usr.rp
F["Shunpo"] >> usr.shunpo
F["Agility"] >> usr.agility
F["Reaction Speed"] >> usr.reaction
F["Sword Spirit Power"] >> usr.swpower
F["Sword Speed"] >> usr.swspeed
F["Hand-to-Hand Combat"] >> usr.handtohand
F["Spirit Power"] >> usr.sppower
F["Swordsmanship"] >> usr.swordsmanship
F["Experience"] >> usr.exp
F["Max Experience"] >> usr.mexp
newmob.loc = locate(X,Y,Z)
newmob.client = usr.client usr.client


Problem description:Also when I try to load and then get that runtime error I will randomly push the arrow keys and the screen will be moving around like it would if you have a icon moving around in a game, while this is happening the log in screen is still up. When I compile it has no issues so it isn't that.

Pretty sure src.mob saves all those variables you're trying to save. I'm only a newbie myself though so someone else will need to clarify that.

client
proc
Save()
var/savefile/F = new("players/[src.ckey].sav")
F["x"] << src.mob.x
F["y"] << src.mob.y
F["z"] << src.mob.z
F["mob"] << src.mob

Load()
var/savefile/F = new("players/[src.ckey].sav")
if(!fexists("players/[src.ckey].sav"))
src.mob<<"No Savefile"
//proc for creating character
return
F["x"] >> src.mob.x
F["y"] >> src.mob.y
F["z"] >> src.mob.z
F["mob"] >> src.mob

mob
verb
savemob()
src.client.Save()
src<<"Your character has been saved."
ever heard of
F.Read()
//or
F.Write()
where would I put those??

In response to Zohan98
You're not advised to call those manually. Look here or here for some guidance on saving and loading. Search for forums, it'll help.
when I put Write(F) in the Save code is said this runtime error: bad file
proc name: SaveChar (/mob/proc/SaveChar)
usr: the f (/mob)
src: the f (/mob)
call stack:
the f (/mob): SaveChar()
the f (/mob): Save()
the f (/mob): SaveChar()
the f (/mob): Save()
when I tried to save

In response to Ersdfghj
Read my post.
so for my login screen I have this code: LoadChar
layer = 6
mouse_opacity = 2
density = 1
Click()
What do I put under "Click()" say that when I click on LoadChar it will use this: load()
if(fexists("[src.key].sav"))
var/savefile/f = new("[src.key].sav")
f["mob"] >> src.mob

and also does f["mob"] >> src.mob save everything the player had??
In response to Ersdfghj
No. In any case, src would be referring to the atom you're clicking, which is the turf. Read through the posts I've provided and you'll learn something.
ok I will do that and in one of your posts you put: world << "[src] has logged back in."
active = 1 // now you will be able to activate auto-saving
icon = 'player icon.dmi' // change the icon once they log in (reloading it)
verbs += typesof(/mob/somepath/verb) // re-add your "special-path" verbs

How do I put if a icon is a female or male and how do I make it where there if a player is a GM they get certain verbs and if a player is just a normal player they get the normal verbs
In response to Ersdfghj
You should really read the DM guide. Using the if() statement you check whether their key is a certain list (if you're listing administrators that way) and reward them with whatever verbs. If they're male or female, and if you're checking by their sign-up gender, the built in client.gender will work as you wish in an if() statement or with a combination of the ? and : operators.
I know about about the if() statement I just dont know where to put it
In response to Ersdfghj
In your new character system (so they're given verbs on a new character) and whenever they load their character.
and I have looked at the DM I just want to know what that particular code where would I put it
On this line: icon = 'player icon.dmi' // change the icon once they log in

I cant just put a male icon if they are a female
In response to Ersdfghj
Then do exactly as I said with the ? and : operators.

src.icon = src.client.gender == "male" ? 'male.dmi' : 'female.dmi'
thanks
src.icon = src.client.gender == "Male" ? 'male.dmi' : "Female" ? 'female.dmi' :


loading Bleach RP.dme
Bleach RP.dm:913:error: unterminated text (expecting ")
Bleach RP.dm:914:error: src: missing comma ',' or right-paren ')'
Bleach RP.dmb - 8 errors, 0 warnings
Ironically you didn't just copy his post and dump- but you did copy with out knowing what its doing or how it works.

src.icon = src.client.gender == "male" ? 'male.dmi' : 'female.dmi'


Is gender "male"? if so return 'male.dmi', if not then return 'female.dmi'.

Yours: Is gender "male"? If so than return 'male.dmi', if not return "Female" If so 'female.dmi', If not

Your iteration is not even finished, which is what the error is telling you, but you're also tacking on something that isn't needed.

Page: 1 2 3