[Question] Unpacking xac files with XRConvertersMain

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

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

Post Reply
User avatar
Nerk
Posts: 732
Joined: Tue, 8. Jun 04, 23:52
x4

[Question] Unpacking xac files with XRConvertersMain

Post by Nerk » Tue, 7. Jun 22, 15:31

Hi,

I'm having some trouble getting to use the converter tool that's available from a different topic. I'm pretty sure i'm missing some small detail, but i've been scratching my head for hours and i can't seem to find a solution.

So, what i did for now is:

1 - with XRCatToolGUI opened the CoH cat files (ext_01.cat, ext_02.cat, ext_03.cat) and extracted all to a specific folder (in my case: G:\Temp\x4\Xtracted\terran)
2 - unpacked the converter tool v0.2.1 in G:\Temp\x4\converter, then from a admin-privileges CMD ran the following:

Code: Select all

G:\Temp\x4\converter>XRConvertersMain.exe importxac G:\Temp\x4\Xtracted\terran\assets\characters\terran\bodies G:\Temp\x4\Xtracted\terran\assets\characters\terran\bodies\char_pio_f_crew_uniform_01.xac
I've tried enclosing both strings with ", adding a \ at the end of the first string and just passing the file name as the second string. In every scenario the tool starts, waits a second and exits, with no output produced.

https://i.imgur.com/sBGO3q7.png

To be honest my desire is only to check out the uniform models for terrans to remove the ones i don't like, so if there's any quicker way to do so please let me know.

Thanks!
Last edited by Terre on Tue, 7. Jun 22, 18:54, edited 1 time in total.
Reason: Images posted directly to the forums should not be greater than 640x480 or 100kb, oversize image now linked

User avatar
Dj_FRedy
Posts: 230
Joined: Mon, 27. Jun 11, 05:58
x4

Re: [Question] Unpacking xac files with XRConvertersMain

Post by Dj_FRedy » Tue, 7. Jun 22, 17:20

Specifically, the file you are trying to import gives this error: 'Unrecognized chunk type 8 in file'
You can try it yourself. Create a bat file with this example:

Code: Select all

@echo off

REM Usage: XRConvertersMain <action> <folder with .dat file contents> <.xml/.xac/.dae file>
REM <action>:
  REM importxac: convert .xac to .dae
  REM importxmf: convert .xml/.xmf to .dae
  REM exportxac: convert .dae to .xac
  REM exportxmf: convert .dae to .xml/.xmf

echo Start Processing... ^[started at %time%^]
echo ______________________________
echo.
XRConvertersMain.exe importxac "my disc\unpacked" "my disc\unpacked\extensions\ego_dlc_terran\assets\characters\terran\bodies\char_pio_f_crew_uniform_01.xac"
echo ______________________________
echo.
echo All Finished...
echo ______________________________
echo.
echo Script processing has ended at ^[%time%^].
echo Press any key to exit. . .
pause>nul
Drop it in the directory of the exe 'XRConvertersMain' and run it.
"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.

User avatar
Nerk
Posts: 732
Joined: Tue, 8. Jun 04, 23:52
x4

Re: [Question] Unpacking xac files with XRConvertersMain

Post by Nerk » Tue, 7. Jun 22, 18:52

Thanks - i tried your suggestion but i'm still not seeing any change while using the bat. I'm guessing i'm putting some wrong values for where you set the two arguments

Code: Select all

"my disc\unpacked" 
and

Code: Select all

 "my disc\unpacked\extensions\ego_dlc_terran\assets\characters\terran\bodies\char_pio_f_crew_uniform_01.xac"
My bat is running the tool like this:

Code: Select all

XRConvertersMain.exe importxac "G:\Temp\x4" "G:\Temp\x4\Xtracted\terran\assets\characters\terran\bodies\char_pio_f_crew_uniform_01.xac"
I also tried passing a different file to it:

Code: Select all

XRConvertersMain.exe importxac "G:\Temp\x4" "G:\Temp\x4\Xtracted\split\assets\characters\split\bodies\split_male_body_jacket_01.xac"
https://i.imgur.com/qvW3Xan.png

