View Single Post
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

Apr 6, 2015, 08:01 PM
Violet CLM is offline
Reply With Quote
Custom .j2a files

JJ2+ version 5.0 includes two new .j2a files, but no instructions for how to make your own. Sorry. See, what happened is I came up with an internal tool for us to use, but then never found the time to make anything more user-friendly out of it, and didn't feel quite right bundling the internal tool with the main release.

But here you go, if you do want to make your own .j2a files.

It's just some very basic Python 2.x files using PIL. Run j2a-extract.py and type the filepath of one of your existing .j2a files to see what kind of file structure is expected of you, compile your own set of sprites, then run j2a-import.py. If you're extracting C:\Games\Jazz2\foo.j2a, the results will be stored in a few folder C:\Games\Jazz2\foo-j2a\ as a series of subfolders, one for each anim set in the file. Each subfolder will contain a series of subsubfolders, one for each animation, and those will each contain a series of .png files, one for each anim frame. Then later when you're importing, the file/folder name relation will be the same—import the folder C:\Games\Jazz2\bar-j2a\ to build C:\Games\Jazz2\bar.j2a.

The .png files store all the frame metadata in their filenames, using the format FRAMENUMBER,HOTSPOTX,HOTSPOTY,COLDSPOTX,COLDSPOTY, GUNSPOTX,GUNSPOTY.png. If the frame should be drawn as transparent by default, include the letter "t" right after FRAMENUMBER, e.g. 0t,-9,-11,0,0,0,0.png.

It hopefully sounds more complicated than it is. Look at one or more existing .j2a files and you should figure out how it works pretty quickly. What you shouldn't do is try to use this to rebuild anims.j2a, since this has absolutely no support for sounds, only sprites, and anims.j2a has hundreds of sounds in it that you would end up deleting. And if you can't figure how to run .py files, wait around and hope that someone will make an executable version.

Post any related questions here and I'll do my best to answer them, even if that answer is "google python", though consider also the general AngelScript help thread.

(thanks go to Stijn, whose code I modified, and Neobeo, whose research this was based on.)
__________________

Last edited by Violet CLM; Apr 8, 2015 at 12:32 PM.