Gagonite
Irishman
- Joined
- Nov 6, 2005
- Messages
- 208
Hey everyone, as per requested, here’s the tutorial on not only getting units to use other units’ animations in addition to their own, but also to have various weapons and accessories visible in some animations, while invisible in others.
An example of this that’s already in the game is the Longbowman. During most of his animations, his melee weapon – a staff – is invisible to the player, while his ranged weapon – the longbow – is visible. However, during his various Melee animations (StrikeA, HurtA, DieA, etc), the longbow disappears while his staff comes into view. Now, it’s a relatively simple process to recreate this for other units. Simple, but repetitive, since you essentially need to modify the same things for every animation that the weapons/accessories need to be seen or not seen in.
First off however, there are a few things you need to get started.
- The file(s) with the textures, animations, and .nif files that you want to use.
- Nifskope (Nifviewer probably works too, however this Tutorial is using Nifskope)
- KonverterFM
- PakBuild
- Patience and the will to succeed!
Alright, there we have it. Not a long list, as the process isn’t hard or complex.
For the tutorial, I will be making the Modern Worker unit have a Redcoat-style combat animation using the Marine’s weapon, in addition to his usual worker animations.
First, unpack the various .pak files in the Vanilla folder, usually to a folder on your desktop for this purpose.
Then, locate the Redcoat and Modernworker files, and copy them to your desktop. After that, create a new folder named for whatever your new unit is going to be, in this case I will name my folder “Combat Engineer”. Put both the Redcoat and Modernworker files in the folder. This allows easy access to the files you need without having to dig around in the unpacked files.
The next step is to merge the .kfm files of the Worker and Redcoat .kfm. Note: I won’t be listing the exact steps of merging the .kfm files, there is another tutorial on that, so I’ll list what’s only needed for this tutorial. Of course, you don’t want every animation for both, there is a select few you’ll need. Here are the ones you’ll want to copy from the Redcoat file:
- HurtA
- RangedFortify
- RangedIdle
- RangedStrike
- RangedDieA
- RangedDieB
The two RangedDieX_Fade animations are optional and are there if you want your unit to fade away after he dies. I usually don’t put those in, but it’s a choice of preference.
Copy those six animations and paste them into your .kfm file that’ll be the new one. I usually copy the Worker .kfm file, rename it CombatEngineer, and use that one. Also, I’d recommend deleting the ‘Surrender’ animation in that file. One last thing to do in the new .kfm file is at the top, change the associated nif file to whatever you will be naming your new nif file, in this case CombatEngineer.nif.
Now that your new .kfm file is complete, we need to get all the associated .kf files into the folder with the .kfm file. We will also need the .dds files. Just copy every file from the Worker file (With the exception of the .kfm file, unless you used it for the new animations) and paste them into the folder where your CombatEngineer stuff will go. Also, rename the .nif of the Worker to your new unit, in this case CombatEngineer. Now, copy the .kf files that are for each of the Redcoat animations, as well as the .dds file and paste them into your Combat Engineer folder.
Here’s where the fun begins. Open up your new CombatEngineer .nif file and left click once on the Engineer’s body. Then look at the left and look for a BIP or Bip01 tree.
In this case, the worker’s skeleton is named BIP. All associated body parts will begin with that name. Now, we need to see what skeleton the Redcoat animations use, so open up any of the Redcoat .kf files. In this case I’ll be opening up the RangedStrike one. Once you do that, click on NiControllerSequence, then go down to the bottom and expand the Controlled Blocks tree.
Once expanded, you’ll see a bunch of BIP body parts. Good, this means we don’t have to change all of the body parts’ names. Sometimes, you’ll encounter that animation files using Bip01 skeletons, which means, if your .nif file has a BIP skeleton, you’ll need to rename every Bip01 in the .kf to BIP. More on how to rename them later.
Luckily, since these are already named correctly, the animation files of the Redcoat should work well with the Worker’s skeleton. To make sure it does, go to your CombatEngineer.nif file and up at the top click on Spells -> Animation -> Attach .KF. Or you can go there by right clicking anywhere and doing the same thing.
Once there, choose one of the Redcoat animations. I chose RangedStrike. Load that one. You should see a small window open up that says the following:
That’s not a problem unless theres a skeleton piece (such as Bip01 Head) or something of that sort in it. Also, look at your Worker in the NifSkope. He’s probably in some sort of pose that you’ll recognize as one of the Redcoat’s.
As you can see by my worker, he’s looking like he’s holding up a rifle, albeit there’s no rifle. No worries, at least we know the animation works properly. Reload the .nif file, it can get a bit messy if you save the .nif with the .kf in it. It’s not fatal to what yer doing, but it’s just best to keep things clean.
Alright, now here’s the part most of you’ve been waiting for. The weapons. We’ll only be using one weapon in this tutorial (The Marine’s rifle), but it works the same for as many weapons as you want. First off, we need to retrieve the rifle from the Marines.nif. Find the unpacked file and open the .nif. Once there, click on his rifle.
As you can see, the Clip of the Rifle isn’t actually part of the rifle. No worries. Instead of copying just the rifle, we need to copy the entire NiNode that contains the Rifle, it’s shooting effect, and the clip. Go to the NiNode and right click, then go to Block and Copy Branch. Make sure you copy the branch, not just the NiNode, else you’ll miss most of the stuff.
Once that’s completed, go to your CombatEngineer.nif and go Copy Branch it somewhere under the current trees. It’ll look like this once complete:
As you can see, the rifle is there, but it’s untextured. It’s because we don’t have the proper .dds file in the Combat Engineer folder. It’s a simple fix. First save and close your CombatEngineer.nif. Then copy-paste the two .dds files in the Marine folder to your Combat Engineer folder. Reopen the CombatEngineer.nif. Vuala, it’s textured.
Alright, now we need to attach it to the Worker’s right hand and position it correctly. You’ll also probably notice that I forgot to re-open my .nif file, and accidently saved the redcoat’s RangedStrike.kf with it. It’s not a huge deal, it won’t hurt anything, just kind of annoying.
So, in order to attach the gun to his hand, we need to find his Right hand’s bone.
As you can see, its deep in the forest of sub-trees. Once found, click on it (No real need to open it’s tree) and down at the bottom you’ll notice it allows 6 children, all of which are filled with various tools.
Double click on where the 6 is, and raise it to 7. Then, click on the little green refresh button, now he has 7 slots available, one of which is open for his new rifle. Double click on where it says “None” and type in the number of the NiNode that corresponds to the AK-47. In this case, the number is 154.
You’ll notice the rifle moves into some weird off place. Find the section of the Rifle where it allows you to change it’s rotation and position and fiddle around with it until it looks good on his hand. Note: Make sure you adjust the rotation/position of the entire Node, not just the rifle, else the clip and gun-blast will be separate. After trying it out, here are the coordinates I found useful.
Rotation (In Euler) Y: -45 P: 0 R: 35
Translation: X: 10 Y: 5 Z: 0
You may change it as you prefer of course, this is just what I got. Here’s what it looks like: (Remember mine’s saved with the .kf file by mistake)
It’s a bit hard to see in the jumble of tools, but it’s there. Now that the gun is there, as it is, it’ll be there 100% of the time during all of the Worker’s animations in-game. We can’t have that now can we? In actuality we’ll need to modify nearly every animation to state when it needs to be visible and invisible. However, in this tutorial, I’ll only be demonstrating changing one of the .kf files. It’s the same thing for all of the others.
Before you go on, save the CombatEngineer.nif.
Alright, first we need an NiVisController in the NiNode containing the AK-47. Luckily for us, there are plenty attached to the various tools. Open up one of the tools’ NiNodes, and you’ll see three more tabs. One of which is a flag, followed by the words NiVisController. That’s what we want. Right click on it and COPY. Don’t bother with Copy Branch for this one.
Once that’s done, paste it somewhere below the rest of the trees, then click on it. Find where it says “Target”, and enter the number of the AK-47’s NiNode, which is 114. Seems as if it changed from when we first copied it over. No worries, but make sure you check that in future cases.
Next, Click on the AK-47’s NiNode and locate where it says “Controller”. Type in the number of the copied NiVisController, in this case it’s 169. Ok, now the NiVisController is attached to the weapon and it’s parts. Save the .nif.
Now, go to your Combat Engineer foldier and locate the Modernworker_MD_Idle.kf file. Open it. The place where the worker normally is, is blank. That’s supposed to be like that, though I don’t know why. Click on the tree that is named NiControllerSequence. Also expand it, but don’t un-click it. At the bottom, you’ll notice there are two tabs named “Num Controlled Blocks” and “Controlled Blocks”. These are much like the Children of the .nif. Raise the number of Num Controlled Blocks by 1, to 38, then click the refresh button.
Once done, expand the “Controlled Blocks” tree and go down to the bottom of it where there is an <empty> spot. This is where our rifle goes. Expand the <empty> tree. There are a measily 4 things we need to modify here and then we’re done with this .kf file.
First off, go back up to the top where you first expanded the NiControllerSequence tree. If you haven’t already, expand that tree, then look for one of the many NiBoolInterpolator tabs. Each of these control the visibility of an item. They all have values, either No or Yes. Yes means this object is visible during this animation, No means it isn’t. Copy one of the ones that has a No value, and paste it below the tree. Keep a tab on it’s name. Also, you can change the value if you wish by merely double clicking on the Yes or No and it will change to the other one.
In my case, the new NiBoolInterpolator’s number is 55. Now, go back to the <Empty> slot where we were before. First click on Interpolator and change the Value to the number of the associated NiBoolInterpolator, in this case 55. Then go to the String Palette and change it to 3. You’ll find the number for the String Palette in the main branch of the NiControllerSequence tree. Then, go down to Node Name Offset and click on the little TXT button. Type in the NiNode name from the .nif file of the name of the object that you want it to effect. In this case, our rifle’s NiNode is AK47_Marine. BE WARNED, you MUST spell it PERFECTLY in order for it to work. Capitalization IS required where it’s needed as well.
The last thing you need to do is go to Controller Type Offset, click the little TXT button, and type in NiVisController. Save the .kf file.
Guess what? Yer done! Well, at least with this animation file. If you load the unit using it’s new unique .kfm file in a mod, you’ll notice that his gun won’t appear. In order for it to appear, you will need to do these same steps on one of the attack animations and make it appear.
Also, a word of note from something I’ve noticed. Objects that have visibility controllers on certain animations, but not others, will retain the visibility status of the last animation that DID have the controller. That’s why our rifle doesn’t appear yet. Now, if you modified one more file, the Rangedstrike file and made it so the weapon would show up there, the weapon would continue to stay in his hand until he did a new Idle animation. Using this tactic, you can sometimes forgo modifying an animation file, provided if the item you don’t (or do) want appearing won’t be in an animation right before the animation file that doesn’t have a controller for it.
So there you have it! A tutorial on how to make weapons appear and disappear for particular animations. Using this method I made the Welsh Longbowman, who uses a spear-attack instead of a staff attack, and the Landsknecht Arquebusier, a musketman who uses a Light Swordsman melee attack. I’ll be finishing up this Worker sometime as well… I may even give him a melee attack as well.
Hope this works for you guys!
An example of this that’s already in the game is the Longbowman. During most of his animations, his melee weapon – a staff – is invisible to the player, while his ranged weapon – the longbow – is visible. However, during his various Melee animations (StrikeA, HurtA, DieA, etc), the longbow disappears while his staff comes into view. Now, it’s a relatively simple process to recreate this for other units. Simple, but repetitive, since you essentially need to modify the same things for every animation that the weapons/accessories need to be seen or not seen in.
First off however, there are a few things you need to get started.
- The file(s) with the textures, animations, and .nif files that you want to use.
- Nifskope (Nifviewer probably works too, however this Tutorial is using Nifskope)
- KonverterFM
- PakBuild
- Patience and the will to succeed!
Alright, there we have it. Not a long list, as the process isn’t hard or complex.
For the tutorial, I will be making the Modern Worker unit have a Redcoat-style combat animation using the Marine’s weapon, in addition to his usual worker animations.
First, unpack the various .pak files in the Vanilla folder, usually to a folder on your desktop for this purpose.
Then, locate the Redcoat and Modernworker files, and copy them to your desktop. After that, create a new folder named for whatever your new unit is going to be, in this case I will name my folder “Combat Engineer”. Put both the Redcoat and Modernworker files in the folder. This allows easy access to the files you need without having to dig around in the unpacked files.
The next step is to merge the .kfm files of the Worker and Redcoat .kfm. Note: I won’t be listing the exact steps of merging the .kfm files, there is another tutorial on that, so I’ll list what’s only needed for this tutorial. Of course, you don’t want every animation for both, there is a select few you’ll need. Here are the ones you’ll want to copy from the Redcoat file:
- HurtA
- RangedFortify
- RangedIdle
- RangedStrike
- RangedDieA
- RangedDieB
The two RangedDieX_Fade animations are optional and are there if you want your unit to fade away after he dies. I usually don’t put those in, but it’s a choice of preference.
Copy those six animations and paste them into your .kfm file that’ll be the new one. I usually copy the Worker .kfm file, rename it CombatEngineer, and use that one. Also, I’d recommend deleting the ‘Surrender’ animation in that file. One last thing to do in the new .kfm file is at the top, change the associated nif file to whatever you will be naming your new nif file, in this case CombatEngineer.nif.
Now that your new .kfm file is complete, we need to get all the associated .kf files into the folder with the .kfm file. We will also need the .dds files. Just copy every file from the Worker file (With the exception of the .kfm file, unless you used it for the new animations) and paste them into the folder where your CombatEngineer stuff will go. Also, rename the .nif of the Worker to your new unit, in this case CombatEngineer. Now, copy the .kf files that are for each of the Redcoat animations, as well as the .dds file and paste them into your Combat Engineer folder.
Here’s where the fun begins. Open up your new CombatEngineer .nif file and left click once on the Engineer’s body. Then look at the left and look for a BIP or Bip01 tree.

