How to use GfxCrunch (Animated Object Sprites)

From SkyTemple
Revision as of 16:46, 19 April 2025 by Deltaflare (talk | contribs) (Created page with "{{Stub}} '''XML''' is a markup language for data. '''GfxCrunch''' uses this data to create object sprites for EoS (not confirmed). Recommend export to a static sprite from SkyTemple and then editing the exported files to your liking. XML uses tags to list this data in the format of: <code><TagName> content here </TagName></code> GfxCrunch uses the following folders and files to generate object sprites. == Imgs Folder == This is a folder of all image sprites used in...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This article is unfinished. You can help expanding it.


XML is a markup language for data. GfxCrunch uses this data to create object sprites for EoS (not confirmed).

Recommend export to a static sprite from SkyTemple and then editing the exported files to your liking.

XML uses tags to list this data in the format of:

<TagName> content here </TagName>

GfxCrunch uses the following folders and files to generate object sprites.

Imgs Folder

This is a folder of all image sprites used in the animations. Images are labeled from 0000.png, 0001.png, 0002.png, etc. These images have to be indexed images and fit within GfxCrunch’s sizes (16 x 16 or multiples of that are safe starting points).

palette.pal

Contains the image palette. The indexes correspond with the color indexes of the sprites in the imgs folder. Must contain 16 colors at most, including a transparent color. To obtain this, it's recommend to import one of your images into SkyTemple as a static sprite, then export from SkyTemple.

frames.xml

Contains data for image frames.

XML Tags

<FrameGroup>

Indicates a group of frames. Multiple frames can be layered on top of each other or be aligned side-to-side to create a "bigger sprite."

<Frame>

Indicates a single image sprite.

A <FrameGroup> is made up of x amount of <Frame> images, if it needs to form a bigger sprite. If a sprite is going to be just one image (eg: one PNG from the imgs folder), each PNG that will be used for animations needs to be in its own <FrameGroup>. If not, this will cause memory issues and/or crashes when displaying the object in cutscenes.

<ImageIndex>

The image index of the frame. This correlates with the image number in the imgs folder.

imgsinfo.xml

spriteinfo.xml

- todo: explanation of memory allowance in spriteinfo.xml

offsets.xml

How to Use with SetAnimation()

This is the ExplorerScript function that lets you change the animation of an object, with an integer taken in as an argument. When using the function, it should be called as SetAnimation<entity ENTITY>(x).

Depending on how many AnimationSequenceIndexes you have defined, the argument will differ as follows:

  • 1 - 8 will cause a specific animation to loop, with 1 denoting Animation 0 and 8 denoting Animation 7.
  • 9 - 16 will play Animation 0 and then play the first frame of the signified animation, with 9 denoting Animation 0 and 16 denoting Animation 7.
  • 17 - 24 will play a specific animation without looping, with 17 denoting Animation 0 and 24 denoting Animation 7.

Example

For reference, here is a link to a sample folder: External Link to Google Drive

When finished, add to Tutorials