PDA

View Full Version : Warps are objects


Neobeo
Dec 6, 2011, 09:40 AM
I really don't want to open a new thread for this, but I can't exactly find anything relevant on the forum. Basically, warps act as objects if and only if ShowAnim is set to 1 (otherwise it acts as an area). That is all. (http://dl.dropbox.com/u/42966694/warp.j2l)

Jgke
Dec 6, 2011, 09:45 AM
Woo, dropbox!

DoubleGJ
Dec 8, 2011, 05:49 AM
Wow, so simple yet so amazing.

minmay
Dec 8, 2011, 06:50 AM
(belts work on warp objects too, by the way)

Seren
Dec 8, 2011, 07:52 AM
(belts work on warp objects too, by the way)
That's the first thing I checked too. :D Other properties of warp objects I just found and considered interesting are:
-Unlike typical warps they aren't ignored when nowall is on.
-In SP they actually spawn exactly at (30, -67) from the top-left corner of the warp event, then travel down until they reach a masked pixel, in case of which they stop. Their warping area is a rectangle, starting at approximately (-64, 24) and ending at approximately (0, 80), both relatively to the point the object stopped at.
-A loop made of a warp object and a corresponding warp target on the same tile is inescapable. jjk causes a life loss but the death animation doesn't get a chance to be played and therefore you don't die. And as mentioned before, jjnowall won't work. Although obviously, the game over screen will show up if you lose all your lives.

Neobeo
Dec 8, 2011, 08:33 AM
-In SP they actually spawn exactly at (30, -67) from the top-left corner of the warp event, then travel down until they reach a masked pixel, in case of which they stop. Their warping area is a rectangle, starting at approximately (-64, 24) and ending at approximately (0, 80), both relatively to the point the object stopped at.

Wow, did you do this by hand? Colour me impressed. The numbers are extremely accurate!

Anyway here's what really happens under the hood:
It starts at approximately (15 + x<sub>0</sub>, -16 - y<sub>0</sub>), and then the warp area is a circle with center at (-16 - x<sub>0</sub>, y<sub>0</sub>) relative to that masked pixel, with radius 32 (but not including boundary). This circle shape probably makes it useful if you want tests with weird shapes.

I'm still trying to investigate where (x<sub>0</sub>, y<sub>0</sub>) comes from yet, so far knowing nothing other than it tries to load a warp animation but goes wrong -- but I've seen at least 2 possible values: (0, 39), and the one you used which is (15, 51).

Edit: I should probably mention that I usually see (15, 51) when using JCS save+run, and (0, 39) if loading from the menu. I'm not sure if this is always the case though.

Neobeo
Dec 8, 2011, 03:23 PM
Ok, so there are at least 3 possible values of (x<sub>0</sub>, y<sub>0</sub>), and it's fairly reproducible:
(0, 0): This happens if you go through the opening cinematics but never access the episodes list (e.g: anything in Party Mode). A consequence of this is that if you play play my test level (warp.j2l) from Party Mode, the warp is actually a bit higher than normal and it doesn't look as cool!
(0, 39): This happens if you open the episodes list at least once, even if you then press back.
(15, 51): This happens if you bypass the opening cinematics completely (e.g: JCS save+run, command line options)


Also, I made a small hack if you want to visualise where the warps are. It basically draws a pixel-perfect circle that represents the warp area, as long as ambient sound with sample 44 is placed somewhere on the level:
Patch JAZZ2.EXE v1.23 at address 0x13018
Old: 8A C8 33 C0 66 8B 43 34 C1 E0 03 0F BE C9 66 8B 90 C0 F9 54
New: 8B 0D B0 F8 54 00 3E 8B 0C CD C4 F9 54 00 0F BF 49 06 EB 19

The only drawback is this will also replace the special bonus warp animations (10, 20, 50, 100) with circles. Admittedly, it's not really difficult to fix that in place but then the patch will be a lot longer than 20 bytes.

Violet CLM
Dec 8, 2011, 04:23 PM
Putting aside people's bizarre unshared means of editing JJ2 without the original source code, the takeaway message is that nobody should try to do anything with this "discovery" because it's wildly variable?

Sean
Dec 8, 2011, 04:40 PM
the takeaway message is that nobody should try to do anything with this "discovery" because it's wildly variable?

Pssh. Ideas already forming in my head.

Vegito
Dec 9, 2011, 10:16 AM
-A loop made of a warp object and a corresponding warp target on the same tile is inescapable. jjk causes a life loss but the death animation doesn't get a chance to be played and therefore you don't die. And as mentioned before, jjnowall won't work. Although obviously, the game over screen will show up if you lose all your lives.

I managed to escape by jumping out, you can double jump out or if you move to the right/left you can try to jump out ;).