While browsing through similar topics in the forum earlier I recall reading that this behavior happened when the converter can't access the files, is that correct? Is there any documentation on the exact values i'm supposed to provide as 2nd and 3rd argument?
Thanks again, and sorry for being so slow lol, i feel like i'm missing something very obvious but i can't tell what it is
Last edited by Terre on Tue, 7. Jun 22, 18:55, edited 1 time in total.
Reason: Images posted directly to the forums should not be greater than 640x480 or 100kb, oversize image now linked

User avatar
Dj_FRedy
Posts: 230
Joined: Mon, 27. Jun 11, 05:58
x4

Re: [Question] Unpacking xac files with XRConvertersMain

Post by Dj_FRedy » Tue, 7. Jun 22, 20:16

I think your problem is because you haven't unpacked all the data main. Extract all of the game's .dat files and use the path in "my disc\unpacked". I have imported from the path with all the unpacked game files without any problems.
The unpacked game is quite heavy, especially because of the audio files, you can omit these files/folders as explained in the readme of the application, XRCatTool, by EGO: : -exclude <patterns> [...]
"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.

User avatar
Nerk
Posts: 732
Joined: Tue, 8. Jun 04, 23:52
x4

Re: [Question] Unpacking xac files with XRConvertersMain

Post by Nerk » Wed, 8. Jun 22, 11:20

I tried unpacking everything again, but i'm seeing the same behavior.

I started by fully copying the install folder here, removing the space in the name:

Code: Select all

G:\Temp\x4\Xtracted\X4Foundations
Created a unpacked folder with subfolders for base and dlcs:

Code: Select all

