Kaji wrote: ↑Thu Nov 17, 2022 10:32 pm
And I've duplicated a
layeredimage set as follows:
Layeredimage can't be copied like that. You only assign variable
dummy to variable
eileen. As a result,
eileen is the same image, not a duplicate.
Kaji wrote: ↑Thu Nov 17, 2022 10:32 pm
Is this possible, or do I have to repaste the entire block defining the initial layeredimage to be able to create variants that just have a tinted base?
The short answer is no. The layeredimage doesn't have this functionality. Usually, characters have quite different appearances and this is not necessary.
The long answer:
1) If you have a small number of characters I would recommend copying the entire block defining the initial layeredimage. It is even better if later you decide to add some changes to a particular character. Layeredimage is an alternative to composite, which can be shown with attributes.
Potentially you could use
LayeredImageProxy to create a duplicate of
layeredimage. I don't recommend this implementation but you can do something like:
Code: Select all
layeredimage dummy:
always:
"base_empty.png" # empty transparent image
group base:
attribute def_base default:
"dummy.png"
attribute tint:
Transform("dummy.png", matrixcolor=TintMatrix("#f00"))
# Other groups and attributes
image eileen = LayeredImageProxy("dummy")
image lucy = LayeredImageProxy("dummy")
For Lucy you have to specify attribute tint, which is why it is cumbersome:
Code: Select all
label start:
show eileen at left
pause
show lucy tint at right
pause
But it makes more sense if you use a last name or initials as an attribute:
Code: Select all
label start:
show peter parker at right
show mary mj at left
2) If you have a lot of characters, or generate random characters there are various approaches you can consider:
For example you can create layeredimages using
python. This way you can easily create a bunch of characters with small differences. This way you can avoid repetition of the code, although it is probably less readable and more time-consuming to write the code.
Alternatively, you can create analog of layeredimage using CDD, but, again, it takes some time and should be used only when necessary.