ID:2093301
 
Code:
                    usr.hairr = input("How Much Red for your Eyes?", "Red") as num
usr.hairg = input("How Much Green for your Eyes?", "Green") as num
usr.hairb = input("How Much Blue for your Eyes?", "Blue") as num
H.color = list(1,0,0, 0,1,0, 0,0,1, usr.hairr/255,usr.hairg/255,usr.hairb/255)
usr.overlays+=H


Problem description: Oh I don't even know, the code was working just fine a day or two ago, and this morning, without any further editing to it being done, it stopped working.

First off, I think you should nix the num,num,num input scheme; BYOND has an "as color" input type now, so you should just use that instead. You can easily switch old saves over to use that system by using rgb(hairr,hairg,hairb).

It's not clear offhand why your verb (I hope it's a verb anyway, because you're using usr) isn't working. I would recommend showing the whole thing.

Also, I'm not sure why it's asking about eye color but setting hair color.
the hair/eye thing is just me forgetting to edit that.

and about the amount of code, besides an object that is set up by choice. and actually, this is in a proc during character creation.

If it's in a proc, then you should not be using usr. That alone could be your entire problem.
ok, well, I replaced every proc instance of usr with src, and im still ending up having issues,I even ended up stripping most of the code so I could just see what was happening, the code generates the color, and applies the overlays, but doesn't apply the color to the overlays.
mob
New()
sleep(5)
src.icon='White.dmi'
var/obj/E=new/obj/Overlays/Eyes
src.EyeR=rand(0,255)
src.EyeG=rand(0,255)
src.EyeB=rand(0,255)
E.layer=4
E.color = list(1,0,0, 0,1,0, 0,0,1, src.EyeR/255,src.EyeG/255,src.EyeB/255)
src.overlays+=E
var/obj/H=new/obj/Overlays/Hair/Short
src.HairR=rand(0,200)
src.HairG=rand(0,200)
src.HairB=rand(0,200)
H.color = list(1,0,0, 0,1,0, 0,0,1, src.HairR/255,src.HairG/255,src.HairB/255)
src.overlays+=H
What happens if you use a long-form list?

list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1, EyeR/255,EyeG/255,EyeB/255,0)

I would expect the same result if the list is being handled correctly.
same thing, still applies the overlays but not the colors.
Then the problem is elsewhere. I suggest posting the entire proc.
actually, because the color was what was messing up, I broke apart the code, and only have a little bit active, including the various object overlays, the games turfs, mob and world variables, and this proc (along with a short statpanel so I could make sure there were numbers in the colors).

updating the post with whats left of the proc now though.
mob
var
EyeR=0
EyeG=0
EyeB=0
HairR=0
HairG=0
HairB=0
New()
sleep(5)
src.icon='White.dmi'
var/obj/E=new/obj/Overlays/Eyes
src.EyeR=rand(0,255)
src.EyeG=rand(0,255)
src.EyeB=rand(0,255)
E.layer=4
E.color = list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1, EyeR/255,EyeG/255,EyeB/255,0)
src.overlays+=E
var/obj/H=new/obj/Overlays/Hair/Short
src.HairR=rand(0,200)
src.HairG=rand(0,200)
src.HairB=rand(0,200)
H.color = list(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1, HairR/255,HairG/255,HairB/255,0)
src.overlays+=H
Stat()
statpanel("Stats")
stat("----------Eye Color----------")
stat("Red","[src.EyeR]")
stat("Green","[src.EyeG]")
stat("Blue","[src.EyeB]")
stat("----------Hair Color----------")
stat("Red","[src.HairR]")
stat("Green","[src.HairG]")
stat("Blue","[src.HairB]")
turf
icon='world.dmi'
Grass
icon_state="grass"
obj
Overlays
icon='overlays.dmi'
layer=4
Eyes
icon_state="Eyes"
Hair
layer=6
Short
icon_state="short"

whole code that's even active right now.
Try changing your
var/obj/E=new/obj/Overlays/Eyes
var/obj/H=new/obj/Overlays/Hair/Short
to
var/obj/Overlays/Eyes/E=new()
var/obj/Overlays/Hair/Short/H=new()
Is saving and loading in play?
changed it, didn't change anything that happened.

no saving or loading atm, just the code I posted above with these issues.
Maybe you can zip up the source and send it to me. I can always take a look and see if there's something not showing up in this thread that's relevant.
all my code is in that post up there, the only other relevant things are a small map with one turf, several mobs, and what icons I have.
What I'm saying is the problem is not apparent from your code. There's no particular reason that shouldn't work as-is, so something else is in play that's causing it. It should be apparent in the debugger, or the full source may shed some light on it.
I found the problem in the source you sent me: The overlays.dmi file has no state called "Eyes". It does however have "eyes". Therefore your eye overlay was not shown, but the hair overlay was. You saw black eyes because your regular icon already has them, and the overlay wasn't being applied.

Nothing was wrong with the color matrix.
I fixed the overlay so its icon state is the same as the image, but it still isn't putting any color to the hair or eyes.
I saw hair color in your demo, and the eyes too once I fixed the icon_state problem. The only thing not working in your code was the eye overlay.

Is there any chance you're in software rendering mode? That shouldn't cause this kind of matrix not to work right, but it's worth checking regardless.
i don't think so, I cant really tell, I cant seem to find that, and all the links I find are for windows 7 on it.
Page: 1 2