G:\Temp\x4\Xtracted\unpacked
G:\Temp\x4\Xtracted\unpacked\base
G:\Temp\x4\Xtracted\unpacked\pirate
G:\Temp\x4\Xtracted\unpacked\terran
G:\Temp\x4\Xtracted\unpacked\split
Then ran the following script from the Xtracted folder (i've put a copy of the XRCatTool.exe in each folder for easier unpacking):

Code: Select all

G:
cd "G:\Temp\x4\Xtracted\X4Foundations"
XRCatTool.exe -in 01.cat -in 02.cat -in 03.cat -in 04.cat -in 05.cat -in 06.cat -in 07.cat -in 08.cat -in 09.cat -out "G:\Temp\x4\Xtracted\unpacked\base"

cd "G:\Temp\x4\Xtracted\X4Foundations\extensions\ego_dlc_pirate"
XRCatTool.exe -in ext_01.cat -in ext_02.cat -in ext_03.cat -out "G:\Temp\x4\Xtracted\unpacked\pirate"

cd "G:\Temp\x4\Xtracted\X4Foundations\extensions\ego_dlc_terran"
XRCatTool.exe -in ext_01.cat -in ext_02.cat -in ext_03.cat -out "G:\Temp\x4\Xtracted\unpacked\terran"

cd "G:\Temp\x4\Xtracted\X4Foundations\extensions\ego_dlc_split"
XRCatTool.exe -in ext_01.cat -in ext_02.cat -in ext_03.cat -out "G:\Temp\x4\Xtracted\unpacked\split"

pause 
Once everything has been unpacked i run the adapted bat you were suggesting:

Code: Select all

@echo off

REM Usage: XRConvertersMain <action> <folder with .dat file contents> <.xml/.xac/.dae file>
REM <action>:
  REM importxac: convert .xac to .dae
  REM importxmf: convert .xml/.xmf to .dae
  REM exportxac: convert .dae to .xac
  REM exportxmf: convert .dae to .xml/.xmf

echo Start Processing... ^[started at %time%^]
echo ______________________________
echo.
G:\Temp\x4\Xtracted\XRConvertersMain.exe importxac "G:\Temp\x4\Xtracted\unpacked" "G:\Temp\x4\Xtracted\unpacked\base\assets\characters\argon\bodies\char_arg_m_uniform_crew_01.xac"
echo ______________________________
echo.
echo All Finished...
echo ______________________________
echo.
echo Script processing has ended at ^[%time%^].
echo Press any key to exit. . .
pause>nul
but..nothing happens still. Do you have any suggestions?

Thanks for the help!

User avatar
Nerk
Posts: 732
Joined: Tue, 8. Jun 04, 23:52
x4

Re: [Question] Unpacking xac files with XRConvertersMain

Post by Nerk » Wed, 8. Jun 22, 11:34

ok, i think i got it.
The piece of the puzzle i was missing is that i needed to keep the exact folder structure for everything.

so now my paths are:

Code: Select all

for base G:\Temp\x4\Xtracted\unpacked
for the dlcs: G:\Temp\x4\Xtracted\unpacked\extensions\ego_dlc_pirate
G:\Temp\x4\Xtracted\unpacked\extensions\ego_dlc_terran
G:\Temp\x4\Xtracted\unpacked\extensions\ego_dlc_split
That way i was able to generate the dae for char_pio_m_manager_uniform_01, while other files like char_pio_f_crew_uniform_01 show the same chunk error you mentioned. Does that mean there's no unpacking for those files?

User avatar
Dj_FRedy
Posts: 230
Joined: Mon, 27. Jun 11, 05:58
x4

Re: [Question] Unpacking xac files with XRConvertersMain

Post by Dj_FRedy » Wed, 8. Jun 22, 11:45

The folder structure should be the same as EGO:

Code: Select all

base\extensions\ego_dlc_pirate
base\extensions\ego_dlc_split
base\extensions\ego_dlc_terran
Inside the 'base' folder create the 'extensions' folder and inside extensions the DLC folders. Drop as appropriate to the DLC.

EDIT: Ninja
Last edited by Dj_FRedy on Wed, 8. Jun 22, 11:56, edited 1 time in total.
"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.

User avatar
Dj_FRedy
Posts: 230
Joined: Mon, 27. Jun 11, 05:58
x4

Re: [Question] Unpacking xac files with XRConvertersMain

Post by Dj_FRedy » Wed, 8. Jun 22, 11:55

Nerk wrote:
Wed, 8. Jun 22, 11:34
Does that mean there's no unpacking for those files?
mmm sorry, I can't help you with this ... but if the script doesn't 'import' certain files it may be because of missing dependencies or some other incompatibility not covered by the code, I certainly don't know.
"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.

DeadAirRT
Posts: 1022
Joined: Fri, 25. Jan 19, 03:26
x4

Re: [Question] Unpacking xac files with XRConvertersMain

Post by DeadAirRT » Wed, 8. Jun 22, 15:23

Nerk wrote:
Wed, 8. Jun 22, 11:34
ok, i think i got it.
The piece of the puzzle i was missing is that i needed to keep the exact folder structure for everything.

so now my paths are:

Code: Select all

for base G:\Temp\x4\Xtracted\unpacked
for the dlcs: G:\Temp\x4\Xtracted\unpacked\extensions\ego_dlc_pirate
G:\Temp\x4\Xtracted\unpacked\extensions\ego_dlc_terran
G:\Temp\x4\Xtracted\unpacked\extensions\ego_dlc_split
That way i was able to generate the dae for char_pio_m_manager_uniform_01, while other files like char_pio_f_crew_uniform_01 show the same chunk error you mentioned. Does that mean there's no unpacking for those files?
Sadly the converter is extremely outdated and it's a miracle it still works at all.

User avatar
Nerk
Posts: 732
Joined: Tue, 8. Jun 04, 23:52
x4

Re: [Question] Unpacking xac files with XRConvertersMain

Post by Nerk » Wed, 8. Jun 22, 15:32

Dj_FRedy wrote:
Wed, 8. Jun 22, 11:55
mmm sorry, I can't help you with this ... but if the script doesn't 'import' certain files it may be because of missing dependencies or some other incompatibility not covered by the code, I certainly don't know.
no problem, you were already extremely helpful in figuring out what i was doing wrong. thank you!
DeadAirRT wrote:
Wed, 8. Jun 22, 15:23
Sadly the converter is extremely outdated and it's a miracle it still works at all.
so i've realized..from the CoH stuff i was able to unpack only 2 out of 10 character bodies, and all the others have the same chunk error mentioned before.
I tried checking out the converter source code available in a different thread but that's way out of my league..especially since i have no idea on how the file formats are supposed to be lol. Is anyone planning on getting that working again, or is there any other method for taking a look at NPC models?

Post Reply

Return to “X4: Foundations - Scripts and Modding”