So in a nutshell, they have multiple poses for a sprite in their project they're developing, and there is the potential for the assets of said sprite being updated as the project goes on (mostly in the form of another potential pose? I think? I'm not involved in any direct development on their project, so I'm unsure as to how their workflow and asset creation works). However, to try and cut down on the amount of additional work necessary for these sprites, at least two of the poses share one entire set of identical groups/attributes - that being the individual facial components of the character (eyes/mouth/blush/etc); the end result is that even though the face of the character is in a different spot across the two poses, the actual assets and logic behind showing them on said characters' face is entirely identical code.
As a really simplified example:
Code: Select all
layeredimage char pose1:
group face:
#all the code for the facial features
layeredimage char pose2:
group face:
xoffset 10 yoffset -10
#all the *same* code for the facial features as pose1
I haven't been able to come up with a good solution to this, though. Obviously I've already outlined "just copy/paste", but I want to try and avoid the pitfalls I've outlined above.
One solution I originally thought might be promising would be to, instead, disregard the two poses entirely and just list the two "poses" now as different attributes under the same layeredimage definition; I figured this would eliminate the problem since there'd then only be one place to update...but then, instead, that just seems to shift the problem elsewhere, since to do *that* requires adding in a lot more "if_any / if_not / if_all" conditionals to be applied to the attributes so that only the correct set of facial features appears when the relevant "pose" attribute is in place. This feels like a complicated way to accomplish this, and...still not really make the code easy to update without the same potential problems as before. If it was possible to conditionally apply ATL attributes to a number of attributes quickly and simply - i.e., without just copy/pasting the code as a different group entirely and just putting in different ATL between two groups - then this wouldn't be anywhere near as big of an issue, but I don't think this is possible?
I even briefly thought of maybe just putting in the "face" itself (or the features of the face, anyway) as their own layeredimage and then putting that into the overall layeredimage of the character sprite...except there doesn't seem to be a way to pass attributes into one layeredimage to then be applied to a layeredimage within that one quickly and easily - or at all?
I've pretty much run out of ideas here. Does anyone know of a better way to accomplish this cleanly and simply? Thank you for any advice you might give!