ID:266735
 
Could some one give me a little snippit of code that has a Save() and Load() proc, for Deadrons Charhandeling Lib.






Shun Di, Thx
Shun Di wrote:
Could some one give me a little snippit of code that has a Save() and Load() proc, for Deadrons Charhandeling Lib.






Shun Di, Thx

Make your own, it's rather easy, if you messed Deadron's character handling up, then your fried (in the meaning you cant do anything now) :P

Saving / Loading system --

client/proc/Save()
var/savefile/F=new("Save Files/[src.key].sav")
src.mob.log=1
F<<src.mob
F<<src.mob.x
F<<src.mob.y
F<<src.mob.z
client/proc/Load()
var/savefile/F=new("Save Files/[src.key].sav")
F>>src.mob
F>>src.mob.x
F>>src.mob.y
F>>src.mob.z


Now, simply call the proc in this.

client
Del()
src.Save()
..()


The rest is rather easy to setup, to have your own saving system, that is if you know how to code it


RaeKwon
In response to RaeKwon
I suppose this is good timing to bring up this scenario since we're talking about Deadron's library.

Thanks to Mrhat99au, I have a title screen with a create character proc (Yay! Yay! Yay!). I'm having a tough time figuring out how to make it so whether the player has a save file or not, they have to go through the title screen and click the "Enter" turf. Deadron's lib likes to load the player's file at login, so I turn basecamp autoload off methinks.

What code would I need to throw into my turf/Enter/Click() that would tell the library "If he's got a key, load 'em up. If not, start the CreateCharacter()?" Currently, it starts the proc regardless. And that's just dumm.
In response to RaeKwon
RaeKwon wrote:

Make your own, it's rather easy, if you messed Deadron's character handling up, then your fried (in the meaning you cant do anything now) :P

Except uninstall the lib and redownload it.

Alathon\\
In response to RaeKwon
YAY! YAY! YAY! Thanks Rae, I Got It To Work.







Shun Di, Thx
In response to Shun Di
Why thank Raekwon that was from my library :-P
In response to Super16
LoL, HeH :)
In response to Shun Di
No seriously it is
In response to Super16
I enjoyed your item storage demo.
In response to Matic293
Matic293 wrote:
I suppose this is good timing to bring up this scenario since we're talking about Deadron's library.

Thanks to Mrhat99au, I have a title screen with a create character proc (Yay! Yay! Yay!). I'm having a tough time figuring out how to make it so whether the player has a save file or not, they have to go through the title screen and click the "Enter" turf. Deadron's lib likes to load the player's file at login, so I turn basecamp autoload off methinks.

What code would I need to throw into my turf/Enter/Click() that would tell the library "If he's got a key, load 'em up. If not, start the CreateCharacter()?" Currently, it starts the proc regardless. And that's just dumm.

To check if its a real person, look up client in the helpfile.
In response to Super16
Super16 wrote:
Why thank Raekwon that was from my library :-P

actually i dont know where is was from i pulled it out of a game i had.. i dont believe it was from your Library, for the fact it was from a recent game, and i got it from Blue Book.
Shun Di wrote:
Could some one give me a little snippit of code that has a Save() and Load() proc, for Deadrons Charhandeling Lib.






Shun Di, Thx


Here is afew more saving ways

mob
var
save_x
save_y
save_z
Write(savedfile/F)
save_x = x
save_y = y
save_z = z
..()
Read(savefile/F)
..()
Move(locate(save_x,save_y,save_z))


mob
Login()
var/savefile/F = new(ckey)
Read(F)
del(src)
return..()
Logout()
var/savefile/F = new(ckey)
Write(F)
del(src)



another way


mob
Write(savefile/F)
F["name"] << name
F["icon"] << icon
Read(savefile/F)
F["name"] >> name
F["icon"] >> icon


that was a basic way


another way -

mob
Write(savefile/F)
F << x
F << y
F << z
..()
Read(savefile/F)
var{save_x;save_y;save_z}
F >> save_x
F >> save_y
F >> save_z
..()
Move(locate(save_x,save_y,save_z))


another way
client/proc/SaveMob()
var/savefile/F = new("players.sav")
var/char_ckey = cKey(src.mob.name)
F["/[ckey]/[char_ckey]"] << src.mob

client/proc/LoadMob(char_ckey)
var/mob/new_mob
var/savefile/F = new("players.sav")
F["/[ckey]/[char_ckey]"] >> new_mob
if (!new_mob)
return 0
else
src.mob = new_mob
return 1



those are afew saving ways.

RaeKwon