Jump to content

Working With Custom Animations of Static Meshes


UlithiumDragon

Recommended Posts

I have been teaching myself to 3D model using 3ds Max for a while now, and moved on to learning how to animate. However, every tutorial I can find has to do with animating actors - I can find zero information on how to work with activators.

 

What i am trying to do right now is add a closing animation to the secret fireplace door added for the castle tile set by the Dawnguard DLC (meshes\dlc01\dungeons\castle\animated\fireplace\cassmhallfireplaceex01.nif). I created the animation, but I am having serious trouble trying to export it. I'm using the 3ds Max Nif Importer-Exporter plugins for 3ds Max 2012 found here on the Nexus. I have tried this tutorial without luck. When I compare my exported close.kf to the functional one converted from a .hkx file (open.kf), I can clearly see that the exporting didn't work - opening the exported close.kf file using NifSkope shows that it has no nodes at all, whereas the open.kf has a NiControllerSequence node, as well as several subnodes. Simply copying over this node does not seem to make the custom close.kf functional. In fact, no matter what, hkx.cmd will not convert it.

 

I went ahead and tried manually editing all the data inside the custom close.kf to match the vanilla open.kf, which did allow hkxcmd to be able to convert it into a .hkx file, but the converted file still won't function, even after converted into a packed .hkx file.

 

Since there really is little to no documentation on how .nifs' nodes work, i.e. which ones control which things, what combinations of nodes and subnodes produce which kinds of effects, how much they can be edited locally in NifSkope, etc. I went ahead and tried fiddling with the nodes, trying to match the cassmhallfireplaceex01.nif file's nodes to that of a 2-state door-activator that I know works (in this case, the secret door from the Nordic dungeon tile set). Even with the nodes matching up 95%, I couldn't get the second animation (close) to play.

 

I even tried converting the behavior files for both the Nordic secret door and the secret fireplace door I was trying to edit into .xml files so I could read them with Notepad++. I tried some editing, and re-converting back into .hkx behavior files, which didn't seem to affect the .nif's one bit. I then tried deleting all the files in the folder with the cassmhallfireplaceex01.nif to see what would happen, and the animations still played in NifSkope, which lead me to believe that the behavior files are imported into the .nif, which means that editing them is out of the question, since I have no clue how/where they are stored.

 

In any event, I am forced to give up for now, due to lack of information and/or documentation on how something like this is done. If anyone has any idea how to go about doing this, I'd very much appreciate the help. Even just pointing me in the direction of a tutorial would be nice, as I said I really couldn't find one, and I did look for quite a while...

Link to comment
Share on other sites

You don't find Skyrim tutorials for nif animation because it's deprecated functionality. If you look for tutorials you should rather look in the Oblivion context. Although from own past experience I know that there isn't much documentation either.

 

In Skyrim, nif animations only work so that older assets can be used. All newer stuff by Bethesda was developed using Havok Behaviors. Everything, like traps, doors, bows, coffins, are implemented with HBT. And like for characters and creatures, it's practically impossible to create own behaviors. You could try with using and adapting assets for existing objects that are similar to one. But you won't find any tutorials about that. Noone I know of has done that before.

Link to comment
Share on other sites

Thanks for the info. That's really disappointing... oh well. I guess I'm better off trying something like using a moving door mesh that already has havok files and creating static .nif's around that. Bethesda really screwed modders over twelve ways to midnight with the new game engine...

Link to comment
Share on other sites

  • 7 months later...
  • 2 years later...
  • 4 weeks later...

Not sure what exactly you want to do, but I tried getting a moveable static like the siltstrider found in Solstheim which loops a single animation into the game over the last couple of days myself. I haven't done any extensive testing and merely got a basic robot-like arm into the game, but it seems to be functional as far as I can tell.


Anyway, it boils down to you (in 3ds Max):

>> creating a skinned mesh with bones (I used ~10)

>> setting up an animation

>> saving the animation with "segment" and "key per frame" checked

>> loading the animation to create a keyframe at every frame (make sure "set key" to the bottom right of the viewport is unchecked)

>> using the 3ds Max nif plugin to "export with animation" ( settings: http://imgur.com/a/DBbL4 )

>> using Nifskope to copy a BSLightingShaderProperty from an existing model to your NiTriShape

>> changing the BSXFlags flags (Integer Data) to bit 0:animated, bit 1: havok, bit 3: complex

>> changing the NiTransformController flags for every bone to 8 ("active" checked & the loop-mode set to "cycle")


You can then create a new moveable static or simply replace the siltstrider model in the Skyrim data folder with your own and drag it into a cell in the Creation Kit.


Of course changing all these flags after every export is a massive pain in the *****, so I added a few lines to the 3ds Max plugin source files to do it for me. (here are 32bit and 64bit NifPlugins.dlu releases for 3ds Max 2012 which can be used to replace the regular "3ds Max nif plugin" NifPlugins.dlu found in the "3ds Max 2012/plugins" folder. I only tested the 32bit version.)


Lines changed/added:


exporter.cpp (Line 134)


if (Exporter::mExportType == Exporter::NIF_WO_KF)

{

bsx->SetData( IsSkyrim() ? 11 : IsFallout3() ? 202 : 2 );

}

else

{

bsx->SetData( IsSkyrim() ? 198 : IsFallout3() ? 202 : 2 );

}


...


animation.cpp (Line 1019)


if (Exporter::mExportType == Exporter::NIF_WO_KF)

{

control->SetFlags( 8 );

}


...


DllEntry.cpp (Line 371)


const PfnDliHook __pfnDliFailureHook2 = delayHookFailureFunc;



I have no real experience with programming, though. So I have no idea as to whether these lines mess anything up. But it appears to be doing its job for me.


Anyway, there might be better ways of going about inserting animations for movable statics or activators, but this is what I managed to figure out over the last days.


Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...