In this case, the worker’s skeleton is named BIP. All associated body parts will begin with that name. Now, we need to see what skeleton the Redcoat animations use, so open up any of the Redcoat .kf files. In this case I’ll be opening up the RangedStrike one. Once you do that, click on NiControllerSequence, then go down to the bottom and expand the Controlled Blocks tree.

Once expanded, you’ll see a bunch of BIP body parts. Good, this means we don’t have to change all of the body parts’ names. Sometimes, you’ll encounter that animation files using Bip01 skeletons, which means, if your .nif file has a BIP skeleton, you’ll need to rename every Bip01 in the .kf to BIP. More on how to rename them later.
Luckily, since these are already named correctly, the animation files of the Redcoat should work well with the Worker’s skeleton. To make sure it does, go to your CombatEngineer.nif file and up at the top click on Spells -> Animation -> Attach .KF. Or you can go there by right clicking anywhere and doing the same thing.

Once there, choose one of the Redcoat animations. I chose RangedStrike. Load that one. You should see a small window open up that says the following:

That’s not a problem unless theres a skeleton piece (such as Bip01 Head) or something of that sort in it. Also, look at your Worker in the NifSkope. He’s probably in some sort of pose that you’ll recognize as one of the Redcoat’s.

As you can see by my worker, he’s looking like he’s holding up a rifle, albeit there’s no rifle. No worries, at least we know the animation works properly. Reload the .nif file, it can get a bit messy if you save the .nif with the .kf in it. It’s not fatal to what yer doing, but it’s just best to keep things clean.
Alright, now here’s the part most of you’ve been waiting for. The weapons. We’ll only be using one weapon in this tutorial (The Marine’s rifle), but it works the same for as many weapons as you want. First off, we need to retrieve the rifle from the Marines.nif. Find the unpacked file and open the .nif. Once there, click on his rifle.

