The Blood!'s GadgetMunger

GadgetMunger is a tool I created for viewing, unpacking, and repacking the CC4 graphics files.  GadgetMunger currently supports GDG file (ScrnGadg.gdg and GameGadg.gdg) and PIX files (CCImages.PIX), all of which can be found in the \Close Combat IV\Graphics directory.  I am also in the process of adding support for the AZP files for Tanks, Guns, Wrecks, and Shadows.  Currently you can view these AZP files, but extract and rebuild will not work.   Obligatory disclaimer: messing with CC4 files could crash the game.  This is a home-brewed utility that is in no way endorsed or supported by the makers of Close Combat 4. I make no claims about the safety of hacking these files. Use at your own risk  Feel free to send bug reports / comments via email .

Download GadgetMunger.exe

Notes on using GadgetMunger:

GadgetMunger is written using Microsoft Visual Basic 6.0, so you'll need the VB6 runtime DLL if you don't have it on your machine already. Most Windows machines do. You will also need COMDLG32.OCX (a common dialog box control). Both files go in the \Windows\System directory.  Also, to register COMDLG32.OCX, run the command "regsvr32 COMDLG32.OCX".

Extracting GDGs: When you extract a GDG file, you'll end up with many, many TGA files in the current directory.  The files are named for the entry name and image index (i.e. BGUNIT_001.TGA, etc).  The tool also saves some GDG file structure info to a file named EXTRACT.DAT; do not delete or edit this file, or the rebuild won't work correctly.

Rebuilding GDGs: When you rebuild, GadgetMunger expects to find EXTRACT.DAT and all the TGA files in the current directory (usually will be the case if you've just opened a GDG file you're working on). The tool will handle adding new images to a given entry, as long as they follow the file name format (so if you extract an entry named BCCAMP with four images, you'll get BCCAMP_000.TGA through BCCAMP_003.TGA.  To add an image, name your new file BCCAMP_004.TGA and the tool will suck it in when you rebuild).  Make sure custom TGA files are saved as 16-bit TGAs, and flip the image vertically before saving, as CC4 assumes a lower-left origin for these graphics.

The CCImages.PIX file works similarly, although the 'data' file will be CCIMAGES.PIX.DAT rather then REBUILD.DAT.

Credits

A big "thank you" and credit due to all the Close Combat mod-writers out there. Much of the information I needed to write GadgetMunger had already been discovered by these folks, including Cappy-R, Sgt. Wilson, Cpl. Filth, Mick (xe-5), and others.