[TOPIC CHANGED] Modding the D2D version of X²

The place to discuss scripting and game modifications for X²: The Threat.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
MegaMan X
Posts: 5
Joined: Tue, 3. Feb 04, 08:29

[TOPIC CHANGED] Modding the D2D version of X²

Post by MegaMan X » Mon, 12. Dec 05, 18:48

First off: I have the Direct2Drive version of X², language is US, version 1.4
I've searched around, but wasn't able to find any help for these problems.

UPDATE: When I wrote this, I had only tried to extract files from mods. Extracting files from the game's CAT/DAT files has proved to be impossible with current extraction programs.

I hope someone can help me here.

Problems:
When I start DoubleShadow's X2 Editor, I get the following error:

Code: Select all

Error loading resources:

File c:\gamez\x2 - the threat\04.cat::t\440002.pck
Invalid size in CAT entry.

Object descriptions and names will be unavailable.
I click it away, and the rest loads fine to the best of my knowledge.
When I try to export a .pck file, I get the following error:

Code: Select all

Error opening file: Invalid size in CAT entry.
When I try to export a .BOD file, I get this error:

Code: Select all

Error opening file: Error: Invalid at the top level of the document.
Source: /========================================================================= Line: 1
When I export .pck files with Patch10, and I try to open them in the Text Resource Editor, I get this error:

Code: Select all

Error opening file: Error: Invalid at the top level of the document.
Source: 14;314; Line: 1
If I convert the .pck file to .txt, and open it up with notepad, I get this:

Code: Select all

14;314; 940;0;0.00600;0.00609;0.00999;0;3161;25000;
1500;102;1;11;373;1000;112;247;4102;4516;4607;4;3;5;4;9;
10;15;21000;21000;73;3;73;4;72;2;0;0;0;0;0;0;12;5;1;610000;
37;38;0;4;1;0;806;0;2;1;939;14;3;2;939;15;4;3;939;18;4;1;1;
1;1;1;1;708;13;981;2;2;1;2;1;2;1;708;16;981;2;3;1;3;1;3;1;
708;17;981;2;4;1;4;1;4;1;708;19;981;2;1;700000;25;1;0;SS_SH_A_TL; 940;0;0.06000;0.06000;0.03000;1;4171;11100;2664;106;1;5;
89;500;112;202;4173;4515;4097;1;2;3;0;3;16;30;500;1500;
91;2;0;0;0;0;0;0;0;0;0;0;0;4;1;20000;35;36;1;2;1;0;915;6;2;
1;939;12;2;1;0;1;1;1;0;0;0;-1;-1;1;1;2;1;1;1;944;13;-1;-1;1
;1300;25;1;0;SS_SH_A_TS; ... etc 
Now, I dunno, but that doesn't look all that good to me.. :)
When I export .jpg's from the original game's (v1.4) CAT/DAT files, I can't view them.

JPG files from Mods do extract without problems, though.
I'm also able to delete CAT/DAT entries from mods I use, without screwing up my game.

Anyway,
my conclusion is that something's going wrong during the DAT decompression.
Well.. unless it's normal that .pck files start with 14;314 in the first line.
Then there's something wrong with the editor.
I wouldn't know what I'm supposed to get, cause I keep getting these errors.

What could be wrong?
Perhaps wrong DLL files?
Anyone any ideas?

Note that I can play the game, with mods, without any problems.
All the problems I have, are basically related to exporting/viewing files.
If I'm not clear on something, ask away!

I'd really appreciate any help with this.
I'm an experienced modder, but I can't get started on X² because I don't have any working tools.
Frustrating. :)

Note: And please don't say "have you tried to reinstall everything?"
Really, that doesn't help. Ofcourse I tried that.
Might have missed some obscure DLL file though..

Edit: typo's
Last edited by MegaMan X on Tue, 20. Dec 05, 19:57, edited 2 times in total.

MegaMan X
Posts: 5
Joined: Tue, 3. Feb 04, 08:29

Post by MegaMan X » Mon, 12. Dec 05, 21:00

Could someone atleast open up a .pck file (say, Tships.pck) or it's .txt equivalent in notepad, and post the output here?
That way I'll know what I'm supposed to get, and I'll be able to make a proper diagnoses of the problem.

Thx in advance.

MegaMan X
Posts: 5
Joined: Tue, 3. Feb 04, 08:29

Post by MegaMan X » Wed, 14. Dec 05, 15:50

OK, I've got this figured out.
It seems that there are just no modding tools compatible with the Direct2Drive version of X2.
As far as I can tell, this has to do with the size difference of the .DAT files between the standard CD version,
and the downloadable version.

Still.. some things remain "odd".
For instance:

1) .pck/.txt files from mods can't be viewed with the txt editor.
2) not all files from mods can be extracted