As you can see, the Clip of the Rifle isn’t actually part of the rifle. No worries. Instead of copying just the rifle, we need to copy the entire NiNode that contains the Rifle, it’s shooting effect, and the clip. Go to the NiNode and right click, then go to Block and Copy Branch. Make sure you copy the branch, not just the NiNode, else you’ll miss most of the stuff.

Once that’s completed, go to your CombatEngineer.nif and go Copy Branch it somewhere under the current trees. It’ll look like this once complete:

As you can see, the rifle is there, but it’s untextured. It’s because we don’t have the proper .dds file in the Combat Engineer folder. It’s a simple fix. First save and close your CombatEngineer.nif. Then copy-paste the two .dds files in the Marine folder to your Combat Engineer folder. Reopen the CombatEngineer.nif. Vuala, it’s textured.

Alright, now we need to attach it to the Worker’s right hand and position it correctly. You’ll also probably notice that I forgot to re-open my .nif file, and accidently saved the redcoat’s RangedStrike.kf with it. It’s not a huge deal, it won’t hurt anything, just kind of annoying.
So, in order to attach the gun to his hand, we need to find his Right hand’s bone.

As you can see, its deep in the forest of sub-trees. Once found, click on it (No real need to open it’s tree) and down at the bottom you’ll notice it allows 6 children, all of which are filled with various tools.