Seren
Dec 9, 2011, 11:17 AM
You just placed it wrong. Try with warps placed this way:

http://img52.imageshack.us/img52/1345/warpf.png

Sean
Dec 20, 2011, 07:35 PM
nobody should try to do anything with this "discovery" because it's wildly variable?

*ahem ahem* (http://www.mediafire.com/?4we036l0cosa775)

While you're in the level, don't move. Then move after you've gotten bored.

Violet CLM
Dec 20, 2011, 08:18 PM
Well, okay, sure, but that's the familiar case of coin warps with sprites. It's the numbers other than 10, 20, 50, and 100 that are wildly variable, because apparently they work differently depending on how you access the level.

Love & Thunder
Dec 22, 2011, 03:56 PM
Very interesting. :) This could revolutionise the way JJ2 levels are made!... Again!

minmay
Aug 30, 2012, 02:48 PM
I just had a level completely ruined by this: it doesn't appear to be possible to put a generator on these.

Violet CLM
Aug 30, 2012, 02:57 PM
How do you mean? I'd imagine trying to generate them would be like trying to generate bridges: kind of pointless, since they never get destroyed.

minmay
Sep 1, 2012, 08:02 AM
They never get destroyed, but they can be moved...

Seren
Sep 1, 2012, 10:36 AM
You're revealing so little info about what you want to achieve that it's difficult to help you and I felt really discouraged to it. Let's say I'll try though. First off, Violet is right, warps don't get destroyed so creating a warp generator will give you almost the exact same effect as creating a warp. Another fact is that creating a warp object generator is perfectly possible with use of an MCE (although you will most likely have to edit your JCS.ini a bit). I'll upload an example level if you need one, just ask, it's nothing spectacular though since for aforementioned reasons it simply spawns one warp and does nothing else afterwards. If what you want to achieve is warp objects travelling through a part of the level from time to time you have to use a crate MCE instead, that is, a generator of crates containing warp objects. This also happens to be perfectly possible. If you need help at creating any of these or I didn't answer your question, specify it further. Feel free to move to private messages if you want to avoid discussing ideas in public.

minmay
Sep 2, 2012, 03:18 PM
Yes, those are exactly what I tried. I could not get MCEs or crates to create any warps whatsoever, zones or objects. Sorry if I wasn't clear about that.

Violet CLM
Sep 2, 2012, 04:42 PM
0,0: Generator (Event=32)
1,0: MCE Event (Event=230, Delay Secs=1)
2,0: MCE Event (Event=x, Delay Secs=y, Initial Delay=0, [AddAnotherParameterInJcsDotIni]=1)
0,1: Belt Right
1,1: Belt Left

x: Warp ID
y: Number of coins needed

You'll also need another warp event somewhere in the level requiring the same number of coins so the sprite will get loaded, though it doesn't need to have ShowAnim set to 1. At a guess, the part that's tripping you up is that you need to add another parameter to MCE Event, since its bitfield doesn't stretch far enough to set ShowAnim otherwise.

minmay
Sep 4, 2012, 01:35 PM
I'm afraid it wasn't that part, and I don't know what part it was, because sure enough when I tried it again it worked fine. I wish I'd saved the version that didn't work because I have no idea what it was I did wrong, and was very confident in not having done anything wrong, if you hadn't guessed!