ID:149344
 
I'm having a HUGE problem w/ my character handling.

Ok, when i use Character Handling now when i log in it doesn't ask for what character u want to play as. it just loads the save i have. I didn't edit the code at all and this is a BIG problem can someone please help me.

Alienman

=Edit= i know its the char handleing because i opened a different game that it works over i have and it did the same thing.
Code your own charcater handling, once you mess that one up, your shot, here is a demo

Basic Saving

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

Call the save proc.
client
Del()
src.Save()

call chooseing charcater on logging in.
mob
Login()
..()
if (!istype(src, /mob/other/choosing_character))
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)



code chooseing character ect in "Some from character handling"

mob/other/choosing_character
Login()
spawn()
src.ChooseCharacter()

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

var/newCharacterChoice = "New Warrior"
var/DeleteCharacterChoice = "Delete Warrior"
var/list/menu = new()
menu += characters
menu += newCharacterChoice
menu += DeleteCharacterChoice

var/result = input("What do you want to do? Delete a Warrior? Create a new one? or play an existing one?", "Warning: Applet Window") in menu

if (result == newCharacterChoice)
src.CreateNewCharacter()
if (result == DeleteCharacterChoice)
src.DeleteCharacter()
src.ChooseCharacter()
else
var/success = src.client.LoadMob(result)

if (success)
del(src)
else
alert("Sorry, unable to load that character!")
src.ChooseCharacter()

CharacterList()
var/savefile/F = new("players.sav")
F.cd = "/[ckey]"
var/list/characters = F.dir
return characters

DeleteCharacter()
var/savefile/F = new("players.sav")

F.cd = "/[ckey]"
var/list/characters = F.dir

var/CancelCharacterDeletion = "Cancel"
var/list/menu = new()
menu += characters
menu += CancelCharacterDeletion

var/result = input("deleting a character", null, "Which character do you want to delete?") in menu

if (result)
F.cd = "/[ckey]"
F.dir.Remove(result)
if (result == CancelCharacterDeletion)
src.ChooseCharacter()
else
src.ChooseCharacter()

mob/other/choosing_character/proc/CreateNewCharacter()
here put your creation of charcater stuff in.






Enjoy,
- RaeKwon
In response to RaeKwon
got 3 errors

charcreating.dm:3:error:src.mob.log:undefined var
charcreating.dm:25:error::invalid expression
charcreating.dm:68:error:src.client.LoadMob:undefined proc


If you are using the Deadron Char Handeling library then check to see if the max number of saves is one. If so then change it to a higher number to allow more saves.

(Example:client/base_num_characters_allowed = 1(Change To 2 or Higher))

Thats Right On The First Line Of Deadron's Chracter Handeling.






Shun Di, Out
In response to Shun Di
i am useing Deadrons but that wasn't it i changed it and it still autoloaded my char.


=Edit= Never Mind. i got it. i was looking in the wrong DM i was looking in implation not CharacterHandleing.

Thanks
In response to Alienman22774
Alienman22774 wrote:
got 3 errors

charcreating.dm:3:error:src.mob.log:undefined var
charcreating.dm:25:error::invalid expression
charcreating.dm:68:error:src.client.LoadMob:undefined proc



Lol, set the vars, change LoadMob to Load, and set vars, easy.
- RaeKwon
In response to RaeKwon
i already got it Shun Di told me i might need to change the amount of saves and that was it.

Thanks anyway i'll use that as a backup

Alienman
In response to Alienman22774
Hah So I Was Right!





Shun Di, Out