I believe both these problems are related to the structure of the .CAT files.
It seems that all .CAT files relate to eachother somehow.
My theory is that when you try to extract/view files from mods,
the data in the .DAT file somehow gets appended to the game's .DAT files, using all the .CAT files as index/structure guidelines/whatever.
So if those files aren't the expected (vanilla) ones, things go wrong.
Well, it acts that way, and that's all that matters, really.. :)

So..
How do I get this to work the way I want it to?
I snatched the CD version of X2 from a friend of mine, and I did a few experiments with those .CAT/.DAT files.
Seems they work as expected with DS's editor, so it isn't a faulty install or anything like that.

Sadly, the lack of time right now will means I won't be able to try some things out today..

What I'm planning to do:
- first I'll see if I can get the Direct2Drive version to work with the CD's .CAT/.DAT files
- if that works, I'll try to device a way to extract/alter/repack the Direct2Drive .CAT/.DAT files,
so they resemble the CD ones.

If it all works, I'll write a tutorial about it, so people with the same problem as me can still make mods for X2.

Edit: Typo's

doubleshadow
Posts: 671
Joined: Fri, 12. Mar 04, 08:14
x3

Post by doubleshadow » Thu, 15. Dec 05, 07:56

The Direct 2 Drive is buggy imho. I've already obtained the 01.cat from d2d and took look at it. It is absolutely same as normal x2 01.cat file. But size of 01.dat is different between x2 cd version and x2 d2d. This means that either the .dat or the .cat is screwed. X2E is telling you the truth if it refuses to open some files from 01.cat. The same will do X2ModManager.

I think that the only reason why you can even play (or run) the game is because the game never access the missing/corrupted files in the 01.cat as they are overriden by files located in highest catalogs (02,03,04).

The best thing you can try is to download X3 (X3!!) ModManager and unpack the 01.cat - as soon as you get errors select Abort. Then unpack the rest of the catalogs. Then try to run the game directly on these files (either with the -r parameter or simply move the catalogs somewhere else). If it will run then it's ok. If it will not... Hell - it should work!

MegaMan X
Posts: 5
Joined: Tue, 3. Feb 04, 08:29

Post by MegaMan X » Thu, 15. Dec 05, 12:01

I already tried all possible extraction programs I could think of.
All the X2 ones and all the X3 ones.
None of them are able to extract files beyond a certain point.

The problem is that the .CAT's contain all the physical adresses of the game files in the .DAT's.
If you compare the original .CAT files with the D2D .CAT files, like you said, you can see that they're identical.
So actually, I have the original .CAT files, pointing at physical locations that don't exist within the smaller D2D .DAT files.

Basically, the .CAT files don't relate to the .DAT files anymore..
I checked, and it looks like the .DAT files are compressed.
(I'll be able to confirm this, once I've got 3Dmax 5 installed..)

Looks like GZIP to me, but I can't decompress them with winrar or the like..
I'll try the GZIP X2 tool, perhaps that'll work.

I'll post my progress.

doubleshadow
Posts: 671
Joined: Fri, 12. Mar 04, 08:14
x3

Post by doubleshadow » Thu, 15. Dec 05, 15:41

Just re-read my previous post and DO IT ;)

As you said the 01.cat is buggy - nothing on this word will extract this catalog - not even X2 (but that's not big surprise if I consider the way they handle the gzip stream...)

The point is not to try to extract that catalog w/o errors. The point is to do what your X2 is doing. Unpack what can be unpacked and then simply continue unpacking the OTHER catalogs. At the end you should have all the files you need.

If you are able to run and play the game even with the damaged 01.cat then this procedure will surely work.

Use X3 ModManager because it's the best available. You need program which will handle errors properly and properly doesn't mean "Access violation reading adress 000000:000000".

SOME files in the dat file are gzip compressed, some are not. The dat file is just a stream of files. You will fail to try it to unpack with standard programs. Btw even the gzip is not clean gzip stream. PM me if interested in details.

MegaMan X
Posts: 5
Joined: Tue, 3. Feb 04, 08:29

Post by MegaMan X » Tue, 20. Dec 05, 20:12

OK, I've PM'd DoubleShadow, and we seem to agree on this:

The .DAT's are compressed.
The .CAT's are the same as in a non-D2D game.

Yeah.. no rocketscience yet.. ;)
Still, it's important to go over this stuff bit by bit.
Especially when you start off clueless.

DoubleShadow seems to know more about data compressions than I do.
But he's gone for the holidays, so I'm on my own again to figure things out.
If there's anyone with any knowledge about (or programming experience with!) compressions, please PM me. :)

It's not that I'm in over my head or anything (I know my share of rocketscience ;)),
it's just that my mid-terms are comming up, and thus my spare time is getting rather limited.
Which means I can use all the help I get. :)

Post Reply

Return to “X²: The Threat - Scripts and Modding”