Board of Slick

Library of the Ancients => Final Fantasy IV Research & Development => Topic started by: Pinkpuff on August 16, 2013, 01:09:01 PM

Title: What is known about vehicles?
Post by: Pinkpuff on August 16, 2013, 01:09:01 PM
I don't think I've seen any kind of discussion even remotely covering this topic (though feel free to prove me wrong on that).

Here are some questions that come to mind immediately:
Title: Re: What is known about vehicles?
Post by: chillyfeez on August 19, 2013, 11:47:28 AM
So, a lot of this is answered by my data on world map tile properties (http://slickproductions.org/forum/index.php?topic=1866.0)
The ability of each vehicle type to travel on/over a tile and the ability to land/dismount on a tile is determined by the properties of the tile. It's fully customizable.
That being said, it is therefore entirely possible to create a sea ship, but you would have to ax the hovercraft (because the ship will travel anywhere, will land nowhere, and this can't be changed)
- make ocean tiles travelable by hovercraft
- make bridges travelable by hovercraft
- make every other tile not travelable by hovercraft
- swap the graphics of the ship and the hovercraft
You'll now have a sea ship that travels oceans and docks at bridges. You can add bridges to the map at strategic docking points.

I'm still unclear about the rest of the (largely cosmetic) properties of vehicles. I imagine there is a bank of data somewhere that assigns graphical pointers and what kind of vehicle it behaves as to each one.
Title: Re: What is known about vehicles?
Post by: Pinkpuff on August 20, 2013, 06:46:54 AM
That's great news, thanks! In that case, it should be easy to incorporate into the tile editor once I get that far.

So will my "ship" appear to float above the sea like a hovercraft? That would look a little silly. Could it maybe be done with a chocobo? Although I guess then you'd have the ship flying off in random directions when you disembark which would probably be worse...  :hmm:
Title: Re: What is known about vehicles?
Post by: chillyfeez on August 20, 2013, 08:33:27 AM
I thought about that, too. I haven't gotten around to actually checking the graphics to see if there are separate sprites for the traveling and stationary hovercraft (and ship).
Also, I'm wondering whether the property of vehicles separates the raising motion from where it can travel. If it was possible to say "travel like the hovercraft but rise like the yellow chocobo," that would solve the issue. Now if we only knew where vehicle properties were stored. I'm gonna try to figure that out, but I'm not holding my breath I'll be able to find it. It's going to be such a small collection of data, so it'll probably be easy to miss...
Title: Re: What is known about vehicles?
Post by: chillyfeez on August 21, 2013, 09:52:14 AM
The byte in RAM that determines what vehicle (if any) you are traveling in is 1704. it's 00 for walking, 01 for Yellow Chocobo, 03 for Hovercraft, 04 for Enterprise, 05 for Falcon, 06 for Lunar Whale (I assume 02 for Black Chocobo, but the game wigs out if you try to change this by hand in Geiger's).
The instruction to change this to 03 in ROM (to "become" the hovercraft) begins at 2149 (I think this is where it begins).
If you change the 03 at 214B to 04, then entering the hovercraft makes you "become" the Enterprise instead, but the screen does not zoom out like if you enter the Enterprise normally. Likewise, you travel at Hovercraft speed, not Enterprise speed. However, you have Enterprise travelability, not Hovercraft travelability. Also, the game bugs out when you land because you land like the Enterprise, but you're not zoomed out on the world map.
There are definitely other instructions going on in this routine, presumably instructions that set the speed and zooming, but as I've said before, I'm not particularly good at interpreting assembly. Anybody else have any input here?
Title: Re: What is known about vehicles?
Post by: Grimoire LD on August 21, 2013, 02:03:59 PM
That is very impressive work! I will try and take a look at this and see if I can find anything to help here.
Title: Re: What is known about vehicles?
Post by: chillyfeez on August 22, 2013, 01:02:18 PM
I've figured some useful stuff out. I'm not yet at the point where I can say I've cracked vehicle data completely, but I've got the missing necessary information to turn the hovercraft into a ship.
in RAM:
The set of instructions that makes the Hovercraft take off is at 2149-2178 in ROM.
To change the height it rises, change 2176 from 04 to whatever you want (01 for best Sea Ship results).
To change the speed it travels, change 2150 from 01 to anything 00 through 03.

Other (potentially) useful information:
06AD in RAM is the Zoom level. it ranges between 10 and 31 without bugging. I have not been able to successfully change the airship takeoff instructions so that the airship flies at a different zoom, though.
06B7 in RAM is the airship's height off the ground. yes, this is separate from the hovercraft's height off the ground, and it is separate from the Zoom level, however, the airship takeoff instructions link the height and the zoom (I believe it says zoom will be height-10). At this point, though, it doesn't really matter, because I can't change the height setting in the takeoff routine.
06FD in RAM is the speed of vehicle sprite animation (propellers spinning) it can be set between 00 and 0F. I don't really care about this, but maybe someone else does.
Title: Re: What is known about vehicles?
Post by: Grimoire LD on August 22, 2013, 02:37:37 PM
That is some incredible finds there Chillyfeez! Now the boat can be made into a real vehicle, rather than the, frankly unfitting, Hovercraft.
Title: Re: What is known about vehicles?
Post by: Dragonsbrethren on August 22, 2013, 05:36:04 PM
Yeah, that's really cool! We're definitely getting to the point where the game's engine can be used to make something entirely different.
Title: Re: What is known about vehicles?
Post by: chillyfeez on August 23, 2013, 08:13:33 AM
Hmm... new problem - you can't "no dust" the hovercraft's initial launch  :bah:
 :edit: Figured it out!
Within the takeoff instructions, you have:
Code: [Select]
$00/2162 20 7A 9F    JSR $9F7A  [$00:9F7A]; jump to subroutine at 9F7A
$00/2165 20 3F 8B    JSR $8B3F  [$00:8B3F]; jump to subroutine at 8B3F
the subroutine at 9F7A is the dust animation! so, all we have to do is change the 20 7A 9F at 2162 to a repeat of 20 3F 8B, thereby skipping the dust subroutine without altering the size of the ROM (apparently, it doesn't matter if subroutine 8B3F is doubled - this seems to have no effect).
So instead, you'll have:
Code: [Select]
$00/2162 20 3F 8B    JSR $8B3F  [$00:8B3F]; jump to subroutine at 8B3F
$00/2165 20 3F 8B    JSR $8B3F  [$00:8B3F]; jump to subroutine at 8B3F
And the initial launch will not show the dust!

On the positive side, the hovercraft landing sequence was easy enough to find/fix.
The routine's at 21C6. Change 21D3 from 04 to whatever you've set the hover height to be for a smooth landing from any height.
So, if you've set the height (2176) to 18 (which will be super-high), set 21D3 to 18 as well. Voila!
 :edit: Why is this useful, you might ask? Well, if you wanted to turn the hovercraft into, say, a flying dragon a la FFV instead of a sea ship, you now have the ability to do so.

Title: Re: What is known about vehicles?
Post by: Grimoire LD on August 23, 2013, 04:04:35 PM
You have really gotten better with Geiger's Chillyfeez! Keep up the incredible work!
Title: Re: What is known about vehicles?
Post by: Pinkpuff on August 23, 2013, 06:05:41 PM
Amen! This is awesome stuff!

So I guess the next question is: this is all related to just the hovercraft right? I mean suppose someone wanted to keep the hovercraft and change something else into a ship or dragon or whatever. Can we change the properties of say, one of the chocobos or one of the airships? What if you wanted to change the Lunar Whale into the ship so that you can "go aboard"?
Title: Re: What is known about vehicles?
Post by: chillyfeez on August 23, 2013, 07:36:06 PM
The airships and the Whale are much tougher to crack. The height off the ground and the zoom on the overworld are separate values, but they are linked (as previously stated). Unfortunately, I can't find where the value is set for height in the takeoff routine, and believe me I've tried. I spent hours poring through routines and subroutines looking for that one elusive "10" that sets the airship's height... I just can't find it. Furthermore, if you change the "10" that defines the relationship between height and zoom, it just makes funkiness happen.
I wish it were possible - I mean, who needs two different airships anyway? I used to think that was silly even before ROM hacking existed...
I haven't tried chocobos because of their running away. Might be able to make a workaround for the black, but I doubt you could do much with yellow.
Title: Re: What is known about vehicles?
Post by: chillyfeez on August 24, 2013, 12:37:00 PM
Some exciting developments on the airship modification front...
Turns out the Enterprise, Falcon and Whale all have different places in RAM that store their height (06B7, 06B8 and 06B9 respectively).
As such, they each have separate takeoff/landing routines.
By taking out all instructions regarding height and zoom from the takeoff/landing routine, I've managed to (almost) successfully modify the Falcon to travel along the ground instead of rising. The only problem is that the ocean turns solid blue (instead of animated and wavy) until you enter a location, enter a battle, or takeoff in the Enterprise (in other words, when the game actually needs to reload the entire Overworld map). Once I get this kink worked out, I'll post a patch for anyone who wants it (what I'm doing is a bit more lengthy than just changing one byte like the hovercraft mod).
Unfortunately, I have to stop for today so I won't get to finishing. In case anybody is feeling industrious about this one, I'm modifying the takeoff routine at 228B (A08B-A0CC if you want to disassemble in Geiger's) and the landing routine at 27B0 (likewise A5B0-A63B). All I'm doing is taking out all commands related to Height (06B8, often just referred to as "B8") and Zoom (06AD, often just referred to as "AD"), then putting a new "60" at the end of the shortened routine and filling the newly voided space with FFs. Doing this will get you to where I am now in the process.
*whew*
Title: Re: What is known about vehicles?
Post by: chillyfeez on August 25, 2013, 07:35:51 PM
For my next trick...
A Black Chocobo that doesn't fly home!
Here's how:
There is a byte of RAM at 1715 that is set at 00 by default. Every time the Black Chocobo takes off (routine at 202B in ROM), the game checks to see if this is 01, AND the game increases this by 1. If 1715 is 01, then the game executes the fly home routine. If it's any other number, you get control of the Black Chocobo. So, I just took out the part that increases 1715 - it stays at 00, and you never have to fly home!
the ips is attached.
This essentially makes the Black Chocobo like a second Hovercraft. The height can be modified by taking similar steps. The only problem is that when the chocobo lands, the lower half of its body is always cut off, even when not in the forest. I haven't checked TLP to see if this is just programmed-in graphics, or if the game is cutting the graphics off somehow.
Title: Re: What is known about vehicles?
Post by: Grimoire LD on August 25, 2013, 10:42:49 PM
How curious. So the Black Chocobo graphic won't fully reappear. Even when it's in the air if you always set the value to 00? (A pet Black Chocobo would be great for a hack though!)
Title: Re: What is known about vehicles?
Post by: chillyfeez on August 25, 2013, 11:46:52 PM
Sorry, no, I guess I didn't explain that right...
If you change the tile properties so the chocobo can land on non-forest land, it's bottom half will still be invisible when it lands.
It's fully visible when flying.
This is really only a problem if you want to turn your chocobo into a different vehicle. It's a fully-working patch if you want a pet chocobo.
Title: Re: What is known about vehicles?
Post by: Grimoire LD on August 26, 2013, 04:37:41 AM
Hah! Very nice! I always loved the concept of the Black Chocobo, a vehicle that couldn't fly over mountains and could only land in forests. FFIV never really uses this to its full advantage unfortunately, FFV uses it to some extent though. However due to the restrictions regarding the Airship and the Black Chocobo there could be areas only one or the other could reach, hmm...
Title: Re: What is known about vehicles?
Post by: chillyfeez on August 27, 2013, 06:06:47 PM
So for the past couple of days, I became somewhat obsessed with making an airship that would rise and zoom differently than what is standard. I finally began writing my own takeoff and landing routines based on those of the Hovercraft. It was coming along nicely, but then I finally came to realize - being able to do this, while a fun little diversion and a useful exercise to learn some ASM, is not really very helpful.
You see, even if I can make the Falcon rise a few pixels off of the ground with no zoom out, I still have no idea if it's possible - and if so how - to make it's travel and landing ability different from the Highwind. So this would really only be a novelty at best.

Anyway, I decided instead to put what I've learned towards pursuits that are actually of use, and on that note, I discovered how to change the music that plays with each vehicle!
The pointers are located at 0D74 in ROM.
By default, the string reads:
Code: [Select]
0D 04 05 0D 18 18 0EThese represent the songs played while on foot, riding the Yellow Choc, the Black Choc, Hovercraft, Highwind, Falcon and Whale respectively. Just change the appropriate byte to any other value between 00 and 37 for a different song. Yes, the Highwind and falcon have separate assignments, and yes, you can have the game play different music when you're riding the hovercraft.
It should be noted that I don't know how the game handles cuing underworld and moon music when you are at those places, because OD is definitely the "Overworld" song.

Next up for me is creating a map of the world map tilesets. Having that in combination with knowledge of the tile properties will make for easy editing of where each vehicle type can travel.
Title: Re: What is known about vehicles?
Post by: Grimoire LD on August 27, 2013, 07:38:56 PM
You are making incredible strides, just a question though. Is Mythril Reinforced Aircraft a different kind of vehicle from the normal aircraft? Is going over a Lava a flag or is it considered to be a different variable of a vehicle?
Title: Re: What is known about vehicles?
Post by: Dragonsbrethren on August 27, 2013, 07:46:31 PM
(7E)1701 stores which world you're currently on, so I'd imagine something checks that and plays the appropriate track. Does changing $0D actually have any effect?

 :edit:

Ah wait, you mentioned the hovercraft music change works, so it must.
Title: Re: What is known about vehicles?
Post by: chillyfeez on August 27, 2013, 08:43:47 PM
Is Mythril Reinforced Aircraft a different kind of vehicle from the normal aircraft? Is going over a Lava a flag or is it considered to be a different variable of a vehicle?
I thought of that a day or two ago.
When I was breaking down the tile properties, I was primarily experimenting on the Overworld, but figuring that out exactly will be part of the project I'm about to undertake.
My theory - and it's only a theory - is that there is an as-yet undocumented by me property that blocks airship travel until a specific event flag is set (like the Magnes Cave flag). Event flag 39 (hex) gets set at the end of the event when Mystic Silver is added to the Falcon. So I'll play around with that when I'm messing with Underworld tiles. Part of me wonders if the Underworld might have some slightly different tile properties, since there would be no (default) need to dictate chocobo or Lunar Whale travel. I will find all of that out in good time.

Does changing $0D actually have any effect?
There are two ODs. changing the one at 0D77 changes the music while riding the hovercraft. Changing the one at 0D74 changes what music is cued when dismounting your vehicle. The "mode of transport music cue" subroutine at 0D3F is called at every mount and every dismount. It checks the value at 1704 in RAM and adds that to 0D74 ($8B74 in LoROM). So if you're on foot, your value at 1704 is 00, and it will cue the song at 0D74.
Title: Re: What is known about vehicles?
Post by: chillyfeez on August 29, 2013, 10:32:26 PM
Figured out the lava problem. Posted it to the "What is known about the Overworld" thread... sort of by mistake, but also because it's equally relevant to both topics.
http://slickproductions.org/forum/index.php?topic=1866.0
Title: Re: What is known about vehicles?
Post by: chillyfeez on August 30, 2013, 09:03:56 AM
I thought of a few more things I don't know yet about vehicles. Here's the list so far of things I'm trying to figure out:
Title: Re: What is known about vehicles?
Post by: Lenophis on August 30, 2013, 09:58:02 AM
I'm going to take a guess generalizing this. If you should cheat your way into having a different airship than the one you're supposed to have that early in the game, I believe the game will treat it as though you have the one you should. I will also guess that there is one master airship logic routine, and it simply checks to see which one of the airships you're riding at the time, and checking various event flags to see which actions are possible when. The Lunar Whale probably has its own logic routine, though I could be wrong.

Quote
could this be the purpose of Byte 1 bit 5 in tile properties that I thought was unused? it would only have to be set on (I believe) ten tiles, so it's possible I missed it when I scanned the properties data.
One way to find out. Clear that bit of tiles allowing you to go back up, and then see if you can go back up. :omg:
Title: Re: What is known about vehicles?
Post by: Dragonsbrethren on August 30, 2013, 10:51:48 AM
I'm not sure if it's relevant to the SNES version, but the GBA version actually disables the Lunar Whale's flight ability (including the crystal) when the Tower of Zot is accessible. Not all that useful in a hack following the normal progression, but interesting - I'd imagine the Falcon is the same way.

On a similar note, the GBA debug room never enables the airships to fly over magma. That includes the Enterprise, if you take it down to the underworld. The GBA version (well, WSC really) doesn't share code with the SNES version, so it's possible the behavior isn't the same as the original, but it'd surprise me if they were separate in the original but shared the flag in the remake.
Title: Re: What is known about vehicles?
Post by: chillyfeez on August 30, 2013, 02:33:57 PM
Thanks - I wasn't necessarily asking for help on figuring these things out. I was just listing the aspects of airship travel that I acknowledge I haven't cracked yet to let interested parties know I will figure them out in good time. Most of these things, I know what I am going to do to try to figure them out, it's just a matter of taking the time to do so.

Can anybody think of any other missing vehicle information not yet covered on this thread?
Title: Re: What is known about vehicles?
Post by: chillyfeez on August 31, 2013, 10:52:39 AM
Byte 1 bit 5 of tile properties is definitely unused.
Looks like I'll have to trace the routines that travel between the Overworld and Underworld to try to figure out how airships do it.
... unless there's another dual-use bit like the chocobo/lava bit...  :hmm:
Title: Re: What is known about vehicles?
Post by: chillyfeez on September 02, 2013, 10:37:59 PM
I haven't had a lot of time this weekend, but I can tell you this - only the Enterprise will fly to Zot (in the SNES version). If you have the Falcon at that time, you are still free to fly around. So even though (I think) they use the same takeoff routine, there must be a STA $1704, CMP #04 preceding the entrance to the tower.
Title: Re: What is known about vehicles?
Post by: Grimoire LD on September 03, 2013, 12:20:32 AM
Hmm, the Event Flag is 49 (30 or 31 in Hex) but I've taken a look and I've come up empty as well. There are several CMP for the Enterprise, but nothing of much value as far as I can make out.
Title: Re: What is known about vehicles?
Post by: chillyfeez on September 04, 2013, 09:28:24 AM
Ok, I got something here.
Travel between the Over- and Underworlds in an airship is preceded by a check of the x,y position. This is how the game determines whether you will change worlds. I haven't found the coordinates in the Overworld yet, but the check when you're in the underworld is at the subroutine at $9C28 (SNES address, that's 1E28 in ROM).
At 9C6F (1E6F), you have:
Code: [Select]
$00/9C6F C9 70       CMP #$70               
$00/9C71 90 14       BCC $14    [$9C87]     
$00/9C73 C9 73       CMP #$73
That C9 70 is determining the first acceptable x value to warp up, and that C9 73 is the first unacceptable x value.
Likewise, at 9C7A (1E7A), you have:
Code: [Select]
$00/9C7A C9 0F       CMP #$0F               
$00/9C7C 90 09       BCC $09    [$9C87]     
$00/9C7E C9 12       CMP #$12
0F is the first acceptable y value, and 12 is the first unacceptable y value.

I've only tried this with the Falcon so far, and of course I've only found the coordinates for the underworld, but now I know the process to get the rest of the necessary information. Gotta stop now, but I'll have the rest soon.

 :edit: Forgot to mention - the x,y coordinates of where you come up in the Overworld are also in this subroutine, so that can be modified as well. I'll post the exact address this evening.
Title: Re: What is known about vehicles?
Post by: Grimoire LD on September 04, 2013, 12:59:44 PM
I expected these to be ordinary entrances and exits, rather naive of me. Great work finding these though! To change where you can land and surface in the Underworld/Overworld will allow the modder the chance to change the landscape to a greater extent!
Title: Re: What is known about vehicles?
Post by: chillyfeez on September 05, 2013, 12:31:10 PM
Alright, here's the skinny on Overworld <--> Underworld travel...

In order to determine whether to initiate interworld travel, the game runs the subroutine at 9C28 (SNES, that's 1E28 in ROM).
It checks to see if you are in the Enterprise at 9C40 (1E40) - 04 by default.
It checks to see if you are in the Falcon at 9C44 (1E44) - 05 by default.
I say "by default," because it is possible to change which vehicles are able to travel between worlds... however, there are a few problems with doing so.
- If you change one airship to the Whale (06), then instead of decreasing/increasing height in the animation sequence, it simply disappears. It will reappear when it arrives in the new location. Also, the Overworld ocean flashes purple for a split second during the animation.
- If you change one airship to one of the chocobos (01 or 02) (in addition to the fact that you would necessarily have to change which terrains these vehicles can travel over), they are still invisible in the Underworld (I haven't figured out how, if at all possible, to change this).
- There shouldn't be much of an issue making the hovercraft (03) able to interworld travel, although you would of course have to change its travelable terrains.

After the vehicle check, the game checks for x,y coordinates.
First, a check to see if you are in the Overworld at 9C47 (you can't change this). If you are, then it checks your x location. The x min (first valid x value for interworld travel) is at 9C50 (1E50), 69 by default. The x max (first invalid value) is at 9C54 (1E54), 6C by default. If you are within this range, then it checks your y value. The y min is at 9C5B (1E5B), D3 by default. The y max is at 9C5F (1E5F), D6 by default. If you are within this range, then the game initiates the "travel down" routine. More on this later.

If you are not in the Overworld, then the game checks to see if you are in the Underworld at 9C69 (1E69). The 01 here represents the Underworld. You can change this to 02 for the Moon, in theory, but I haven't been able to successfully initiate travel to the Moon by altering this routine, so it's kind of pointless to do so. If you are in the Underworld, then your x,y is checked. x min is at 9C70 (1E70), 70 by default. x max is at 9C74 (1E74), 73 by default. y min is at 9C7B (1E7B), 0F by default. y max is at 9C7F (1E7F), 12 by default. If you are within this range, then the game initiates the "travel up" routine (read on).

The "travel down" routine is at 9315 (1515) Most of this (and it's a long routine), I believe, is graphical instruction that I don't really understand. The important part here is the instruction on the x,y location upon arrival. The arrival x value is at 9381 (1581), 71 by default. The arrival y value is at 9386 (1586), 10 by default. You probably want to set your Underworld x,y arrival values within the range of your x,y travel up values, but hey, it's your hack.
The routine also contains instructions to set 1700 and 1701 to "01." These are identifiers for the Underworld map, but they seem to not be the only ones, because changing these to 00 00 for the Overworld or 02 02 for the Moon results in a glitch world. I'm not sure I'm properly motivated to delve into this any deeper.

The "travel up" routine is at 9472 (1672). Again, we're really only concerned with arrival x,y values here. Arrival x is at 9473 (1673), 6A by default. Arrival y is at 9478 (1678), D4 by default.

In Summation:
(only ROM addresses will be used here)
Code: [Select]
Overworld -> Underworld
x min: 1E50
x max: 1E54
y min: 1E5B
y max: 1E5F
Come down at x: 1581
Come down at y: 1586

Underworld -> Overworld
x min: 1E70
x max: 1E74
y min: 1E7B
y max: 1E7F
Come up at x: 1673
Come up at y: 1678

To change which vehicles can travel:
1E40 (04)
1E44 (05)
change one of these values to 01 (Yellow Choc), 02 (Black Choc), 03 (Hovercraft) or 06 (Lunar Whale)
Title: Re: What is known about vehicles?
Post by: Grimoire LD on September 06, 2013, 10:29:26 AM
Quite a detailed synopsis. I did not think that there would be something so special in going between the two worlds. That you can take a Chocobo down there is quite intriguing. What happens though when you go with a Chocobo? Do you have to Press A in order to dismount or does it automatically go through the warping cycle when you step on the black tiles?
Title: Re: What is known about vehicles?
Post by: chillyfeez on September 06, 2013, 04:33:46 PM
To be honest, I hadn't tried it til you asked.
You press A as though you're dismounting, but the game checks for interworld travel conditions. As they are met, you warp down instead of dismounting. The warp animation is slightly glitched in the same way that it is in the Whale (ocean flashes purple for a second), plus the chocobo is invisible in the Underworld. By default, the invisible chocobo can run pretty much anywhere in the Underworld, since the hot lava bit is the same as the chocobo travel bit.
Title: Re: What is known about vehicles?
Post by: chillyfeez on September 06, 2013, 08:35:55 PM
I've been looking into whether it's possible to:
- Make a different vehicle carry the hovercraft
- Make the Enterprise carry a different vehicle

Mixed results.
The hovercraft pickup is part of the Enterprise's landing routine. It checks to see if the current x,y matches the stored x,y of the Hovercraft, then checks to see if the proper event flag is set. If so, then the crane lowers and the Hovercraft is grappled.
Now, this whole subroutine is preceded by a routine that essentially doles out instructions for what to do if you press A while in a world map, which looks like this:
Code: [Select]
$00/9C87 AD 04 17    LDA $1704  [$00:1704];Look at 1704 in RAM (mode of transport)
$00/9C8A F0 2B       BEQ $2B    [$9CB7]   ;If Zero, return
$00/9C8C C9 01       CMP #$01      ;compare with 01 (Yellow Choc)
$00/9C8E D0 03       BNE $03    [$9C93]   ;If not equal, skip to next check
$00/9C90 4C 5D 9E    JMP $9E5D  [$00:9E5D];If equal, run Yellow Choc dismount routine
$00/9C93 C9 02       CMP #$02   ;compare with 02 (Black Choc)
$00/9C95 D0 03       BNE $03    [$9C9A]   ;If not equal, skip to next check
$00/9C97 4C 02 9F    JMP $9F02  [$00:9F02];If equal, run Black Choc dismount routine
$00/9C9A C9 03       CMP #$03   ;compare with 03 (Hovercraft)
$00/9C9C D0 03       BNE $03    [$9CA1]   ;If not equal, skip to next check
$00/9C9E 4C C0 9F    JMP $9FC0  [$00:9FC0];If equal, run Hovercraft landing routine
$00/9CA1 C9 04       CMP #$04   ;compare with 04 (Enterprise)
$00/9CA3 D0 03       BNE $03    [$9CA8]   ;If not equal, skip to next check
$00/9CA5 4C ED A3    JMP $A3ED  [$00:A3ED];If equal, run Enterprise landing routine
$00/9CA8 C9 05       CMP #$05   ;compare with 05 (Falcon)
$00/9CAA D0 03       BNE $03    [$9CAF]   ;If not equal, skip to next check
$00/9CAC 4C 3C A5    JMP $A53C  [$00:A53C];If equal, run Falcon landing routine
$00/9CAF C9 06       CMP #$06   ;compare with 06 (Lunar Whale)
$00/9CB1 D0 03       BNE $03    [$9CB6]   ;If not equal, skip to end
$00/9CB3 4C C4 A5    JMP $A5C4  [$00:A5C4];If equal, run Lunar Whale landing routine
$00/9CB6 60          RTS
Now it is possible, in theory, to make the Falcon pick up the Hovercraft instead of the Enterprise by changing the 04 at 9CA2 to 05 and the 05 at 9CA9 to 04, but then you would have to switch all of the vehicle specific ram references in each landing routine to represent the correct vehicle. That would include vehicle height, stored world location, stored x position, stored y position (I think that's it). You'd have to do this both for the Falcon's and the Enterprise's landing routine, or else you'd have some crazy glitching when you try to land. You could probably do this with the Whale, too, but then you'd have to change a lot more coding.
Seems like a lot of work for not a lot of payoff...

As for the other side of the coin, carrying a different vehicle:
I can change which vehicle's location is checked from Hovercraft to anything else (except Yellow Choc - because it always runs away, the game does not store its location). This is done by changing the 19 17 at A407-8 to any other vehicle's stored x,y (15 17 for Black Choc, 21 17 for Falcon, 25 17 for Lunar Whale). Likewise, the stored location of the Hovercraft when releasing it can be changed to the stored location of any other vehicle by changing the 19 17 at A506 in the same fashion. There are still problems with these changes, though. The Hovercraft still disappears instead of whichever vehicle you are trying to pick up, and the carried vehicle still looks like the hovercraft. I haven't been able to figure out how (if possible) to "fix" these issues.

Honestly, I'm kind of running out of steam on my vehicle research. I've figured out how to change pretty much everything I really wanted to be able to edit, and it seems like everything else I find can't be edited without significant glitches. So... I think I'm gonna put vehicles to bed for now.
 :sleep:
Title: Re: What is known about vehicles?
Post by: Grimoire LD on September 08, 2013, 09:26:38 AM
You have done amazing work with this Chillyfeez, I somewhat expect the Hovercraft combined with the Airship to be a separate graphic but that's for another time I suppose. Your work with Vehicles will be of immense value down the line. Keep up the great work!
Title: Re: What is known about vehicles?
Post by: chillyfeez on April 12, 2014, 10:26:11 PM
Discovered a new little tidbit, just thought I'd link to it from here for the sake of organization.
http://slickproductions.org/forum/index.php?topic=1930.msg20765#msg20765
Title: Re: What is known about vehicles?
Post by: Bahamut ZERO on September 09, 2016, 04:43:04 PM
Since I didn't see it mentioned earlier in the thread; graphics for things like The hook, carried hovercraft, and the drill are their own separate graphics.

* The hook, once the correct flag is set, is always loaded behind the Enterprise.  I found this out the hard way while editing the graphics for the Enterprise. As long as you keep the hook short enough to stay hidden behind the airship, and long enough to not look wonky while lower to pick up/drop the hovercraft, you can edit the graphic to be whatever, like a tractor beam! Or something.

* Falcon Drill, once the correct flag is set, is always in front of the Falcon. Unlike the hook, the drill has animation frames like the airships have for their propellors. The frames can edited easily in YYCHR, only thing you have to keep in mind is having it a position to where it looks attached to the vehicle.