ID:169083
 
I am wondering how to make it so you can delete an older character in the savefiles they have. Here is my saving code.....

mob
proc
ChooseCharacter()
var/list/characters = src.CharacterList()

var/newCharacterChoice = "New Character"
var/list/menu = new()
menu += characters
menu += newCharacterChoice

var/result = input("Character Creation", "Dark Era") in menu

if (result == newCharacterChoice)
src.CreateNewCharacter()

else
var/success = src.client.LoadMob(result)

if (success)
del(src)
else
src.ChooseCharacter()

CharacterList()
var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("players/[firstletter]/[src.ckey].sav")
F.cd = "/[ckey]"
var/list/characters = F.dir
return characters




mob
Write(savefile/F)
..()

F["last_x"] << x
F["last_y"] << y
F["last_z"] << z

Read(savefile/F)
..()

var/last_x
var/last_y
var/last_z
F["last_x"] >> last_x
F["last_y"] >> last_y
F["last_z"] >> last_z
loc = locate(last_x, last_y, last_z)


client
verb
Save()
set category = "Communication"
SaveMob()
usr << "Saving Character..."
sleep(10)
usr << "Save Complete"


client/proc/SaveMob()
var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("players/[firstletter]/[src.ckey].sav")
var/char_ckey = cKey(src.mob.name)
F["/[ckey]/[char_ckey]"]<<src.mob

client/proc/LoadMob(char_ckey)
var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("players/[firstletter]/[src.ckey].sav")
F["/[ckey]/[char_ckey]"]>>src.mob

client/Del()
src.SaveMob()
return ..()


Does anybody know how to make a Delete Character procedure. If so, please help..

-Killerdragon
that entire code is Zeta, so why not just use the Zeta Delete character code >.>?
In response to Xeronage
Cause it just goes back to the original choose character procedure in the zeta version. And note that this is not a DBZ game, I REPEAT, THIS IS NOT A DBZ GAME. Anybody know how to do this??

-Killerdragon
In response to Xeronage
Lmao you must have seen alot of Zeta to know this code bit was from it.
In response to Killerdragon
You should study DM yourself instead of using zeta. Try looking at demos and tutorials.
In response to Dession
Dession wrote:
Lmao you must have seen alot of Zeta to know this code bit was from it.

No, I just figured since it was a source code it probably had a saving system that was decent, so I decided to use it.
I had a custom saving system set up, but the problem with it was that I couldn't delete other characters, and also I you would load the most recent locations from the most recent player.
In response to Killerdragon
I tried looking through tutorials and demos and I read through the DM Guide, but I mainly have troubles with savefile coding and random combat. Most other stuff I can do....
In response to Killerdragon
Obviously that message wasnt directed to you, since I replied to HIS message not yours.
In response to Dession
? Who were you talking to then, Xenosage or me????
In response to Killerdragon
I guess after a lot of modifying and risks I could make a title screen using Deadron's saving, but this just seemed so much simpler, except for the fact that it doesn't provide a delete character function. Anybody know how??? I am not a newb coder, but I am not an expert either, so I would just like to know how to make a procedure that will delete the savefile that is chosen.
In response to Killerdragon
Well, since obviously nobody is willing to help me on the count that I have trouble with save files, I might as well just work through it alone and try to figure out how to make a title screen and buttons while still using Deadron's saving. I figure it must not be too hard, considering that it is just a lot of procedures.
In response to Killerdragon
It's only been like 20 minutes. Wait a day or so before giving up =p
In response to DarkCampainger
O.k., its just dession makes it sound like I'm retarded or don't understand what I'm doing and stuff for not knowing how to code a savefile, even though I explained my major weakness in coding DM is coding savefiles...
In response to Xeronage
That code was also used in most of the Icon Chatterz rips, thats how I knew who ripped and who semi-ripped, and who didnt rip at all.
In response to Strawgate
Would people stop talking about the ripped stuff. I would just like to know how to make a delete procedure and get on with my game and life. It will be modified into a title screen, so why does it matter....
In response to Killerdragon
Wait, nevermind, I think. My friend is going to help me with one, so you guys don't need to complain anymore, it won't be ZETA OK. HAPPY NOW. Dang, its not like I was ripping the whole game....