Double click on where the 6 is, and raise it to 7. Then, click on the little green refresh button, now he has 7 slots available, one of which is open for his new rifle. Double click on where it says “None” and type in the number of the NiNode that corresponds to the AK-47. In this case, the number is 154.

You’ll notice the rifle moves into some weird off place. Find the section of the Rifle where it allows you to change it’s rotation and position and fiddle around with it until it looks good on his hand. Note: Make sure you adjust the rotation/position of the entire Node, not just the rifle, else the clip and gun-blast will be separate. After trying it out, here are the coordinates I found useful.
Rotation (In Euler) Y: -45 P: 0 R: 35
Translation: X: 10 Y: 5 Z: 0
You may change it as you prefer of course, this is just what I got. Here’s what it looks like: (Remember mine’s saved with the .kf file by mistake)

It’s a bit hard to see in the jumble of tools, but it’s there. Now that the gun is there, as it is, it’ll be there 100% of the time during all of the Worker’s animations in-game. We can’t have that now can we? In actuality we’ll need to modify nearly every animation to state when it needs to be visible and invisible. However, in this tutorial, I’ll only be demonstrating changing one of the .kf files. It’s the same thing for all of the others.
Before you go on, save the CombatEngineer.nif.
Alright, first we need an NiVisController in the NiNode containing the AK-47. Luckily for us, there are plenty attached to the various tools. Open up one of the tools’ NiNodes, and you’ll see three more tabs. One of which is a flag, followed by the words NiVisController. That’s what we want. Right click on it and COPY. Don’t bother with Copy Branch for this one.

