Apr 6, 2015, 08:01 PM | |
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. |
Apr 7, 2015, 02:04 PM | |
I have python, but i can't seem to get a prompt by just opening the file and selecting the python tool. This could use some more explanation i feel :0.
__________________
|
Apr 7, 2015, 04:36 PM | |
You need to run the file, not just open it.
|
Apr 8, 2015, 08:02 AM | |
It doesn't work I run it with the specified arguments but still invalid syntax.
__________________
~XxMoNsTeR |
Apr 8, 2015, 08:20 AM | ||
Quote:
EDIT: Another error:
__________________
~XxMoNsTeR Last edited by XxMoNsTeRXM; Apr 8, 2015 at 08:33 AM. |
Apr 8, 2015, 12:33 PM | |
I have the same error as monster .
__________________
|
Apr 8, 2015, 12:34 PM | |
Okay, that one's on me. I forgot misc.py in the zip. Sorry, try again now.
|
Apr 8, 2015, 12:59 PM | ||
Quote:
I looked into the code, and the module is imported on j2a.py line 11
__________________
~XxMoNsTeR |
Apr 8, 2015, 01:05 PM | |
"No module named image"
__________________
|
Apr 8, 2015, 01:11 PM | ||
Quote:
|
Apr 8, 2015, 02:36 PM | |
"please type the .j2a file you wish to extract"
Anims file plus.j2a could not be read! "please type the .j2a file you wish to extract" plus file plus.j2a could not be read! "please type the .j2a file you wish to extract" Anims.j2a file plus.j2a could not be read! "please type the .j2a file you wish to extract" plus.j2a file plus.j2a could not be read! ...... Also it was a pain finding the right PIL library, your link did not provide the right info. I think you meant: http://www.pythonware.com/products/pil/ not, http://www.pythonware.com/library/pil/ Even then it link for 2.7 was not working so i searched the internet. Apparently something named PILLOW took it place but i still manage to find the right library here: http://christianakesson.com/compiling-pil/ at the bottom of the article. Still not working though...
__________________
|
Apr 8, 2015, 02:39 PM | |
I'm not sure what happened for you, but the link in misc.py leads me to http://effbot.org/media/downloads/PI...in32-py2.7.exe after a few clicks. Is that what you installed?
Looking at j2a.py the error you're getting means the j2a file can't be read. Are you sure the path is right? Are you maybe entering "Anims" instead of "Anims.j2a"? The script needs the full filename, including extension. Last edited by Stijn; Apr 8, 2015 at 02:57 PM. |
Apr 8, 2015, 02:57 PM | |
I can't open the link you just gave, it is the same link on the page i send. It gives a web-page error. 'Web page not available'.. or simply doesn't exist anymore. That's why i downloaded it elsewhere. I'm quite sure this what I have should also work.
Also no, i have D:\Games\Jazz2. so on the D: directory, not C:. I entered D:\games\jazz2\j2a-extract.py in the command prompt. Then received a message "please type the .j2a file you wish to extract" Anims and then.. file Anims.j2a could not be read! It is from C:\Users\Lennart> though, but imo asking 'which j2a I want to extract' shows it has the right .py file in the jazz2 folder.
__________________
|
Apr 8, 2015, 03:01 PM | |
I think I opened the wrong file, and I edited my post accordingly. You need to enter the full file name, including the extension. So "Anims.j2a", not "Anims", unless you renamed your file to not include an extension. Make sure the file is in the same folder as the scripts too, I'm not certain it will work otherwise.
|
Apr 8, 2015, 03:04 PM | |
jazz2 folder contains the pil library, the given .py extensions in the zip (also the misc). j2a files and i typed "Anims.j2a" and still it doesn't read. Folder is 1.23 if it's important.
__________________
|
Apr 8, 2015, 10:34 PM | ||
Quote:
EDIT: Wat? And this is all it gave to me This is the command I typed in Command Prompt: python j2a-extract.py "{path to jj2folder, not to .j2a file, I found that by myself}" after this it told me: Please type the filename of the .j2a file you wish to extract: So I type: plus.j2a and then the error happens, and I only get two folders and only one file, fps.10
__________________
~XxMoNsTeR Last edited by XxMoNsTeRXM; Apr 8, 2015 at 10:57 PM. |
Apr 8, 2015, 11:43 PM | |
Ah, yeah, it's been long enough since I used j2a-extract that I'd forgotten it wants a palette file. I've put that in the zip too.
You'll probably still have trouble with plus.j2a, but the other two .j2a files in your folder should work fine. FawFul noticed earlier that plus.j2a was accidentally assembled in a way that JJ2+ accepts but j2a-extract doesn't Last edited by Violet CLM; Apr 8, 2015 at 11:56 PM. |
Apr 8, 2015, 11:55 PM | ||
Quote:
EDIT: Now help me understand the images: The first zero is the frame, the next numbers I don't know what they are. EDIT 2: nvm...
__________________
~XxMoNsTeR Last edited by XxMoNsTeRXM; Apr 9, 2015 at 01:05 AM. |
Apr 8, 2015, 11:57 PM | |
Yay! That's both of you... now I've exhausted the market and don't need to worry about making a proper executable ever. /s
|
Apr 9, 2015, 01:06 AM | ||
Quote:
BTW... this is on j2a-import.py:
__________________
~XxMoNsTeR Last edited by XxMoNsTeRXM; Feb 26, 2017 at 02:30 AM. |
Apr 9, 2015, 10:25 AM | |
That'll happen if you have one or more improperly formatted image filenames.
|
Apr 9, 2015, 10:55 AM | |
I used this script:
#pragma require "Mario.j2a" #pragma name "Play as Mario!" /************************************************/ /**********Play as Mario! by FawFuL**************/ /************************************************/ void onLevelLoad() { jjAnimSets[ANIM::SPAZ].load(0, "mario.j2a"); jjAnimSets[ANIM::SPAZ2].load(1, "mario.j2a"); } void onPlayer(jjPLAYER@ play) { if (play.charCurr == CHAR::JAZZ || play.charCurr == CHAR::LORI) play.morphTo(CHAR::SPAZ); } And i ran into 2 problems: 1: Animation index the animation indexes for 1.23 and 1.24 are different for set Anim::SPAZ. There are unused animations in 1.23 that clutter the animation order like spaz grabbing ledges, the j2a is based on 1.24. Apparently there are ways to fix this but it's really complicated. It also makes this preset stuff redundant if it doesn't takes differences in indexes into account. 2. Wrong animations on other online players I overrided Anim::SPAZ and Anim::SPAZ2 and they look right for 1.24 users, however you get weird cluttered images on other players. (bird animations, bullets and a few of the custom animations, iirc). Vanilla jj2 draws your own sprites and others sprites right from Anim::SPAZ, why does my custom j2a make it show 2 different things on local and online players? Is this fixable? I suggest that it's maybe useful to have a snippet that fixes these 2 problems, because i imagine more players would want to make their own custom j2a characters. afaik there were some already that ppl liked to import .. a snippet could be nice and reusable for this.
__________________
|
Apr 9, 2015, 12:57 PM | |
This is what the RABBIT::Anim enum is for! Maybe once you get it working, you can be the one to write the snippet.
Additional hint. |
Apr 10, 2015, 10:05 PM | |
Apr 11, 2015, 02:08 AM | |
DJazz's site also lets you download an archive with all JJ2 sounds in wav format, although they're unnamed there.
__________________
I am an official JJ2+ programmer and this has been an official JJ2+ statement. |
Apr 11, 2015, 08:04 AM | |
I made my anims script work by adding 3 additional sets for 1.23. I tried to do both 1.23 and TSF with a single set, but I didn't manage to make it work (sorry Violet!). It is probably possible with RABBIT::ANIM.
both 1.23 and TSF run the fully correct animation replacements now, however you still see other players wrong. The following explanation is what happens when seeing other online players: For example RABBIT:: DIVE while it should be RABBIT::STAND, RABBIT::STAND while it should be RABBIT::IDLE2..... RABBIT:: DIVE while it should be RABBIT::JUMPING1. I found out that it does somewhat try to get the right frames, for example it stays stuck in the buttomp frame forever whenever a player buttstomps. It stays stuck in the airboard frame whenever someone had an airboard and whenever someone ducks it stays stuck in that frame aswell. It can even still load the latest 'normal' spaz sprite upon cycling. Is this a bug or can i do something about this in AS? all animations are loaded upon levelload so i don't understand why there is a 'refresh-rate' problem (eventhough some animations won't show at all even if you wait for a delay). when i duck, someone else will see the right animation index 3 seconds late and will only show a single frame instead of a complete animation. I'd like to add that the 'errors' are really consistent. Always the same frames where it gets stuck in and the same RABBIT::ANIM sets that will change with it. The only animation indexes that work somewhat well are RABBIT::AIRBOARD and RABBIT::CORPSE. Maybe unimportant to say, but this was not the case if you shared custom j2a files back in the day.
__________________
Last edited by FawFul; Apr 11, 2015 at 08:17 AM. |
Apr 26, 2015, 03:20 PM | |
There's a problem. Whether I use Python 2 or Python 3, when I write "C:\", Python highlights the ":" in "C:\" as invalid syntax
|
Apr 26, 2015, 11:56 PM | |
I don't want to give up! I really need that custom j2a file! |
Apr 27, 2015, 02:45 AM | |
By terminal you mean cmd.exe in System 32, right?
Because there seems to be yet another problem ... When I write the line "C:\Games\Jazz2>python j2a-extract.py" I get "Access Denied" |
Apr 27, 2015, 03:04 AM | |
Apr 27, 2015, 03:32 AM |
DennisKainz |
This message has been deleted by DennisKainz.
Reason: Solved on my own
|
Apr 27, 2015, 04:07 AM | |
EDIT: Solved. If you get this message, it is because your PNGs aren't color-indexed. P.S. Thanks for your help, admin! Now I can create my own j2a files! Last edited by DennisKainz; Apr 27, 2015 at 09:38 AM. |
May 2, 2015, 01:04 AM | |
What do you mean aren't colored-index? (I got this error too)
__________________
~XxMoNsTeR |
May 2, 2015, 01:19 AM | |
You need to use 8-bit PNGs, not 24/32.
|
May 2, 2015, 04:13 AM | |
Still doesn't work, I made them 23x31, same error.
__________________
~XxMoNsTeR |
May 2, 2015, 04:27 AM | |
No offense but LOL.
8-bit means they need to be 256 colors and use the JJ2 palette.
__________________
Mystic Legends http://www.mysticlegends.org/ The Price of Admission - Hoarfrost Hollow - Sacrosanct - other - stuff |
May 2, 2015, 04:32 AM | ||
Quote:
EDIT: Where can I get the jj2 palette?
__________________
~XxMoNsTeR Last edited by XxMoNsTeRXM; May 2, 2015 at 04:57 AM. |
«
Previous Thread
|
Next Thread
»
Thread Tools | |
|
|
All times are GMT -8. The time now is 03:15 PM.
Jazz2Online © 1999-INFINITY (Site Credits). Jazz Jackrabbit, Jazz Jackrabbit 2, Jazz Jackrabbit Advance and all related trademarks and media are ™ and © Epic Games. Lori Jackrabbit is © Dean Dodrill. J2O development powered by Loops of Fury and Chemical Beats. Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Original site design by Ovi Demetrian. DrJones is the puppet master. Eat your lima beans, Johnny.