Creating a new token from existing DCC animations
By reiyo_oki
Files needed:
AnimData.D2 (This is in D2Data.mpq which comes with D2)
animdata_edit (Available from here)
Baldur's Gate II Gibberling DCC files (Available from here)
COFEDIT (Available from here)
CV v5.2 (Available from here)
CvDcc AddOn Version v3.00 (Available from here)
Patience (not a file, I really mean patience)
Preparation:
Before we do any messing around with files, we need to decide on a few things:
- What token code will we use for our new animation?
- How many directions will this animation have?
- How many parts will our monster have?
- How many weapons/armors/shields will our monster have?
The first question is the most important. We need to find a token code that is NOT already used by Diablo II or Lord of Destruction. To do this, we will open up our web browsers and head over to the Phrozen Keep. In the Resources section there is a list of tokens used by Diablo II and Lord of Destruction. An easy way to make sure your token is unique is to use a special symbol ( ! @ # $ % ^ & * + = - and various other symbols which can be made with alt-codes)
The other questions are easy to answer, but are not relevant to this tutorial, so I won’t go into them here.
Step One: Extracting the .COF files
You will need an MPQ extractor program (winmpq, mpq2k, mpqview), and either D2Data.mpq or D2Exp.mpq.
First, start up your mpq program and open the mpq file I mentioned above. Now, find the folder “data\global\monsters\bk\cof”. In here are all the .COF files for the “Foul Crow” enemies. Extract all of these files into a folder on your computer.
Step Two: Preparing the .COF files for editing
Ok, this is where the actual editing comes in. Open up the folder where you installed COFEDIT. Copy all of the .COF files from the included package into this folder. Now, right-click on “Generate.bat” and select “Edit…”. Notepad should pop up, once it does, look at the line of text there. It should be something like:
cofedit.exe -extract bka1hth.cof
Now right-click on “Extract.bat” and select “Edit…”. Notepad should pop up, once it does, look at the line of text there. It should be something like:
@echo off
cofedit.exe -extract bktrlita1hth.cof
Copy this line for each of the .COF files that you extracted (or got from the included package.) You should end up with these lines:
@echo off
cofedit.exe -extract bka1hth.cof
cofedit.exe -extract bkddhth.cof
Ok, now if you have these lines you’re good to go. Put the word “pause” at the end of the file, in it’s own line and save. Close the window and run the batch file. You should see:
Extracting COF …
Press any key to continue …
This means that it worked. If you see:
Extracting COF …
Cannot find COF file.
Press any key to continue …
You either put the wrong names in the batch file, or didn’t copy the .COF files into the same folder as COFEDIT.
Step Three: Editing the .COF files
Open up the file bka1hth.cof.ini by double-clicking it. There are several lines in this file, some of them are unimportant to us (actually most of them). The lines we need to be concerned with are:
dcc_file (yep, you guessed it, set this to the full .dcc filename of the animation you are using)
cof_token (This is the animation token you are using, it doesn’t really matter what it is, you can just rename the file)
cof_mode (This is the mode code for the animation, you can find a list of all the modes at the end of the document.)
cof_class (This is the hit class of the animation, a full list of these is also at the end of the document.)
nb_layers (we just need to make sure this is set to 1)
trigger_frame (This is VERY important, as it causes lots of glitches if you don’t use it right. I’ll explain later)
trigger_value (This is just as important as the previous one, I will explain them together)
All you need to do is change the lines to match your animation. The first four are cheese, and self explanatory. The nb_layers one should just be set to 1.
(If editing the .ini of a non-attacking/non-casting animation, put a zero in both lines)
The last two lines, trigger_frame and trigger_value are where we need Cv5 (with the CvDCC addon). Start up Cv5 and find your .dcc in the browser. Double-click it and scroll over to where the first direction for that animation ends. There will be a number below that frame, put that number plus one into this line. So, if the first direction ended on frame 008, you would put 9 in the trigger_frame line. Now scroll down to trigger_value and put a 1 in here (I know there are other values, but I haven’t ever had any problems with just using 1).
Step Four: Recompiling the .COF files
Copy this line, and change it for each of the .COF files you extracted. In the end, you should have:
cofedit.exe -generate TTMMCCC.cof.ini
TT = Your token code
MM = Token mode
CCC = token hit class
This should be added for each of the token’s modes. Now, put “pause” (without the quotes) on its own line at the end of the .bat file and save. Run this batch file and you’re almost done!
Step Five: Extracting, editing, and recompiling AnimData.d2
Now take the file AnimData.d2 (whether it is already edited or not) and copy it into the same folder as animdata_edit. Run the extract.bat program.
Open up the .txt file created by the program in your spreadsheet program of choice and go down to the very last line. Insert a new line at this point. I would recommend just copying one of the other lines with the same mode to the new line. Put your .COF name into the first column, and the number of frames per direction in the second. The rest of the columns should be blank except for one, the trigger frame. Move the value from the existing trigger frame to the one you found earlier and put a zero where the original was.
Repeat this process for each .COF file you created. If you are putting a non-attack/non-cast animation in here (which you still have to do), just zero out any frameXX columns with anything else in them.
Once you have finished adding the new lines to this file, save and exit. Now run the compile.bat program. This will replace the AnimData.d2 that is already in this folder, so if you want to keep it, either rename or move it.
Step Six: Incorporating the plugin
This is actually the easiest part
of the process. Simply copy all of the .COF files into the data\global\monters\xx\cof folder (where xx is your token code), and
copy all of the .dcc files into the
data\global\monsters\xx\yy folder (where xx is your
token code, and yy is your monster body part). Make sure you have renamed the files to the
correct format:
AABBCCCDDEEE.dcc (ex. bktrlita1hth.dcc)
AA=Token Code
BB=Body part (See below)
CCC=Armor-Class (See below)
DD=Animation mode (See below)
EEE=Hit-Class (See below)
Now, copy your edited animdata.d2 into the data\global folder and you’re done! All that’s left now is using the token in monstats.txt
If you have any questions, post a message on the Phrozen Forums and someone will help you out (if I don’t get to the post first, that is)
Animation Modes:
A1 – Attack 1
A2 – Attack 2
TH – Throw (Most monsters don’t have this)
KK – Kick (Most monsters don’t have this)
SQ – Special sequence (like the amazon’s dodge sequence, or the paladin’s smite)
SC – Cast
S1 – Special 1
S2 – Special 2
S3 – Special 3
S4 – Special 4
GH – Get Hit
KB – Knockback (Most monsters don’t have this)
BL – Block (Most monsters don’t have this)
DD – Corpse
DT – Death
NU – Neutral
WL – Walk
RN – Run (Most monsters don’t have this)
TN – (not sure) (Only for player animations)
TW – (not sure) (Only for player animations)
Hit-Class Codes
These are for organizing different weapons used by the same
creature, most monsters only have HTH mode, but some have others.
HTH
1HS
2HS
1HT
2HT
STF
1JS
1JT
1SS
1ST
BOW
XBW
Armor-Class Codes:
You will only
need the first three codes (LIT,MED,HVY) for monsters,
the rest are player codes, or used for complex monsters.
All armors:
HVY
LIT
MED
Head:
BHM
CAP
CRN
FHL
GHM
HLM
MSK
SKP
Left hand:
HXB
LBB
LBW
LXB
SBB
SBW
Right hand:
AXE
BRN
BSD
BST
BTX
BWN
CLB
CLM
CRS
CST
DGR
DIR
FLA
FLC
GIX
GLV
GPL
GPS
GSD
HAL
HAX
HXB
JAV
LAX
LSD
LST
LXB
MAC
MAU
OPL
OPS
PAX
PIK
PIL
SCM
SCY
SPR
SSD
SST
TRI
WHM
WND
YWN