Once that’s done, paste it somewhere below the rest of the trees, then click on it. Find where it says “Target”, and enter the number of the AK-47’s NiNode, which is 114. Seems as if it changed from when we first copied it over. No worries, but make sure you check that in future cases.
Next, Click on the AK-47’s NiNode and locate where it says “Controller”. Type in the number of the copied NiVisController, in this case it’s 169. Ok, now the NiVisController is attached to the weapon and it’s parts. Save the .nif.
Now, go to your Combat Engineer foldier and locate the Modernworker_MD_Idle.kf file. Open it. The place where the worker normally is, is blank. That’s supposed to be like that, though I don’t know why. Click on the tree that is named NiControllerSequence. Also expand it, but don’t un-click it. At the bottom, you’ll notice there are two tabs named “Num Controlled Blocks” and “Controlled Blocks”. These are much like the Children of the .nif. Raise the number of Num Controlled Blocks by 1, to 38, then click the refresh button.

Once done, expand the “Controlled Blocks” tree and go down to the bottom of it where there is an <empty> spot. This is where our rifle goes. Expand the <empty> tree. There are a measily 4 things we need to modify here and then we’re done with this .kf file.
First off, go back up to the top where you first expanded the NiControllerSequence tree. If you haven’t already, expand that tree, then look for one of the many NiBoolInterpolator tabs. Each of these control the visibility of an item. They all have values, either No or Yes. Yes means this object is visible during this animation, No means it isn’t. Copy one of the ones that has a No value, and paste it below the tree. Keep a tab on it’s name. Also, you can change the value if you wish by merely double clicking on the Yes or No and it will change to the other one.
In my case, the new NiBoolInterpolator’s number is 55. Now, go back to the <Empty> slot where we were before. First click on Interpolator and change the Value to the number of the associated NiBoolInterpolator, in this case 55. Then go to the String Palette and change it to 3. You’ll find the number for the String Palette in the main branch of the NiControllerSequence tree. Then, go down to Node Name Offset and click on the little TXT button. Type in the NiNode name from the .nif file of the name of the object that you want it to effect. In this case, our rifle’s NiNode is AK47_Marine. BE WARNED, you MUST spell it PERFECTLY in order for it to work. Capitalization IS required where it’s needed as well.
The last thing you need to do is go to Controller Type Offset, click the little TXT button, and type in NiVisController. Save the .kf file.

Guess what? Yer done! Well, at least with this animation file. If you load the unit using it’s new unique .kfm file in a mod, you’ll notice that his gun won’t appear. In order for it to appear, you will need to do these same steps on one of the attack animations and make it appear.
Also, a word of note from something I’ve noticed. Objects that have visibility controllers on certain animations, but not others, will retain the visibility status of the last animation that DID have the controller. That’s why our rifle doesn’t appear yet. Now, if you modified one more file, the Rangedstrike file and made it so the weapon would show up there, the weapon would continue to stay in his hand until he did a new Idle animation. Using this tactic, you can sometimes forgo modifying an animation file, provided if the item you don’t (or do) want appearing won’t be in an animation right before the animation file that doesn’t have a controller for it.
So there you have it! A tutorial on how to make weapons appear and disappear for particular animations. Using this method I made the Welsh Longbowman, who uses a spear-attack instead of a staff attack, and the Landsknecht Arquebusier, a musketman who uses a Light Swordsman melee attack. I’ll be finishing up this Worker sometime as well… I may even give him a melee attack as well.
Hope this works for you guys!
