ID:142861
 
Code:
overlays+='[hairtype]hair[haircolour].dmi'

Problem description:
Yeah...As you can see, the []s don't work inside the ''. Is there a way to fix this problem?

No. You could try just having the hair types, and then using icon.Blend() or icon arithmetic to add colours to the hair like this:
var/icon/hair_icon = icon('myhairtype.dmi')

hair_icon += rgb(some_red,some_green,some_blue)

overlays += hair_icon
Berlin2222 wrote:
Code:
> overlays+='[hairtype]hair[haircolour].dmi'
>

Problem description:
Yeah...As you can see, the []s don't work inside the ''. Is there a way to fix this problem?


:( i always wanted that capability to, unfortunately byond has this thing where it builds the rsc based on referenced icons, so dynamic icon referencing would really trip it up.
mob
var hairstyle = "x, x"
proc
Hairstyle()
switch(hairstyle)

if("long, black")
src.overlays += 'longhairstyleblack.dmi'
if("long, brown")
src.overlays += 'longhairstylebrown.dmi'
if("short, black")
src.overlays += 'shorthairstyleblack.dmi'
if("short, brown")
src.overlays += 'shorthairstylebrown.dmi'