QUESTION: how to add unit effects?

Your General does nothing when joining a unit/city because your missing the Warlord_Ancient_MD_Activate.kf animation that is triggered for these events.

After you have created this kf, you'll have to modify this animtion and the units nif a bit further to add the Warlord "lightshow" to the unit. First the necessary .nif modifications:

If you look again at the image in the #4 post, you see that the Warlord nif has beside blue ATTACHABLES also some nodes named EFFECT (green). You must make sure that your custom Warlord has the same nodes at the same places in the nif, same procedure as you already have done with the ATTACHABLES. After that, you are finished with the nif. Next one is the Warlord_Ancient_MD_Activate.kf:

First, open the original Warlord_Ancient_MD_Activate.kf file with NifSkope. Each kf file has a node called "NiTextKeyExtraData". In this node, all the sounds and effects for the animation are declared together with the time mark when this sound/effect should take place. This node is a child of the NiControllerSequence node, so you can find it by unfolding this node. Normally the NiTextKeyExtraData will be at the bottom of the list. If you leftclick on it, you see in the Block Details that it has an entry called "Num Text Keys" with a value of 10 and another entry called "Text Keys". If you unfold the Text Keys, you get a list of all 10 declared Text Keys. Each of these can be unfold again, and by doing so you'll get a time and a value. The value says what should happen and the time of course says when it should happen. Sounds are declared with "SOUND:" and effects with "Effect:". If there are to be more of the same kind to be played at the same time, they can be added with a simple comma (sounds) or colon (effects) inbetween.

You are interested in the Warlord effect, so a simple search through all Text Keys will show you that the whole effect consist of a "SOUND:AS3D_UN_WARLORD_ACTIVATE_VOX" at 0.8 seconds and a "Effect:EFFECT_GREATPEOPLE_BIRTH_WARLORD:EFFECT_GREATPEOPLE_BIRTH_WARLORD" at 1.6667 seconds. Therefore, these two Text Keys must be added to you custom Warlord_Ancient_MD_Activate.kf. For this, open that file with NifSkope and go to the NiTextKeyExtraData node. Raise the Num Text Keys value by 2 and refresh the Text Keys list by clicking on the green arrows. Next, unfold the list. There should be two extra Text Keys at the end of the list now with no content. Put into those two Text Keys the necessary information from the original .kf. Save the kf, and your done. :)

When testing your custom Warlord, you might want to have the effect happening at a different time. For this, you are free to raise or lower the time values at your will. However, I would advise you to change both times equally (for example, you could add 0.7, leading to 1.5 and 2.3337). This way, the effect itseld isn't altered. But of course you can also play a bit with that if you like. ;)

When you have finished your Warlord_Ancient_MD_Activate.kf file I can show you how you can make simple animation modifications if you like. For example, the Warlord could drop his sword when he surrenders.
 
Im still stuck on the effects part... first there is already an effects node that is above the feet. secondly I can't move the new pasted branches to where they need to be can you have a look and tell exactly what I need to be doing there
 
Ah, these nodes don't need to be exactly at the same place as in the Warlord nif. Importent is that they are a child of the same node as in the original file (MD NonAccum here). Also, the node called "EFFECTS" has the same content in both nifs, so this one doesn't need to be copied. Only "EFFECT_ActivateProphet" and "EFFECT_GREATPEOPLE_BIRTH_WARLORD" need to be copied.

By the way, if you at some time need to change the order of the nodes in a node you can do that by changing their order in the "Children" array you can find in the Block Details of that parent node. The only time I know so far when the order can have an effect is if you have a model consisting of serveral parts and some of them work with transparency. If this is the case, you should always order the transparent parts to the bottom of the list, because the tend to make everything below them invisible otherwise.
 
Ok thats a relief! Btw you now have 444 posts :lol: I have just been exploring the wonderful world of python and I is great to be back on something I have a chance of handling

I will try all this out and get back to you!
 
Yay that all works! about the dropping of the sword... For some reason I decided not to use DieA for the surrender and used fidget instead (probably because of time) so what would you suggest I use for the surrender before we do anything with the dropping of the sword
 
Yay that all works!
:goodjob:
about the dropping of the sword... For some reason I decided not to use DieA for the surrender and used fidget instead (probably because of time) so what would you suggest I use for the surrender before we do anything with the dropping of the sword
I think the fidget animation works just fine as surrender animation. The dropping of the sword is a bit more complicated than I thought before, but that's okay. You'll learn even more this way. ;)

