It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
avatar
FerociousBeast: CREATING A NEW UNIT AND DETACHMENT

Creating a new unit in UNIT.DAT
In modding terms, "unit" actually refers to two separate but related things. A "unit" is the single graphical sprite, defined in UNITS.HPP, that represents a single body on the game field. Whether that body be a tank, a titan, or an individual soldier, they are all represented by a collection of files that together constitute a sprite. A "unit" is also the collection of 1-5 of these sprites into a single, commandable game unit. For example, you might create a new unit (game unit) called "Space Marine Devastators" that consists of 5 units (sprites or infantry models) of Space Marine Devastator. That's totally confusing, I know, but it's important to understand that the game sometimes uses the word unit to refer to a game unit and sometimes to a sprite. I will henceforth refer to graphical representations of bodies as "sprites" and collections of 1 or more sprites as "units" for clarity, but I wanted to make the point first.

The individual sprite is defined in these files: UNITS.HPP (which defines the "xxxx" number to be used in the following directories), SETxxxx.BIN, PAGExxxx.CEL, UNITxxxx.TGA, and UNITxxxx.TXT.

STEPS:
1.UPDATE UNITS.HPP -- Open UNITS.HPP and add a new UID and corresponding four digit number. The UID will be filled out in UNITS.TXT and used in SUPPORT.TXT, and the four digit number will be used as you make the various sprite files. Make sure both are unique, and spend a little time studying the other numbers in the file to figure out what an appropriate number would be for your unit. For example, Ork units are in the 3000 range, so it wouldn't do to make a Mega Nobz unit and assign the number 1050 to it.
2. CREATE AN ACTION SET FILE -- Go to the directory where you extracted all the SET.BIN files previously (see Getting Started>Essential modding tools and resources), copy the SETxxxx.BIN file of a similar unit to your new unit, paste it into game-dir\set, and change the number to the four digit number.
3. CREATE A CEL FILE -- Go to game-dir\cel, copy the PAGExxxx.CEL file of the unit from step 2, and change the number to the four digit number
4. CREATE THE PEDIA FILES -- Go to game-dir\pedia, copy the UNITxxxx.TGA and UNITxxxx.TXT files of the unit from step 2, and change the number to the four digit number
5. UPDATE UNITS.TXT -- Create new entry in UNITS.TXT and make sure the UID is the new one from the UNITS.HPP file. Modify the new entry as needed. (There is a lot going on here, so I will be putting additional instructions for this part in a later post.)
6. GENERATE A NEW UNIT.DAT -- Open a Command Prompt window on your computer and change directory to the folder you're storing your dev files in. Type "unit2dat unit" and press enter.

At this point, your UNIT.DAT file is ready to import into your game directory, but you won't be able to deploy any of these units in a game until you create a detachment that uses the unit. To do that, you will need to modify the SUPPORT.DAT file.

Creating a new detachment in SUPPORT.DAT
If you actually want to use your new unit in a game, you have to put it in a detachment. These are the things in the campaign that you add to those four empty boxes in the army screen. A detachment consists of one or more units, usually of the same kind, but not always.

STEPS:
1. UPDATE CID.HPP -- Just like with UNITS.HPP and creating units, this is where your new detachment will first be defined. Again, study the existing IDs to make sure that you're choosing unique values and appropriate numbers.
2. UPDATE SUPPORT.TXT -- Just like with UNITS.TXT, this is where you fill out the details of your new detachment. More instructions for modifying this are required, but for now, just copy a detachment that's similar to the one you want to build and update the CID(s), UIDs, and text values.
3. GENERATE A NEW SUPPORT.DAT -- Open a Command Prompt window on your computer and change directory to the folder you're storing your dev files in. Type "sup2dat support" and press enter.

Replacing the game's DAT files
Assuming you didn't create or modify any weapons used by your units, you're now ready to add your files to the game and try them out!

STEPS:
1. BACKUP THE DAT FOLDER -- You're going to be replacing very important files, so make sure you backup anything you don't want to lose. I personally have four different DAT folders. One called DAT which is of course required for the game, one called DAT-DEV where I store all the development work I'm doing, one called DAT-GAME which stores the mod that I'm using for my game, and one called DAT-ORIG which is a backup of the original state of the DAT folder.
2. COPY THE .DAT FILES -- When you're ready to try your mod out, just copy the UNIT.DAT and SUPPORT.DAT files you just created into the DAT folder.
3. TEST YOUR FINAL LIBERATION MOD -- Load up FL, then the quickest way to test your new unit is to start a Quick Battle and try to add the new detachment to your army.

Good luck!
Do you know why paladins cannot be selected without the cheat code? I looked at units.txt, support.txt, etc but cannot see anything that makes paladins not selectable.

And is there any way to increase the number of models in an infantry squad beyond 5?
The Yahoo groups are no more.
Is there a new place where we can get the links from?

Edit: I found some old files on my HD. I uploaded everything here:

https://drive.google.com/drive/folders/1jiuVfnae-3K8AvkRaNSG2zYzKfm8r_AE?usp=sharing

I don't remember what most of these do, and there are several WiP mods.
Post edited November 11, 2020 by Galdred
avatar
Galdred: The Yahoo groups are no more.
Is there a new place where we can get the links from?

Edit: I found some old files on my HD. I uploaded everything here:

https://drive.google.com/drive/folders/1jiuVfnae-3K8AvkRaNSG2zYzKfm8r_AE?usp=sharing

I don't remember what most of these do, and there are several WiP mods.
Thank you!
avatar
FerociousBeast: Yeah, IrfanView failed utterly in showing the CEL file. Since then I've learned a little more about CELs and I'm pretty sure they're a one-way street. TGA to CEL, and there's no way to go back again.

Which makes it really good that we have the three TGA examples that we have... Unfortunately no Titan TGAs, though.
I've worked out how a CEL works and it is not the old autoworks format.

CELs work as described in my post here: https://www.gog.com/forum/final_liberation_warhammer_epic_40000/modding_decoding_the_binary_files/page1

So it is quite possible to convert CELs back into a set of TGAs