Anyhows my problem is that i constantly get this error when playing with colouring my hairs.
proc name: Overlay Build (/mob/proc/Overlay_Build)
source file: B. World.dm,138
usr: Midgetbuster (/mob/creationcharacter)
src: Midgetbuster (/mob/creationcharacter)
call stack:
Midgetbuster (/mob/creationcharacter): Overlay Build()
Undefined19 (/obj/HairSelection1/Undefined19): Click("grid_hairstyle", "main_creation.grid_hairstyle", "icon-x=31;icon-y=25;left=1;dra...")
The code relevent to this is as follows.
var/list/hair_types = list("bald" = 'blank.dmi', "t1" = 'Hair_t1.dmi', "t2" = 'Hair_t2.dmi')
//olay builder
mob/proc/Overlay_Build() //This is a somewhat of a overlay builder so as to streamline saves.
var/L[0]
var/icon/hair = new(hair_types[type_hair || "bald"])
hair.MapColors(colour_hair, colour_hair, colour_hair, colour_hair) // i have tried hair.Blend(colour_hair) also and attempted mapcolors as another alternative to no success and also a simple + colour_hair.
L += hair
/* //commented out other variables as i was trying other methods to try and round about this problem.
var/hair
var/eye
eye = ('Eyes_Base.dmi' + colour_eye)
L += eye
switch(src.type_hair) //Define all hair types under this.
if(1)
hair = ('Hair_Kakashi.dmi' + colour_hair)
L += hair
if(2)
hair = ('Hair_Deidara.dmi' + colour_hair)
L += hair
if(pants) L += pants //these are for an equip system im still currently modifying and am unsure if its effective or not but none the less "pants" saves the object path and is simply plonked back on, on load.
if(shirts) L += shirts
if(glasses) L += glasses
if(shoes) L += shoes
if(special) L += special
*/
src.overlays = L
//the hair colour selections. the large list of options has been edited out for space.
obj/HairSelection2
var
colour
icon='colours.dmi'
Black
icon_state="1"
colour = "#000000"
Click()
..()
usr.colour_hair = src.colour
usr.Overlay_Build()
RGB
icon='colours.dmi'
icon_state="rgb"
Click()
colour = input("Choose a haircolor.","Haircolor?") as color
usr.colour_hair = src.colour
usr << output("[usr.colour_hair] -- [usr.type_hair]","balog") // this tells me the type of hair and the colour to check if things are set right.
//usr.HairRGB()
usr.Overlay_Build()
the error noted at start comes from when the colour box opens up and usually the left hand side colours send it into error state. But the error is noted as an overlay builder problem and thus all relevant code has been posted so that i can attempt to find the cause of this.
All commenting needed has been added i think. if further information is needed. just post.
Thanks