So, first I thought about just moving the sword down when the animation starts. The problem here is, that the sword is a child to the "BIP R Hand" node, thus it's animation is a combination of the right hand and whatever we would add, which doesn't work at all for a sword that should be lying on the ground. Therefore, we need a second sword that does the job.

To create a second sword, "Copy Branch" the "praetorian sword" node. You get to that node easily by leftclick on the sword. The parent node of the sword mesh is the needed node. "Paste Branch" that node into the "MD NonAccum" node and rename it "dummy_sword". Now the unit should have two swords, on in the hand and one on the ground. Because the dummy_sword should be a target for an animation, you must first check if its flag (in the Block Details) has a value of 22. Further make it a child of the "NiMultiTargetTransformController" node (#5). To do so, leftclick on that node and raise the value of "Num Extra Targets" in the Block Details by on to 22. Refresh Extra Targets by clicking the green arrow and unfold it. The last entry should be empty, but in there the number of the dummy_sword. You must also make the praetorian sword node a child of the NiMultiTargetTransformController the same way, because it isn't yet. Save the nif.

The dummy_sword must be moved at the position of the original sword at the start of the surrender animation next. Load that animation and move the sword via "Rightclick->Transform->Edit" on the dummy_sword node. A good combination should be X -26, Y -7, Z 58, Euler: Y 63, P -23, R 90 for example. After that, don't save the nif. If you would save now, the loaded animation would be saved within. The nif would still work, but would take up move space. Instead, open the nif a second time with NifSkope and change the coordinates of the dummy_sword in that instant without having load an animation. Now save that nif and close the first nif with the loaded animation.

Now that the second sword is ready you should think about the animation you want. Obviously, the first thing you want to make sure is that during the surrender animation only the dummy_sword should be visible (otherwise the Warlord would suddenly have two swords). For this, you must add a "NiVisController" node to both swords. Sadly, the praetorian has none within its nif, so you must copy that one from another nif. For example, the infantry nif has one for its fidget letter. "Copy" that node and "Paste" it into the sword nodes. Now the nif should be read for the animation, save the nif.

Load the surrender animation. Now comes the task to think about the actual animation. For a simple sword drop, you don't need to think about any step by step animation, you only have to choose how the sword should end its fall, everything else can be a linear movement between the start point of the sword and the end point. Thus, move the sword around until you have found a nice lying position for it. For example, X -26, Y -15, Z 2 Euler: Y 90 P -23 R 90 should work fine. Now finally the animation file can be modified. Open it with NifSkope.

There must be three new components added to the animation. One "NiTransformInterpolator" that modifies the position of the sword and two "NiBoolInterpolator" that define if something is visible or not. Again, the praetorian lacks of the second ones. You can get that one from the infantry_md_fidget.kf for example. "Copy Branch" that node and "Paste Branch" it in your surrender animation. You'll notice that this new node doesn't become the child of the "NiControllerSequence" node, but that's alright. Further you'll notice that the NiBoolInterpolator has a child node, called "NiBoolData". That one can be used to trigger the NiBoolInterpolator at a certain time, but you want it to be triggered the whole animation, so just remove that node. Copy that now child-less NiBoolInterpolator node and paste it again to your surrender animation. Further change the "Bool Value" of one of those nodes to "no". "Yes" means that the sword will be visible, "no" that it won't. These are the NiBoolInterpolator nodes you need.

To get a NiTransformInterpolator node, just "Copy Branch" one that has a "NiTransformData" node as child from the NiControllerSequence list and "Paste Branch" it. Change the "Translation" of the pasted NiTransformInterpolator node to the start XYZ values of your dummy_sword and the "Rotation" to the start YPR values (you'll have to click on "axis" inbetween). Now go to the child NiTransformData node. Change the "Num Rotation Keys" to 0, refresh "Quaternion Keys", change "Num Rotation Keys" to 3, refresh "Quaternion Keys". Now you'll have a clean list of Quaternion Keys. Do the same for "Translations - Num Keys" and "Translations - Keys". Also make sure that "Rotation Type" and "Translations - Interpolation" have the value "LINEAR_KEY". After that, open the first Quaternion Key and change its value to the start Rotation of the dummy_sword. The second Quaternion Key gets the value of the end Rotation and the time at which this Rotation should be reached (for example 0.2 seconds). The last Quaternion Key gets the end Rotation again, but this time the end time of the animation (5.6667 seconds). Do the same for the Translations - Keys, but of course with the XYZ values this time. Then your are finished with the necessary nodes. Now comes the final spurt, the animation nodes have assigned to the swords.

For this, leftclick on the NiControllerSequence node. In the Block Details, raise the "Num Controlled Blocks" by 3 to 27, refresh the "Controlled Blocks" and unfold them. At the bottom of the list there should be 3 <empty> entries. Unfold the first one. Put the number of the NiTransformInterpolator node into the "Interpolator" value and the number of the animation's "NiStringPalette" into the "String Palette" value (should be 3 here). Further change the "Node Name Offset" value to "dummy_sword" (caution: this is case-sensitive) and the "Controller Type Offset" value to "NiTransformController". Do the same for the two other <empty> entries and the NiBoolInterpolators, but this time choose "praetorian sword" for the NiBoolInterpolators with the value "no" and the "Controller Type Offset" value must be "NiVisController".

And then, believe it or not, you are finished. :)

As you can see, it's rather much work for this small animation change. But with some routine it's pretty fast done. Maybe the sword-drop wasn't really worth it, but at least now you've seen what can be done with NifSkope. :D
 
I am stuck on the part with the letter's VisController I can't work out what I need and where to put it have you got a screenshot?
 
I hope this helps:
Spoiler :

attachment.php

 

Attachments

  • thisgoesthere.jpg
    thisgoesthere.jpg
    177.9 KB · Views: 199
ok I will try that soon... Also thanks for finding the War Prizes comp I managed to edit the python to make it how I need it!
 
I tried copying and pasting the NiVisController into the dummy sword and it said to me "Failed to link parent link NiNode|TopFold_Letter"
 
when you mention the co-ordinates for the second time after adding the VisController... Is this in the same Nif that I changed the co-ordinated of earlier because it doesn't really make sense to me... can you explain?
 
You mean this part, right?
Load the surrender animation. Now comes the task to think about the actual animation. For a simple sword drop, you don't need to think about any step by step animation, you only have to choose how the sword should end its fall, everything else can be a linear movement between the start point of the sword and the end point. Thus, move the sword around until you have found a nice lying position for it. For example, X -26, Y -15, Z 2 Euler: Y 90 P -23 R 90 should work fine. Now finally the animation file can be modified. Open it with NifSkope.
This you don't do for the nif, but for the later modification of the kf file. This way, you get the necessary coordinates for the animation. The first set is the starting point of the sword in the animation. This second set is the end point of it in the animation. Of course normally you don't have this coordinates, but must find them by manually "playing" with your nif. Of course you don't save these coordinates in the nif after you have identified them. Just remember them for the kf file.
 
ah... that makes perfect sense now...

btw I'm going to have to put you in as one of the authors of 1.3 becuase of all your help :D
 
um right at the end where it says "Do the same for the two other <empty> entries and the NiBoolInterpolators, but this time choose "praetorian sword" for the NiBoolInterpolators with the value "no" and the "Controller Type Offset" value must be "NiVisController"." I left click on the BoolInterpolators (which for some reason are not in the NiControllerSequence) and the only thing it has in it is the yes no thing and Data - Ref<NiBoolData> - None

what am I mean't to be changing???
 
ah... that makes perfect sense now...

btw I'm going to have to put you in as one of the authors of 1.3 becuase of all your help :D
I won't object against it if you want to. :)

um right at the end where it says "Do the same for the two other <empty> entries and the NiBoolInterpolators, but this time choose "praetorian sword" for the NiBoolInterpolators with the value "no" and the "Controller Type Offset" value must be "NiVisController"." I left click on the BoolInterpolators (which for some reason are not in the NiControllerSequence) and the only thing it has in it is the yes no thing and Data - Ref<NiBoolData> - None

what am I mean't to be changing???
When you have one NiBoolInterpolators with a "no" value and one with a "yes" value you won't have to change anything within them anymore. You must just connect them to the the two sword nodes like you did with the NiTransformInterpolator node with the dummy_sword node.
 
In this paragraph,
Put the number of the NiTransformInterpolator node into the "Interpolator" value and the number of the animation's "NiStringPalette" into the "String Palette" value (should be 3 here). Further change the "Node Name Offset" value to "dummy_sword" (caution: this is case-sensitive) and the "Controller Type Offset" value to "NiTransformController".
replace "NiTransformInterpolator" with "NiBoolInterpolators" and "NiTransformController" with "NiTransformController" and you have your description what to do. Use "dummy_sword" for the "Yes" NiBoolInterpolator and "praetorian sword" for the "No" NiBoolInterpolator.
 
Back
Top Bottom