ID:139906
 
EDITED: I did not feel the direct need to make an entirely new topic at this time and felt i could just re use this topic but if there is no responses due to the amount of responses already currently listed (cause i know most of you click ones without responses) i will make a new topic. Anyway my original topic was about a library named Crashed Colour loading slow when hosting with daemon and as per the posts below i reverted back to using (x as color). Anyways ive come across a number of things in which have made me wondering what is going on and thus have led me to make this edited post and trying to nullify current responses.

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
Just a suggestion, you may want to paste your modified code. Oh and also, it takes longer to do anything over a connection, I don't know the exact post link but Falacy showed that even sending a simple message takes more time.
In response to Darkjohn66
Well the only real modification after i actually looked at it was i removed the part where it sent the colours before altering i just removed that part (since there was no need since they dont have access to an output box until there actually in)

So no real modifications for the most case just one simple output line removed and change "text colour" var to "hair colour" var.
In response to Midgetbuster
you said as color wasn't working out...just wondering but why is that? because the way i see it its easier to use than crashcolour
In response to Masschaos100
Well. for me anyway.

Im using interface so i was trying to launch the (as color) using a click proc which did not allow it to open properly. and when i used a verb to make it open. the left hand side colours of the hexagon would not input the colour correctly. it would take the colour place it on my hair and then immediately wipe the entire hair. (works fine for the right hand side colours)

Furthermore (as color) does not allow you to actually input your own RGB options inside the menu aswell. so crashedcolour has more features IMO but ill have to go into alternatives since this isn't working.
In response to Midgetbuster
Sounds like you weren't doing things properly.

And the color input does let you input by number.
In response to Garthor
Well i got the click to work for as color.

But for some reason the left hand side colours (and possibly other stuff) is causing things to malfunction.

//this is launched per click of the colour to map out overlays and what not and is also called at start of load to rebuild everything.
mob/proc/Overlay_Build() //This is a somewhat of a overlay builder so as to streamline saves.
var/L[0]
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

src.overlays = L

//Heres the objects in which handle the selection of hair colours.

obj/HairSelection2
var
colour
icon='colours.dmi'
Black
icon_state="1"
colour = "#000000"
Yellow
icon_state="2"
colour = "#D2D600"
Brown
icon_state="3"
colour = "#3F2900"
Blue
icon_state="4"
colour = "#0012E0"
Purple
icon_state="5"
colour = "#8E00B2"
Pink
icon_state="6"
colour = "#E500E1"
Green
icon_state="7"
colour = "#00D100"
Red
icon_state="8"
colour = "#E81300"
Cyan
icon_state="9"
colour = "#00D2DD"
Orange
icon_state="10"
colour = "#DB7F00"
Gray
icon_state="11"
colour = "#8F9498"
Watermelon
icon_state="12"
colour = "#E665A6"
Crystal_Blue
icon_state="13"
colour = "#84BCD5"
Smokey_Plum
icon_state="14"
colour = "#866A7D"
Buttercup
icon_state="15"
colour = "#F2E1A9"
Twilight
icon_state="16"
colour = "#177B9F"
Sweet_Leaf
icon_state="17"
colour = "#C2CB93"
Thistle
icon_state="18"
colour = "#D8BFD8"
Autumn_Terracotta
icon_state="19"
colour = "#C77140"
Garnet
icon_state="20"
colour = "#8B6158"
Vanilla
icon_state="21"
colour = "#F7E1CB"
Click()
..()
usr.colour_hair = src.colour
usr.Overlay_Build()

RGB
icon='colours.dmi'
icon_state="rgb"
Click()
colour = input("Choose a hair colour.","Hair colour") as color
usr.colour_hair = src.colour
usr << output("[usr.colour_hair] -- [usr.type_hair]","balog")
usr.Overlay_Build()


Any tips/pointers welcomed on that

and on the note of the malfunction occuring the left side colours seem to be changing my hair style into unknown numbers such as 8,9,18,19,20 etc (values all what arnt what is selected.)
In response to Midgetbuster
Could you actually give a sample of the output for of these "unknown numbers"?
In response to Garthor
Sure although it wont really show much.

using the output code noted above when clicking RGB it outputs to the user the variable that is set for the colour of the hair which is denoted as the first value you see the next value outputted is the hair type that is /meant/ to be selected. the value for all of these SHOULD remain 2 at all times as noted below but instead when clicking on the left hand side colours of (as color) it fiddles with the code and somehow manages to change the type of hair.

Hair type is set to "2"

#339966 -- hair type is 8
#00cc99 -- hair type is 8
#339933 -- hair type is 8
#00cc00 -- hair type is 8
#66ff99 -- hair type is 8
#336600 -- hair type is 9
#66ff66 -- hair type is 19
#669900 -- hair type is 20
#99cc00 -- hair type is 19
#663300 -- hair type is 19

When the colour is selected though you can click the hair type its meant to be (which in this case is 2) and it does retain the colour selected but still it should not be modifying the hair type =\

So any tips and pointers on my overlay rebuilder (is it effective? is there better ways of doing it.. etc etc.) also note i have another proc that builds the bases also and i guess in a sense they could be merged together but no real need.
Semi-Bump.

Changed front post to different problem all together.

Due to (as per my suspicions nobody clicking on it due to list of responses already)