Skip to content

Conversation

@manuq
Copy link
Collaborator

@manuq manuq commented Dec 30, 2025

See discussion: #1802

Reusing the sprite_frames_exported_textures addon.

This behavior node can be configured with an array of textures, and
provides a tool button to randomize the parent AnimatedSprite2D texture.
Only if this parameter is passed, the existing safeguard is checked.
That is, that the new texture and the old one share the same base
texture.
…xiliary function

This parameter is not used by the auxiliary function at all.

Also, remove the double negation and check for FileAccess.file_exists()
directly.
To be able to call it from other scripts.
A single button to randomize various aspects of a character. For now,
the skin tone and the textures of a stack of AnimatedSprite2D that
compose the character with parts like: legs, body, head, hair, head
prop.

Also provides a way to flip the character horizontally. And a way to
start the current animation of each part at a random frame, but all
using the same random frame. The caveat of having multiple parts is that
existing logic like the RandomFrameSpriteBehavior don't work for an
array of sprites, so some things have to be reimplemented.
@github-actions
Copy link

Play this branch at https://play.threadbare.game/branches/endlessm/random-townies.

(This launches the game from the start, not directly at the change(s) in this pull request.)

Draw the character in Aseprite as layers. Each layer has a part variant
and offset encoded in its name. For example:

- "head_003" for variant 3 of the character head.

- "body_002.dy_-12" for variant 2 of the character body,
  and an offset of -12 in the Y axis.

Export each part variant as PNG. Create a scene with one
AnimatedSprite2D node per part. Use the character sprite randomizer to
randomly set the multiple PNGs of each part. Also use the cel-shading
node and material in each part with skin. Add the character randomizer
to the root node.

Also add a test scene with multiple townies instantiated. Add talker
behavior to them and some dialogue explanation.
@manuq
Copy link
Collaborator Author

manuq commented Dec 31, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants