GUIDE Understanding the Attack file and unit animations

Moderators: Slitherine Core, BA Moderators, WH40K Armageddon moderators

Post Reply
Kerensky
Content Designer
Content Designer
Posts: 8623
Joined: Wed Jan 12, 2011 2:12 am

GUIDE Understanding the Attack file and unit animations

Post by Kerensky »

As with all modding experiences, be sure to back up any files you intend to modify. Also, sometimes the best way to learn is through example. Look at what a file does, and reverse engineer from there!

The guide is all about the attack.whdat file, located in the directory:
Warhammer 40,000 Armageddon\Graphics

Is the file that manages attack and impact animations of Warhammer Armageddon.
You can view this file in an organized fashion by opening it in Microsoft Excel, but you should not edit this file through Excel as it may cause damage to the file organization! This file is best edited through a simple text editor like Notepad or, where possible, through the game editor's built in EFX editor.

Section 1:
Image

1. The top section governs what animations are available. When you populate this list, be sure to note that entries in the third, fifth, and seventh column need to be placed in the directory:
Warhammer 40,000 Armageddon\Graphics\Animations

1A. Offset configuration here is an important, but somewhat complicated task. Basically the purpose of these offsets is to normalize weapon graphics. This way, if you happen to change them or put them on different units, they don't shift their relative location.
To set this up properly, let's look at one example. Row 13, column E and F.
anim_autocannon_E.png -83,131

Where does this come from? If you open anim_autocannon_E.png in a application such as Irfanview and draw a box from the top left corner of the image to the spot where the animation should exit a weapon barrel, you will get a set of number coordinates. This is how we tell the game engine to align this weapon visual graphic.

Image

1B. The final and unnamed column is actually for attaching an impact animation to your weapons.

Section 2:
Image

2. The next section is for impact animations. Note the first column here shares identical names with the last column mentioned in 1B. This is an important link!

2A. Entries in the third column of this section need to be placed in the directory:
Warhammer 40,000 Armageddon\Graphics\Animations

Section 3:
Image

3. The third and final section is the unit list comprised of all units in directory:
Warhammer 40,000 Armageddon\Graphics\Units
Note you must populate this list manually! You must also manual input how many weapon systems a unit has. Column A and B you must configure yourself. Look at existing units to understand how this is accomplished.

3A. For Column C through I, we have some awesome help in the form of the Editor's EFX editor! Open the game editor located in the root directory.
Warhammer 40,000 Armageddon
And select the EFX Editor from the pull down menu.

Image

3B. Once you open it, you should instantly notice it resembles the file structure you put in place in Step 3 Column A and B. You have a full list of units, and repeat entries for units with multiple weapons.
From below here, marked with a Red Arrow 1, you pick a weapon configuration that you set up in Step 1 of this document. This will fill in Column I of Step 3A for you.

Image

3C. Now looking above, marked with a Red Arrow 2, you have directional setting for each of a unit's 6 facings. Now all you do is drag the graphic around until it 'fits' with a suitable weapon the unit is wielding. You can use your mouse for fast movement, or use your keyboard arrow keys for precise movements. Once you're satisfied with this graphic alignment, repeat the process for the 5 remaining facings, hit save, and you're done!

I hope this first guide proves helpful for our modding community. Stay tuned for more guides coming out in the future!
Slobodan
Lance Corporal - Panzer IA
Lance Corporal - Panzer IA
Posts: 13
Joined: Wed Mar 04, 2015 8:50 pm

Re: GUIDE Understanding the Attack file and unit animations

Post by Slobodan »

Very good ! i hope you will make other guide soon :)
deranzo
Warhammer Designer
Warhammer Designer
Posts: 178
Joined: Wed Mar 22, 2017 12:53 pm

Re: GUIDE Understanding the Attack file and unit animations

Post by deranzo »

I created simple new unit: Hellhammer (just used Baneblade's graphic, not created new one) with unit editor and then added some missing strings in unittypes.whdat file. After that, I created some new weapons for Hellhammer called Hellhammer Anti-Armor and Hellhammer Anti-Infantry with unit editor's weapon editor and added other string in weapons.whdat file.
But if I play game just with these settings, animations don't play right. It plays like Baneblade's two cannons as Baneblade cannon and Demolisher cannon but not heavy bolter. So, I added new lines in attack.whdat file as big_cannon_shot and heavy_bolter animation and edited their animation coordinates.
When I enter game, animations still same as baneblade's two cannon shots without heavy bolter fire and they all wrong coordinated. But this not finished... I checked other units' animations and in attack.whdat file and their all coordinates turned to 0.

What must I do to correctly create new units and weapons and attach new weapons to new units?
it is a good day to die
Kerensky
Content Designer
Content Designer
Posts: 8623
Joined: Wed Jan 12, 2011 2:12 am

Re: GUIDE Understanding the Attack file and unit animations

Post by Kerensky »

Hmm... it sounds like you are stuck on section 1.

Don't bother with the top part of the ATTACK file unless you have new animation graphics.

Skip down to section 3 and add your Hell Hammer and it's 2 weapon systems to that part. Then open the EFX editor in the game editor and pick the animations you want each of these 2 attacks to look like.

Also, if your new unit is shooting line a Baneblade, then there's some link breakage occurring and it's still referencing Baneblade attack animations.

Lastly, if editing and saving the file causes everything to break, whatever program you used to edit the file probably resulted in some character contamination and ruined the whole file (hope you have a back up!)

When I worked on this, I did the initial work in a super basic text editor (notepad, though maybe notepad++ is safe I don't recall). Initial work covers all entries in Section 1, 2, and 3 in fact. Then once that foundation was in place, I switched to the in game editor and let it finish what I needed it to do.

Hope that helps!
deranzo
Warhammer Designer
Warhammer Designer
Posts: 178
Joined: Wed Mar 22, 2017 12:53 pm

Re: GUIDE Understanding the Attack file and unit animations

Post by deranzo »

Kerensky wrote:Hmm... it sounds like you are stuck on section 1.

Don't bother with the top part of the ATTACK file unless you have new animation graphics.

Skip down to section 3 and add your Hell Hammer and it's 2 weapon systems to that part. Then open the EFX editor in the game editor and pick the animations you want each of these 2 attacks to look like.

Also, if your new unit is shooting line a Baneblade, then there's some link breakage occurring and it's still referencing Baneblade attack animations.

Lastly, if editing and saving the file causes everything to break, whatever program you used to edit the file probably resulted in some character contamination and ruined the whole file (hope you have a back up!)

When I worked on this, I did the initial work in a super basic text editor (notepad, though maybe notepad++ is safe I don't recall). Initial work covers all entries in Section 1, 2, and 3 in fact. Then once that foundation was in place, I switched to the in game editor and let it finish what I needed it to do.

Hope that helps!
Thank you for your answer but i managed to solve the problem myself. I was using excel to edit attack.whdat file. Editing with notepad++ fixed the problem, now I can add/attach/edit any unit and correctly add animation of relevant weapon to unit ;)

However I have another simple question. How can I add weapon 4 to a unit? Editing .whdat files doesn't work, unit simply ignores the weapon 4 slot but fires all three weapons with correct animation and sound.
it is a good day to die
Kerensky
Content Designer
Content Designer
Posts: 8623
Joined: Wed Jan 12, 2011 2:12 am

Re: GUIDE Understanding the Attack file and unit animations

Post by Kerensky »

Glad to hear it!

As for the fourth weapon, I'm pretty sure the 4th weapon slot is not actually supported in the code. It might be there in the equipment file, but the UI and everything that makes it work was removed.
deranzo
Warhammer Designer
Warhammer Designer
Posts: 178
Joined: Wed Mar 22, 2017 12:53 pm

Re: GUIDE Understanding the Attack file and unit animations

Post by deranzo »

Kerensky wrote:Glad to hear it!

As for the fourth weapon, I'm pretty sure the 4th weapon slot is not actually supported in the code. It might be there in the equipment file, but the UI and everything that makes it work was removed.
Oh too bad...
I'm a software developer, I wish I can access codes to make it work again... Thank you anyway ;)
it is a good day to die
Post Reply

Return to “Mods and Scenario Design”