ID:1373234
 
(See the best response by Flick.)
So I've been having a hell of a time trying to cache modified icons at round start. Here's what's going on at master controller at boot.


for(var/obj/item/clothing/under/U)
var/icon/o_lying = icon("icon"='icons/mob/uniform.dmi', "icon_state"="[U.color]_l")
var/icon/f_lying = icon("icon"='icons/mob/uniform.dmi', "icon_state"="female_l")
o_lying.Blend(f_lying, ICON_MULTIPLY)
var/icon/o_standing = icon("icon"='icons/mob/uniform.dmi', "icon_state"="[U.color]_s")
var/icon/f_standing = icon("icon"='icons/mob/uniform.dmi', "icon_state"="female_s")
o_standing.Blend(f_standing, ICON_MULTIPLY)
female_uniform_icons["1"] = o_lying
female_uniform_icons["2"] = o_standing


"female_uniform_icons" is defined as a global list at the start of file. What this is supposed to do is take a uniform (o) and apply a filter (f) then cache it to female_uniform_icons. "1" and "2" are just placeholders for testing, and aren't the problem. It then gets used here:

            var/icon/lying_holder = female_uniform_icons["1"]
var/icon/standing_holder = female_uniform_icons["2"]
lying = image(lying_holder, "layer"=-UNIFORM_LAYER)
standing = image(standing_holder, "layer"=-UNIFORM_LAYER)
overlays_lying[UNIFORM_LAYER] = lying
overlays_standing[UNIFORM_LAYER] = standing


lying/standing are defined as images earlier in the file.

lying_holder and standing_holder are NOT icons according to isicon, even though they should be reading the modified icons from the global list. Anyone have any ideas why this might be? It's driving me nuts
Try not using text in those brackets and just the numbers. Also, that "layer" ("icon","icon_state") should just be layer (etc).
I have previously attempted every permutation of what you're suggesting and it hasn't worked.
Best response
Are there actually any of /obj/item/clothing/Under in existence at round start? If you haven't actually created any yet, your for loop doesn't run. Put a simple world << "got here" in your for loop to see if it is running.