ID:142174
 
Code:
mob
Write(savefile/F)
F["loc"] << loc
F["expv"] << expvalue
F["HU"] << HengeUsed
F["BU"] << BunshinUsed
F["KU"] << KawarimiUsed
F["BMD"] << BaseMove_Delay
F["MD"] << Move_Delay
F["Oicon"] << Oicon
F["hairover"] << hairover
F["Level"] << Level
F["Village"] << Village
F["mstam"] << MaxStam
F["stam"] << Stam
F["Chakra"] << Chakra
F["MaxChakra"] << MaxChakra
F["maxexp"] << maxexp
F["exp"] << exp
F["ooc"] << ooc
F["maxhp"] << maxhp
F["hp"] << hp
F["End"] << End
F["Int"] << Int
F["Nin"] << Nin
F["Str"] << Str
F["DRanksDone"] << DRanksDone
F["Mission1Done"] << Mission1Done
F["contents"] << contents
F["name"] << name
F["hud"] << src.client.screen
Read(savefile/F)
F["expv"] >> expvalue
F["HU"] >> HengeUsed
F["BU"] >> BunshinUsed
F["KU"] >> KawarimiUsed
F["BMD"] >> BaseMove_Delay
F["MD"] >> Move_Delay
F["Oicon"] >> Oicon
F["hairover"] >> hairover
F["Level"] >> Level
F["Village"] >> Village
F["mstam"] >> MaxStam
F["stam"] >> Stam
F["Chakra"] >> Chakra
F["MaxChakra"] >> MaxChakra
F["maxexp"] >> maxexp
F["exp"] >> exp
F["ooc"] >> ooc
F["maxhp"] >> maxhp
F["hp"] >> hp
F["End"] >> End
F["Int"] >> Int
F["Nin"] >> Nin
F["Str"] >> Str
F["DRanksDone"] >> DRanksDone
F["Mission1Done"] >> Mission1Done
F["contents"] >> contents
F["name"] >> name
F["hud"] >> src.client.screen
loc = F["loc"]
world << "[src]([src.key]) <B>loaded</B> their character."


Problem description:

As you can see of the last lines of Read() and Write() There's the hud saving, our client screen.

We got it working, but... we get runtime errors, and I've no idea how else I can save the whole client.screen.

Could someone please help?
Thanks in advance,

Rick
Ugh, what are you doing? >_> Don't save/load every variable individually, the default Write() and Read() already do that, what you're doing is pointlessly long (if you don't want some vars to be saved, just flag them as 'tmp'). Also, save coordinates instead of the whole turf itself that the player is on.

As for your issue, it makes some sense that screen wouldn't be saved that easily. You could try looping through it, but that's all pointless anyway, because what you should really do is rebuild it on logon. Every player should reuse the same screen objects, you shouldn't create a new object for every player, as well as store it in their savefiles.
I wonder for what purpose you need to save the screen list anyway, since it's normally populated on Login() etc?
In response to Kaioken
Those are not al variables. I didn't make the variables itself, so I thought that'd do it.
Why'd it be wrong to save the loc instead of x,y,z?
My purpose to save the objects are the objects that had been dragged from the inventory to the hud.

Thanks for your quick answer.

~ Rick
In response to Sokkiejjj
Sokkiejjj wrote:
Those are not al variables.

Yeah, I figured, and I know it works. But you should still use the default object saving system:
mob/player
var
myvar
myvar2
tmp //don't save these vars
dontsaveme1
dontsaveme2
Write(savefile/F)
..() //--do the default action--
F << x //save coordinates
F << y
F << z
Read(savefile/F)
..()
//load coordinates (find turf at their position)
var/X,Y,Z
F >> X
F >> Y
F >> Z
var/turf/T = locate(X,Y,Z)
if(T) loc = T //(some proc to call Entered() etc would be generally more robust)
else loc = locate(1,1,1)


My purpose to save the objects are the objects that had been dragged from the inventory to the hud.

Well, yeah, that fits in with rebuilding it, since you're going to use the object from inventory directly. You're not even creating 1 object primarily for screen usage for players. =) You've probably already figured this out, but if I'm already replying I'll follow it up with a bit of code:
obj/item
stuff/screen_loc = "1,1"
mob/Login()
..()
for(var/obj/item/O in src)
if(O in src.selected) //if... it should be on-screen
src.client.screen += O
In response to Kaioken
Well, those hud objects aren't hard to place on.
But the hard part for me is, you drag an object from the inventory to the hud on the map, the hud contains objects you drag it into.

How'd I make it work with no runtime errors?
Again, thanks for the quick reply and the information. =)

~ Rick
In response to Sokkiejjj
I thought you've already done that? You'd use the MouseDrag() proc (look it up), overridden on the items.
In response to Kaioken
Oh yeah, my bad. I looked wrong. I'll try again.
In response to Kaioken
Aloooot of thanks Kaioken.
Thanks to you it completely works fine.
I replaced the client screen objects back at Login, and let the dragged objects go back at their right position with a list.
Really, alot of thanks.

Regards Rick