Creating a script for import/export our format - working but issues

I’ve created a plugin for the Ultima VII/Exult shp file format. There are two ways I’ve been doing it and mostly making it work.
Shapes are indexed with #255 being the transparent color, consisting of frames (or layers) that each can have a different size and offsets.

The Frames way:

  • a helper tool that converts the shp to png
  • importing the pngs as frames in Aseprite
  • writing the offsets (imported from the shp file) to cel “user data” for each frame
  • resizing the canvas to accommodate all frames
  • on importing the pngs I’ve temporarily disabled the Animation detection
  • can be saved in aseprite format and no data is lost
  • on export the offset is read from the cel “user data” and the correct frame size is being used (instead of canvas size) - this produces exact same shp files as having been imported

Issues:

  • on importing the pngs as frames, each frame gets prompted for frame properties (Duration). Is there a way to disable this (temporarily)?

The layer way: this is more like our The Gimp plugin handles it.

  • the same helper tool that converts the shp to png
  • importing the pngs as layers in Aseprite
  • writing the offsets to the layer names
  • resizing the canvas to accommodate all layers
  • on export the offset data is correctly read from the layer name

Issue:

  • no import issue anymore
  • can I make Aseprite directly open shp files without having to go through the “Import Shp” menu?

Code at exult/mapedit/tools/aseprite_plugin at aseprite_plugin · DominusExult/exult · GitHub

Layer code (just the main.lua needed) at -- Exult SHP Format Extension for Asepritelocal pluginName = "exult-shp"lo - Pastebin.com (this is WIP, not yet versioned on github and might contain other errors)

1 Like

Screenshot of the frame import (fixed some other issue, hence a new screenshot)

A Windows version of the plugin can be downloaded from https://exult.info/snapshots/exult_shp.aseprite-extension (it’s the frames version but includes the layer script as txt file), it also includes two shp files in case anyone wants to test it out themselves. I’ve only tested it on an ARM64 version of Windows 11 (as I’m on macOS and can only run that in a VM).

1 Like