The Ferret is on the way
. Back to work.
Cockpit Files Part 2
No more individual chunks from this point onwards - all the other cockpit components have their own forms. A lot of the info stored inside these forms remains black magic, but I was able to prepare the high-res cockpits without delving into these things, so I doubt this will be a problem.
First up, a list of all the forms, and what they contain:
NAVP - a text-based form, shows nav point information.
BACK - the weird blue arc-like things that show up in 3Dfx (meaning that I've never actually seen them). For the high-res patch, we actually moved them beyond the edge of the screen, because they couldn't be properly adapted to hi-res without making new images, which we couldn't be bothered with.
SCFG - the fore/aft shield adjusting component.
TARO - target display (shields/armour).
DAMV - a display of your own shields and armour.
RTCL - shooting reticle.
SETS - set speed info.
CURS - current speed info.
MTMR - mission timer.
TARG - target viewcam.
DAMG - damage control (list of damaged components). Text-based, and only contains a single chunk.
OCOM - comm options, also text-based.
PWRD - power distribution diagram.
RADA - radar.
GUNP - gun capacitator.
AFBN - afterburner fuel.
ICOM - comm visuals.
GNSI - what gun(s) you have selected.
MSSI - what missile(s) you have selected.
AUTO - autopilot light.
LOCK - missile lock warning. Was a bit of a nuisance with the hi-res patch.
EJCT - eject warning.
What's missing? Decoys. They do not seem to have their own form. It seems that messing with the LOCK form also messes with the decoys, but I was never 100% certain of this.
And now, how do we change their positions?
Each component form (except MESG) has a VIEW chunk. This chunk contains four coordinates - you guessed it, top left and bottom right corners. In most cases, this is the only thing you need to edit. For text-based components, don't forget about the bottom right corner. For all others, however, the bottom right corner seems irrelevant. Even if there's only two pixels of space between the top left and bottom right corners, the game WILL display the entire image.
But this is where things get complicated. For certain components, the VIEW chunk contains the following coordinates - 0,0,640,480. A component filling up the entire screen? That would be... strange. But this isn't the case. You will generally see such coordinates in components which consist of more than one image. The best example of what is going on is the LOCK form:
Code:
FORM "LOCK"
{
CHUNK "VIEW"
{
long 0
long 0
long 640
long 480
}
FORM "QUAD"
{
FORM "HARD"
{
CHUNK "NUMR"
{
long 2
}
CHUNK "DATA"
{
long 903
float 25.0
float 170.0
float 84.0
float 29.0
float 0.06
float 0.43
float 0.38
float 0.54
}
CHUNK "DATA"
{
long 903
float 531.0
float 170.0
float 84.0
float 29.0
long 0
float 0.43
float 0.33
float 0.54
}
}
FORM "SOFT"
{
CHUNK "NUMR"
{
long 2
}
CHUNK "DATA"
{
long 953
float 25.0
float 170.0
float 84.0
float 29.0
float 0.06
float 0.43
float 0.38
float 0.54
}
CHUNK "DATA"
{
long 953
float 531.0
float 170.0
float 84.0
float 29.0
float 0.00
float 0.43
float 0.33
float 0.54
}
}
}
}
As you no doubt remember from the game, the LOCK component consists of two images, which show up on either side of the screen when somebody's got a lock on you. So, the programmers defined the VIEW chunk as taking up the entire screen, and went on to specify more precise positions inside the DATA chunks for each image.
Note that, in what I posted above, there are four DATA chunks, two in the HARD form and two in the SOFT form, containing almost the exact same data, except for the first line, which, as you may have guessed, is the number of the MAT file. So, the two forms take the same-sized part from the same coordinates in two different images (903 and 953). What is going on? I don't know. It may be that the HARD form has something with 3Dfx, but I can't check. At any rate, you when moving components around, you will need to make the same changes in both forms.
Anyway, let's take a closer look at a single DATA chunk:
Code:
CHUNK "DATA"
{
long 903
float 25.0
float 170.0
float 84.0
float 29.0
float 0.06
float 0.43
float 0.38
float 0.54
}
The next two floats are the coordinates of the top left corner of the image. These are not coordinates on a 640x480 screen (well, in this case they actually are) - they are offsets from the top left corner as defined in the VIEW chunk.
The next two numbers are the length and height of the image. I'm not sure if they are actually used by the game for anything, but they do coe in useful sometimes.
The last four numbers are interesting. These are the top left and bottom right corners of the area to be taken from the MAT file (since 903/953 contains graphics for several different components). However, instead of giving the coordinates in pixels, the programmers used percentage-based coordinates instead. Why they did so, I have no idea whatsoever.
Anyway, we're rapidly approaching the end of my knowledge. One thing that needs to be pointed out now is that some components are in sync with each other. An example of this is the GUNP, AFBN and RADA components. GUNP and AFBN components are positioned on either side of the RADA component. Of course, if you alter the graphics, this may no longer be the case.
Finally, a note about the MATs. As you know, certain MATs appear to be hardcoded.
However, so were the capship VDUs, and we got around that, by specifying a MAT number way beyond the range of the hardcoded ones (for example, our Ralari has 468 specified as its VDU image - which, taking into account the offset, ends up being 1401.MAT)
So, I would advise you to try the same method here - instead of trying to modify the existing component MATs, change the references inside the cockpit files to a different number. The game is programmed that when a cockpit requests something from 903/953, it should provide the hardcoded version instead... but if you refer to any other number, it
should simply use whatever MAT file you specify.
Well, I think that's just about all I know about cockpit files... hopefully that's all you will need.
Hey KW, since I've gone to such lengths, maybe you should take this stuff and put it up on your site as a tutorial
.