ID:147266
 
I decided to make my game use client-side saving to store rank and experience, allowing it to go between servers. I have encryption ready, and understand how to use it, though I haven't added it yet (want to first get the saving and then secure it.)

The problem is that, when I use the example in the Blue Book (I bought it when they were still being sold,) it doesn't save your statistics. Of course, I could have used a procedure that only saves when you modify a variable, but I don't think so.

Here is all the code in my game that handles saving:

mob
Login()
alert("You enter!")
alert("Infantry Online is © 1996-2002 Sony Online Entertainment. All icons are not To be used for any game other than Infantry Wars, except the player icons. © Drafonis")
alert("To select a class, click 'Race' in the Commands tab and select a race! Then use 'Team' to select a team. Please team first.")
world << "[usr] logs in!"
src.Ammunition = 300
src.HP = 100
src.Grenades = 3
src.ShotgunShells = 50
src.LAWs = 3
src.icon = ""
src.Class = ""
src.Team = ""
src.overlays = 0
src.x = rand(1,50)
src.y = rand(1,50)
src.z = rand(1,50)
src.loc = locate(usr.x,usr.y,usr.z)
src << browse('index.htm')
var/savefile/F = client.Import()
if(F) Read(F)
..()


The saving/loading procedures:

mob
proc/SavePlayer()
var/savefile/F=new()
Write(F)
client.Export(F)

Write(savefile/F)
F["Experience"] << Experience
F["Rank"] << Rank
F["Squad"] << Squad

Read(savefile/F)
F["Experience"] >> Experience
F["Rank"] >> Rank
F["Squad"] >> Squad


The error that I get:

runtime error: Cannot execute null.Export().
proc name: SavePlayer (/mob/proc/SavePlayer)
source file: save.dm,5
usr: Primary AdministratorDrafonisM... (/mob)
src: Primary AdministratorDrafonisM... (/mob)
call stack:
Primary AdministratorDrafonisM... (/mob): SavePlayer()
Primary AdministratorDrafonisM... (/mob): Logout()
Primary AdministratorDrafonisM... (/mob): Logout()


Any help would be appreciated.