Code: For Reference Sake
//The olay builder. launched on new char, load etc.
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'
if(eye)
eye+=rgb(src.eye_red,src.eye_green,src.eye_blue)
L+= eye
switch(src.hair_type) //Define all hair types under this.
if(1)
hair='Hair_Kakashi.dmi'
if(2)
hair='Hair_Deidara.dmi'
if(hair)
hair+=rgb(src.hair_red,src.hair_green,src.hair_blue)
L+= hair
src.overlays=L
Code: Attempt #1
mob/verb/Zet(B as color)
var/list/Colours = ReadRGB(B) //From lummox iconproc lib + his guide
src.hair_red = "[Colours[1]]"
src.hair_green = "[Colours[2]]"
src.hair_blue = "[Colours[3]]"
src.Overlay_Build()
Results: The RGB values i have set (hair_red,green,blue) etc get set properly to the values i chose but the hair remains black (tried saving and loading where the colours are rewritten again remains a black hairstyle when the codes clearly denote a colour such as purple for example)
Code: Attempt #2
mob/verb/Fail()
var/list/color = ReadRGB(name_colour)
usr.hair_red = "[color[1]]"
usr.hair_green = "[color[2]]"
usr.hair_blue = "[color[3]]"
usr.Overlay_Build()
Results: For this test i pulled up "Crashed's" library for name/text colour changing and tried RGBing that value. same results as Attempt 1 where it outputs a hairdo thats meant to be purple but gives me a black hairdo when values denote the purple variables.
Code: Attempt #3
haircolour_rgb
icon='colours.dmi'
icon_state="rgb"
Click(Hairgb as color)
var/list/Colours = ReadHSV(Hairgb)
usr.hair_red = "[Colours[1]]"
usr.hair_green = "[Colours[2]]"
usr.hair_blue = "[Colours[3]]"
usr.Overlay_Build()
Results: was actually my first attempt but doesnt matter, quite simply doesn't launch that windows palette lookalike thing
Code: Attempt #4
//Error received
runtime error: cannot read from list
verb name: Zet (/mob/verb/Zet)
source file: B. Creation.dm,482
usr: Midgetbuster (/mob/human/player)
src: Midgetbuster (/mob/human/player)
call stack:
Midgetbuster (/mob/human/player): Zet(null)
the haircolour rgb (/obj/HairSelection2/haircolour_rgb): Click("22", "main_creation.grid_haircolour", "icon-x=24;icon-y=18;left=1;dra...")
Results: Simply the above attempt put into a proc/verb and trying to launch on click. gives me an error (noted above in the DM tags)
Problem description: So as far as i can tell the code is stuffing up somewhere along the line or i just totally suck and am skipping something (id go with the sucking part) but as you can see by those im trying to make an option that will open up a RGB kind of selector so that a player can choose any kind of hair they want with a graphical interface (alongside an array of predefined choices)
Just having some real headscratchers on why the RGB values are to a purple colour but im getting a black colour.
Thanks in advance to all the experienced personnel who tolerate my noobyness i appreciate it greatly.
Of course, you don't need to do this at all, as simply taking the result from "X as color" and adding it to overlays is enough. So, for example: