Merged
Conversation
|
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.) |
3923e25 to
6d47ab6
Compare
Collaborator
Author
6d47ab6 to
7bf0c2c
Compare
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.
7bf0c2c to
13d1d17
Compare
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.
Replace Talker and rename it to TutorialGuy, adding an InteractArea and a TalkBehavior for the tutorial dialogue. In the same way, replace the Farmer. Edit the dialogue to not use npc_name variable. Replace other NPCs by random townies: FarmersPartner, GardenerA, and GardenerB.
13d1d17 to
2440692
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds components that make possible the creation of characters from different body parts or props. Also adds one sample character "townie" and replaces some NPCs from Fray's End with it. Townie is made of:
Also applies cel-shading recolor to 2 parts (body and head) for a random skin tone.
A "zoo" test scene is also provided as initial documentation.
Add RandomTextureSpriteBehavior
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.
SpriteFramesHelper: Allow to call it without an "old base 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.
SpriteFramesHelper: Remove unused parameter from _get_base_texture auxiliary function
This parameter is not used by the auxiliary function at all.
Also, remove the double negation and check for FileAccess.file_exists()
directly.
CelShadingRecolor: Expose set_random_skin_color() function
To be able to call it from other scripts.
Add character randomizer script
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.
Add random townie character
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.
Use random-generated townies in Fray's End
Replace Talker and rename it to TutorialGuy, adding an
InteractArea and a TalkBehavior for the tutorial dialogue.
In the same way, replace the Farmer. Edit the dialogue to
not use npc_name variable.
Replace other NPCs by random townies: FarmersPartner,
GardenerA, and GardenerB.