DevLog 02: Aseprite Bulk Tag Creation

Russell Matney

Created: 2024-01-25 Thu 17:24

_

Watch this devlog on YouTube!

https://youtu.be/yKHnLkeyGzc

You Are Here: https://russmatney.com/devlogs/devlog_aseprite_bulk_tag_creation.html

Aseprite Bulk Tag Creation

- Need to create 10+ animations x # of characters?
  - Why batch tag creation?
  - Demo of solution
  - Github repo available: `russmatney/aseprite-scripting`
- Solution Overview
  - Symlink a `scripts` folder to Aseprite's config:
    - `~/.config/aseprite/scripts/<project-name>`
  - Write a script to add-tags to the current open sprite
  - Invoke the script!
- Symlinking Walkthrough
- Script Overview + Walkthrough

What are tags in Aseprite?

- tags are 1:1 with an animation (one or more frames)
- tags have a name, a start frame, and an end frame

Why so many tags?

- I've built up base controllers for my games
  - (in dino/addons/beehive)
- They expect specific tags (animations) to exist
Latest list from dino below
- supports side-scrolling, top-down, and beat-em-up
idle, _jump, falling, _dead,
running, air, _knocked_back, _dying,
idle_down, idle_up, idle_right, run_down, run_up, run_right,
_landed, walk,
_punch, _punch_2, _kick,  _jump, _jump_kick,
_punched, _kicked,
_grab, _grabbed, _throw, thrown,
_hit_ground, _get_up,

Demo

- Let's jump into Aseprite and create some tags!

Github repo and slides available

- github.com/russmatney/aseprite-scripting
- russmatney.com/devlogs/devlog_aseprite_bulk_tag_creation.html

Links in description!

Automating tag creation

- Symlink a `scripts` folder to Aseprite's config:
  - `~/.config/aseprite/scripts/<project-name>`
- Write a script to add-tags to the current open sprite
- Invoke the script!

Symlink a scripts directory from your project

Benefits:
- once per project
- quick to jump into a script next time!

Aseprite has a user-configuration directory somewhere on your machine

  • Usually ~/.config/aseprite, but varies by OS
  • Find it in File > Scripts > Open Scripts Folder
We want to symlink scripts in our project into this scripts folder
- like: ~/.config/aseprite/scripts/<project-name>

Figure 1: add-fighter-tags in the beatemup-city scripts dir

Creating a symlink (on linux):

ln -s ~/<your-proj>/scripts ~/.config/aseprite/scripts/<your-proj>

You’ll need to File > Scripts > Rescan Scripts Folder at least once.

Then you can write a script in your project, and invoke it from Aseprite via File > Scripts > <project-name> > <script-name>.

Demo time

- let's create a symlink!

Bulk Tag script

- Hard-code a list of tags
- Collect the existing tags
- Walk the list of desired tags
  - Check if each tag already exists
  - if not:
    - create a new frame
    - create a new tag with that frame
    - set the tag's name
- There's some "colorwheel" logic to make the tags easier to distinguish.
- (otherwise they all end up the same color. yuck!)

Code walkthrough

Time for some code!

Longer demo

Let’s see some aseprite files!

  • beatemup-city animations
  • dino animations

Wrap up

I hope you made it through all that!

If not, check out the repo’s readme (github.com/russmatney/aseprite-scripting) or the code itself.

Feel free to open an issue or leave a comment with any questions.

Resources

Credits

Thanks for watching!

Special shoutout to my Patrons:

- Ryan Schmukler
- Jake Bartlam
- Duaa Osman
- Cameron Kingsbury
- Aspen Smith
- Ellie Matney
- Alex Chojnacki

Links

  • github.com/russmatney/aseprite-scripting
  • patreon.com/russmatney
  • russmatney.com

DevLog 02: Aseprite Bulk Tag Creation