mob/var/Hair = null
mob/var/HairR = null
mob/var/HairG = null
mob/var/HairB = null
mob/var/whichair
mob/var/Eye = null
mob
var
const/HAIR_LAYER = FLOAT_LAYER-3
haircolor
newHair
loadHair
verb
Hairemo1()
if(gnder==1 || gnder==2)
newHair = 'hair_emo.dmi'
newHair += input("Please select your hair color") as color
Hair = newHair
var/Hairred=4
var/Hairgreen=4
var/Hairblue=5
Hair += rgb(Hairred,Hairgreen,Hairblue)
HairR=Hairred
HairG=Hairgreen
HairB=Hairblue
whichair = 1
overlays += Hair
Hairbald()
if(gnder==1 || gnder==2)
usr.overlays -= Hair
usr.Hair = null
whichair = 0
Eyecolor()
if(gnder==1 || gnder==2)
var/newEyes = 'Eye_Overlay.dmi'
newEyes += input("Please select your eye color") as color
Eye = newEyes
var/Eyered=4
var/Eyegreen=4
var/Eyeblue=5
Eye += rgb(Eyered,Eyegreen,Eyeblue)
overlays += Eye
proc
Hairlogin()
var/savefile/F=new("Save/[src.ckey].sav")
Read(F)
F["Hair2"]>>newHair
if(F["Hair"]==0)
usr.overlays -= Hair
usr.Hair = null
whichair = 0
if(F["Hair"]==1)
loadHair = 'hair_emo.dmi'
Hair = loadHair
var/Hairred=4
var/Hairgreen=4
var/Hairblue=5
Hair += rgb(Hairred,Hairgreen,Hairblue)
HairR=Hairred
HairG=Hairgreen
HairB=Hairblue
overlays += Hair
whichair = 1
mob
var/created = FALSE
var/ingame = FALSE
Login()
world << "[key] has just joined the world~"
Logout()
world << "[key] has logged off!"
if(created == TRUE)
if(ingame == TRUE)
var/savefile/F=new("Save/[ckey].sav")
F["Hair"]<<usr.whichair
F["Hair2"]<<usr.newHair
F["Race"]<<usr.race
F["name"]<<usr.name
F["g"]<<src.icon
F["x"]<<src.x
F["y"]<<src.y
F["z"]<<src.z
F["verbs"]<<src.verbs
sleep(2)
Write(F)
sleep(10)
del src
proc
Load()
if(client)
if(fexists("Save/[src.ckey].sav"))
var/savefile/F=new("Save/[src.ckey].sav")
Read(F)
sleep(2)
usr.name = F["name"]
Hairlogin()
icon=F["g"]
if(F["x"]&&F["y"]&&F["z"]) src.Move(locate(F["x"], F["y"], F["z"]))
else src.loc = locate(1,1,1)
if(!isnull(F["verbs"])) src.verbs.Add(F["verbs"])
usr.verbs+=typesof(/mob/verb/)
world << output("~**[key] has returned!**~","TAZgame.oocoutput")
winshow(src, "TAZgame", 1)
winset(src, "charactercreate.map2", "is-default=false")
winset(src, "TAZgame.map1", "is-default=true")
winset(src, "loginwindow", "is-default=false")
winset(src, "TAZgame", "is-default=true")
winshow(src, "loginwindow", 0)
winshow(src, "OptionsWindow", 0)
ingame = TRUE
else
alert("You do not have any characters on this server.")
return
My latest attempt. It works fine saving the hair TYPE but saving color is a whole other issue. I've tried saving the Hairred, etc variables, saving the Hair variable, even saving the newHair variable at seperate instances and reapplying it through the whole process. No errors but it just won't bring back that color when I load in. The last attempt i tried to reapply a seperate variable of 'loadHair' with newHair's colored properties and tried this...
newHair += loadHair as color
but that gave me errors. Any suggestions on an easy way to save the color value so I can reapply it during the HairLoad() proc?
This will ONLY work if your hairstyles and haircolors are hard-coded. Not sure you would want to do this, but it's an option.