Does anyone know if there's a way to do correct layered creature graphics with babies and children having different sprites?
From what I'm seeing on the wiki, layered graphics have [CONDITION_CHILD] and [CONDITION_NOT_CHILD] available, but these check for both children and babies, with no argument for anything like age. If you use non-layered graphics, like for gorlaks, you can specify BABY, CHILD, or DEFAULT as a condition for the entire creature's graphics. It's not really obvious how you'd combine these.
My guess is that you can do something like
[LAYER_SET:BABY]
(add in layers as needed)
[LAYER_SET:CHILD]
(add in layers as needed)
[LAYER_SET:DEFAULT]
(add in layers as needed)
But as far as I can tell no creature does this in vanilla DF so I'm not sure it will work. The wiki's explanation for the creature graphics tokens implies that BABY, CHILD, and DEFAULT should work for LAYER_SET though.
My proposal above does not work. For some reason, if you do what I did and just try to copy and tweak the [LAYER_SET:DEFAULT] layers into a new [LAYER_SET:CHILD] group, the game won't parse the layer tags correctly. It was randomly spewing errors about item graphics tags not being recognized and then random text in the file like the -- does not exist notes on some lines.
What does work is something similar to what the game does for the [CONDITION_PROFESSION_CATEGORY:CHILD] conditions. For each layer, you have to duplicate the layers above the adult graphics for the layer, and add that condition to it. Or, better yet, use [CONDITION_CHILD] instead. That doesn't conflict with other profession check tags, and is easier to spot.
That does seem to work. I've got some issues in my mod with clothing colors being jacked up now, but that's on me. It was intentional that this would no longer make all kids have red clothes, so that's something that'll take some getting used to.
I don't know if the baby graphics work yet, but I strongly suspect that they don't. Most likely the [LAYER_SET:BABY] I specified is ignored as invalid and the [CONDITION_CHILD] layers will get picked up instead. I'll find out once I have some babies.