Can't unpack modded .cat files

The place to discuss scripting and game modifications for X4: Foundations.

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

Zarryc
Posts: 5
Joined: Tue, 25. Apr 23, 17:39
x4

Can't unpack modded .cat files

Post by Zarryc »

I want to modify a mod. Specifically - Classic Mode on steam. I want to remove all the changes it does to economy and only keep ship and module changes. This is for personal use only.

However, I can't extract the modded ext_01.cat files no matter what I try.

Trying to extract the files with XRCatTool.exe by using a .bat files. Here's the bat I use:

Code: Select all

C:
cd "C:\Users\-\Desktop\unpack"
XRCatTool.exe -in ext_01.cat -out "C:\Users\-\Desktop\unpack\output"
pause
It gives this error:

Code: Select all

[Load] Failed to open file C:\Users\-\Desktop\unpack\ext_01.dat
Failed reading file assets/fx/weapon/fx/macros/bullet_arg_l_laser_01_mk1_macro.xml from C:\Users\-\Desktop\unpack\ext_01.dat
Same error for each file in the .cat file. The console fills with errors like that for each file, I just didn't want to type everything.

I also tried extracting using the XRCatToolGUI.exe. It opens the file, but when I try to extract an entry simply gives a generic error: "An error occurred while extracting to folder: C:\..."

I tried the XRCatTool both from the X Rebirth website and from steam. I also tried to extract with the tool that comes with X4 Customizer.
I could try to use X4 Editor, but it requires me to extract all game files. Since I don't need them, I'm trying to troubleshoot before I attempt it.

If someone could pinpoint what I'm doing wrong it would be highly appreciated.
User avatar
Baconnaise
Posts: 764
Joined: Sat, 23. Nov 13, 15:50
x4

Re: Can't unpack modded .cat files

Post by Baconnaise »

mods/extensions need to have the "extension_" prefix from what I recall last time. Drag the file onto the executable and it should unpack into the folder with it's steamid or whatever. I bought the game on GoG initially but ended up buying it again on Steam with KE DLC since it was like 40 bucks. It's a PITA to deal with Steam Workshop heh.
User avatar
Dj_FRedy
Posts: 245
Joined: Mon, 27. Jun 11, 05:58
x4

Re: Can't unpack modded .cat files

Post by Dj_FRedy »

Don't complicate things. Create a folder, run 'XRCatToolGUI', drag 'ext_01.cat' to the content window, press the 'Extract all' button, select the previously created output folder, done.

EDIT: Maybe you need the latest version of the tool? just in case ...
https://www.egosoft.com/download/x4/bonus_en.php
"All my contributions to the Technical Support and Public Beta Feedback sections will be concise and to the point, no diatribes, that's what the other sections are for".
Thank you for your efforts.
SirNukes
Posts: 549
Joined: Sat, 31. Mar 07, 23:44
x4

Re: Can't unpack modded .cat files

Post by SirNukes »

"[Load] Failed to open file C:\Users\-\Desktop\unpack\ext_01.dat"
Cat file is just content definitions; all the actual content data is in the dat.
User avatar
euclid
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13482
Joined: Sun, 15. Feb 04, 20:12
x4

Re: Can't unpack modded .cat files

Post by euclid »

Desktop\unpack and Desktop\unpack\output looks suspicious to me. What I'm doing without any problems (see the sticky here on top of the forum) for example, to unpack the Boron DLC files:
  • In the DLC extension folder (ego_dlc_boron), create a new folder called unpacked.
  • Copy the XRCatTool.exe to the ego_dlc_boron folder.
  • Make a bat file with the following contents in the same folder (i.e. in ego_dlc_boron):

    Code: Select all

    C:
    cd "Games\Steam\SteamApps\common\X4 Foundations\extensions\ego_dlc_boron"
    XRCatTool.exe -in ext_01.cat -in ext_02.cat -in ext_03.cat -out "E:\Games\Steam\SteamApps\common\X4 Foundations\extensions\ego_dlc_boron\unpacked"
    pause
    
  • Run the bat, sit back and relax ;-)
Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
User avatar
Baconnaise
Posts: 764
Joined: Sat, 23. Nov 13, 15:50
x4

Re: Can't unpack modded .cat files

Post by Baconnaise »

SirNukes wrote: Wed, 26. Apr 23, 00:31 "[Load] Failed to open file C:\Users\-\Desktop\unpack\ext_01.dat"
Cat file is just content definitions; all the actual content data is in the dat.
Yea workshop stuff for mods is all in the dat file. I'm lost. I guess I gave bad advice.
Zarryc
Posts: 5
Joined: Tue, 25. Apr 23, 17:39
x4

Re: Can't unpack modded .cat files

Post by Zarryc »

SirNukes wrote: Wed, 26. Apr 23, 00:31 "[Load] Failed to open file C:\Users\-\Desktop\unpack\ext_01.dat"
Cat file is just content definitions; all the actual content data is in the dat.
This was it!

I only copied the .cat file to my desktop folder and tried to unpack it. I needed to copy .dat file as well. Having both files in the folder worked and unpacked the files!

I was confused, because in the .bat file I wrote I only needed to write "-in ext_01.cat", not "-in ext_01.dat", so I assumed .dat file is not needed lol.

Thank you :)

Return to “X4: Foundations - Scripts and Modding”