Hex edit question re: shadows.zfx
Select messages from
# through # Forum FAQ
[/[Print]\]

Close Combat Series -> Modding Workshop

#1: Hex edit question re: shadows.zfx Author: GameRat PostPosted: Sun Dec 18, 2005 5:28 am
    —
Hi,
In regards to the text taken from Zonbie's read-me file:

When Zonbie refers to "Paste that hex info into the appropriate slot in the temp file" ... how are you able to determine where that appropriate slot is?
It seems that after you edit a nsd/zsd file and repack it back into the shadows.zfx ... the file size of the edited file ends up being 0 kb, and therefore the game will crash. By entering in the appropriate hex data into the right place with a hex editor corrects the problem.
Trouble is I can't locate where to enter the data back into the Shadows.zfx from within the hex editor. Lenght size data F4BB for g88mmAT.nsd.

Thanks for any help with this.... David

SHADOW EDITING
CLOSE COMBAT III: THE RUSSIAN FRONT

TOOLS YOU NEED
Zfx utility at http://members.xoom.com/CloseCombat/
A hex editor, such as Hex Workshop from http://www.bpsoft.com

INTRO
This file explains how to replace vehicle shadows in CC3 using other vehicle shadows already in the game. This will sound complicated, but it's really quite easy once you get the idea. It helps if you know something about hex editing, but if not you should get by OK.

All the zoom and normal shadows for vehicles are in shadows.zfx, and the zfx tool extracts them to a folder called 'shadows'. The shadows are named according to the vehicle graphics they are married with - i.e. shadows rT34l.nsd (normal view) and rT34l.zsd (zoom) go with the rT34l tank graphics.

Once the zfx tool extracts all these shadows, you can copy them, rename them (using only existing shadow names), then pop them back into the shadows folder to give a vehicle a new shadow.

But, when repacking the shadows to shadows.zfx, the zfx tool fails to write the header information for the size of the shadow files. This can be fixed with a hex editor.

INSTRUCTIONS
Open an unedited shadows.zfx file with a hex editor. Select the data between decimal offsets 10204 and 12602. Save this block of data as a new file somewhere. Call it anything you want. It's just a temporary file. For this instruction, assume it's called temp file.

Extract shadows.zfx with the zfx tool. Go into the shadows folder, then copy the zoom and normal views you want to apply to a new vehicle. Rename them and reinsert them into the shadows folder. Start with just one shadow set (zoom and normal).

Run zfx tool to repack shadows.zfx. Now, this new file is missing that important information that tells the game the size of all the shadows. You thought ahead, however, and saved the info and put it aside as a temporary file (temp file), but before you pop it into shadows.zfx, you have to make an adjustment for the shadows you added.

Open a DOS window and go to the directory with your new shadows.zfx. Run this command "zfx shadows.zfx>shadows.txt". Then go back to Windows and open the shadows.txt file you just created. The file lists all the shadow names, their offsets and size (the key info here, in bytes). You can get the same size info by right clicking on the files in the shadows folder for their properties, but you need the text file anyway.

In shadows.txt, find the names of the zoom and normal view shadows you just altered, and note the index numbers. Zoom versions of each shadow always follow the normal view. Multiply both these numbers (separately) by four. These are the decimal offsets where you will find the shadow file size entries for your new shadows in the temp file. (Except the entries are incorrect at the moment.)

With me? Good. Almost done...

Crack open the base converter in your hex editor. Go back to shadows.txt and copy the file size (length) information for the first of the two shadow files (normal) you altered. Paste that info into the decimal window in the base converter, and that will create a hex entry such as 4E45. Paste that hex info into the appropriate slot in the temp file (the normal view entry you found by multiplying by four). But transpose the new hex entry values; if you got 4E45, input 454E. Repeat for the zoom shadow.

When done, copy the whole temporary file and paste into shadows.zfx again by using the same offsets you used to start the whole process off (10204 and 12602).

That's it! If there are no crashes when you play the game, you did it all right. Make sure you zoom into the vehicle that gets the new shadows, then go back to normal view. This is often the action that causes a crash if the hex editing has gone wrong!

Any questions?
contact Zonbie

#2:  Author: zon PostPosted: Sun Dec 25, 2005 3:24 am
    —
I think you use shadows.txt to find your slot.

Isn't there a tool that makes this method obsolete?

#3:  Author: MafiLocation: Germany PostPosted: Mon Jan 09, 2006 10:57 am
    —
zon wrote:
I think you use shadows.txt to find your slot.

Isn't there a tool that makes this method obsolete?


I'm not really sure. I posted this in December at Ryan's:

Concerning CC3's ZFX files:
does anyone know more about the 2400 bytes after the offset table??

Starting from 10204 to 12604 there are 2400 bytes of unknown purpose. For expanding functionality of my CC2Spriter it would be great to know:

- what is in this 2400 bytes
- does TinTin's ZFX-tool reproduces these bytes by code or does it ignore them when repacking, filling up with whatever else?
- anyone any experiences what happen when changing these bytes?

I found that ZFX tool stopped after extracting 36 files out of Shadows.zfx. Anyone else any idea why? Anyone ever tried to extract Shadows.zfx? CC2Spriter extract all the files. New tool version is planned to repack Shadows.zfx.



...
Now I think I must rework my CC2Spriter again. Will take a look if we can solve the secrets of the ZFX file format. ANY HELP IS NEEDED!

Mafi

#4: ZFX file format Author: MafiLocation: Germany PostPosted: Mon Jan 09, 2006 12:01 pm
    —
okay, I think its a file size table filled up with garbage data to cionfuse modders. Any one out there who think that any details can be provided ? As far as investigated now, the ZFX file format is:

// header
LongInt; // number of entries
array(600) of Char(13); // 600 ASCIIZ strings of DOS format 8.3
array(600) of LongInt; // 600 file offsets
array(600) of LongInt; // 600 file sizes
// datas
plain file datas concatenated without gaps

IF I'M WRONG, please let me know. New version of CC2Spriter will be tested soon. Any CC3 modder outthere who can make the testing ?? Please let me know!

Mafi

#5: CC2Spriter updated again Author: MafiLocation: Germany PostPosted: Wed Jan 11, 2006 5:59 pm
    —
Hi Folks,

CC2Spriter updated to handle wrong encoded ZFXs: v2.8.2 is online at my site.

Sorry for the inconvienience. And perhaps more is possible if I will find the time to investigate *.fx files.

Mafi



Close Combat Series -> Modding Workshop


output generated using printer-friendly topic mod. All times are GMT

Page 1 of 1