Jump to content

[LE] Anybody with knowledge on the .hkx-files?


Recommended Posts

This might get a bit in-depth and long as I describe what I'm doing here, so please bear with me...

 

I've unpacked a couple of animation .hkx -files. Namely the giant ones that makes the camera shake - and I have removed that effect.

If you're wondering why, then the thing is: that I'm working with a mesh based off the giant mesh, inheriting all their animations through the files following the chain of the giantproject.hkx-file.

(Reason: It looks very weird when a creature slightly smaller than your average human makes the ground shake as it walks.)

 

For those curious, I used hkcmd.exe (found here on the nexus) to convert the files to (xml)hkx, then edited them in Notepad++, lastly converted them back to (compressed)hkx, again with hkcmd.exe. Here's a list of the files needed to edit this yourself:

 

* meshes/actors/giant/animations/attack_stomp.hkx

* meshes/actors/giant/animations/forwardpowerattack.hkx

* meshes/actors/giant/animations/runback.hkx

* meshes/actors/giant/animations/runbackleft.hkx

* meshes/actors/giant/animations/runbackright.hkx

* meshes/actors/giant/animations/runforward.hkx

* meshes/actors/giant/animations/runforwardleft.hkx

* meshes/actors/giant/animations/runforwardright.hkx

* meshes/actors/giant/animations/runleft.hkx

* meshes/actors/giant/animations/runright.hkx

* meshes/actors/giant/animations/walkforward.hkx

* meshes/actors/giant/animations/walkforwardleft.hkx

* meshes/actors/giant/animations/walkforwardright.hkx

 

Find the CameraShake variable in each file and set it to 0.0 (or perhaps just delete the command completely ??). You can do the same for, let's say : the mammoths if you want to make mammoth babies or whatever floats your boat... Only, you're going to have to look up what animation files makes the camera shake yourself. You will need to extract these hkx -files from the Skyrim - Animations.bsa -file using a tool like BSAUnpacker or BSAOpt first.

 

Now, this animation-replacement of mine makes my custom enemies work fine for testing purposes, but, as you understand, it removes the camera shake effect from the giants as well since it's modifying *existing files...

 

The rest of this wall of text is going to assume you have tinkered with these things yourself, and I'm going to try and express myself as clear as possible.

 

A good article related to this would be: http://www.nexusmods.com/skyrim/articles/50508/?

 

My big question is, how do I best make this change apply only to my custom enemies?

 

To specify what I've done so far:

 

Method1:

I have tried using copies of: giantproject.hkx, giantcharacter.hkx, giantbehavior.hkx, and these animation files within the meshes/actors/giant -folder and it's respective sub-directories with the file suffix of _ns (for No Shakes), and assigning the custom race of my custom enemies to use this new giantproject_ns.hkx -file.

Each of these custom files have been edited to point towards the new _ns -versions in the chain, instead of the default ones.

I also added appropriate animationdata and animationsetdata files and directories for this new *project along with edits to animationdata.txt and animationsetdata.txt to up the file count and refer to my new files. The goal was to have an alternate version of the giantproject that uses my new _ns.hkx -files where the ground would normally shake using the original giantproject.hkx. This flat-out didn't work.

I wonder what I'm doing wrong here... I've got to be missing something important?

 

Method2:

With success - I can copy the entire giant mesh folder and create a brand new project out of it, let's say: meshes/actors/ns_giant - apply the same principles to animationdata and animationsetdata as mentioned earlier - and then overwrite the animations in question with my new edited versions. But that would mean also duplicating existing files that won't even be modified, which I think is commonly bad practice - but at least it works.

 

Note: having the legendary edition with all dlc's, the updated animationdata.txt and animationsetdata.txt will need to be extracted from the Update.bsa -file.

 

A thing to take note of regardless of which method I use: This makes my mod incompatible with things like FNIS and other mods that makes changes to the animationdata.txt and the animationsetdata.txt -files. I would like this to be standalone.

So I have another possible method in mind..

 

Method1 V.2:

My knowledge is very limited here, please understand that. With all mentioned previously in mind, the best approach I can think of would be:

If possible: How can I have the giantproject.hkx -file recognize what source it's being called from - and if any other than the giant race - point towards my edited _ns -versions of the .hkx -files in the chain?

Edited by Guest
Link to comment
Share on other sites

In theory it may be possible to work out what type of actor should play which animation, because somehow the game figures out what type of paired kill animation to play depending on what type of actors are involved.

Any ideas on where to find this in the pipeline?

 

Alternatively, let's assume we're going with the replacement approach - as in: the giants footsteps does not make the ground shake:

Now, I know you can make a script to trigger a sound to play, but can you make a sound to trigger a script?

If so, I could easily just reapply the camera shake effect via scripting whenever the giant footstep -sound is being played, right?

Edited by Guest
Link to comment
Share on other sites

I also think that going to Zartar and his Skyrim Behavior Editor should be your next step. If he already is this far, his tool should be your best choice.

 

I certainly recommend not to deal with the animationdata files (forget the corresponding directories, they have no effect). There is so much you can mess up. And it's an immens amount of data every time a creature is added. I recently made an FNIS patch for the Centaur Race project. I don't think I would do that for something avoiding a camera effect. :smile:

 

My choice would be "alternate animations", the same you can see for example in PCEA2 and Sexy Move. It's a very simple construct. As soon as you don't want to make it available for an arbitrary number of alternates, like in FNIS. What you have to do in giantbehavior.hkx is to replace all relevant hkbClipGenerator nodes with a hkbManualSelectorGenerator and the 2 files. And you have to add the new animation files in the giantcharacter.hkx.

 

So basically you replace nodes like this

<hkobject name="#2809" class="hkbClipGenerator" signature="0x333b85b9">
<hkparam name="variableBindingSet">null</hkparam>
<hkparam name="userData">0</hkparam>
<hkparam name="name">2HW_AttackPowerForwardSprint</hkparam>
<hkparam name="animationName">Animations\2HW_AttackPowerForwardSprint.hkx</hkparam>
<hkparam name="triggers">#2808</hkparam>
<hkparam name="cropStartAmountLocalTime">0.000000</hkparam>
<hkparam name="cropEndAmountLocalTime">0.000000</hkparam>
<hkparam name="startTime">0.000000</hkparam>
<hkparam name="playbackSpeed">1.000000</hkparam>
<hkparam name="enforcedDuration">0.000000</hkparam>
<hkparam name="userControlledTimeFraction">0.000000</hkparam>
<hkparam name="animationBindingIndex">-1</hkparam>
<hkparam name="mode">MODE_SINGLE_PLAY</hkparam>
<hkparam name="flags">0</hkparam>
</hkobject>

with something like this (just a modified example from an unrelated place)

 

<hkobject name="#2809" class="hkbManualSelectorGenerator" signature="0xd932fab8">
<hkparam name="variableBindingSet">????</hkparam>
<hkparam name="userData">0</hkparam>
<hkparam name="name">FNIS_31__2hwatkpow_MSG</hkparam>
<hkparam name="generators" numelements="2">
    #2810 #2811
</hkparam>
<hkparam name="selectedGeneratorIndex">0</hkparam>
<hkparam name="currentGeneratorIndex">0</hkparam>
</hkobject>


<hkobject name="#2810" class="hkbClipGenerator" signature="0x333b85b9">
<hkparam name="variableBindingSet">null</hkparam>
<hkparam name="userData">0</hkparam>
<hkparam name="name">name1</hkparam>
<hkparam name="animationName">2HW_AttackPowerForwardSprint.hkx</hkparam>
<hkparam name="triggers">null</hkparam>
<hkparam name="cropStartAmountLocalTime">0.000000</hkparam>
<hkparam name="cropEndAmountLocalTime">0.000000</hkparam>
<hkparam name="startTime">0.000000</hkparam>
<hkparam name="playbackSpeed">1.000000</hkparam>
<hkparam name="enforcedDuration">0.000000</hkparam>
<hkparam name="userControlledTimeFraction">0.000000</hkparam>
<hkparam name="animationBindingIndex">-1</hkparam>
<hkparam name="mode">MODE_SINGLE_PLAY</hkparam>
<hkparam name="flags">0</hkparam>
</hkobject>
 
<hkobject name="#2811" class="hkbClipGenerator" signature="0x333b85b9">
<hkparam name="variableBindingSet">null</hkparam>
<hkparam name="userData">0</hkparam>
<hkparam name="name">name2</hkparam>
<hkparam name="animationName">YOUR_NEW_FILE.hkx</hkparam>
<hkparam name="triggers">null</hkparam>
<hkparam name="cropStartAmountLocalTime">0.000000</hkparam>
<hkparam name="cropEndAmountLocalTime">0.000000</hkparam>
<hkparam name="startTime">0.000000</hkparam>
<hkparam name="playbackSpeed">1.000000</hkparam>
<hkparam name="enforcedDuration">0.000000</hkparam>
<hkparam name="userControlledTimeFraction">0.000000</hkparam>
<hkparam name="animationBindingIndex">-1</hkparam>
<hkparam name="mode">MODE_SINGLE_PLAY</hkparam>
<hkparam name="flags">0</hkparam>
</hkobject>

What I can't tell offhand are the "????". Which variable binding can be used to distinguish. Animation variables like in FNIS have a disadvantage if you don't want to use scripts on every possible giant. But I'm sure Zartar can help you with that.

Link to comment
Share on other sites

Yeah, I figured creating an entirely new behavior is overkill for such a minor tweak.

But wow! This is great! So I can basically branch the node to either play the original giant animation, or my modified version... Interesting... Kind of exactly what I was looking to do. :D

I'm gonna check this out right away.

Now I'll just need to figure out how determine whether to trigger my custom animation or the original one... Any ideas where I should start?

 

Edit: The Skyrim_Behavior_Tool.exe doesn't even open for me :\

Edited by Guest
Link to comment
Share on other sites

The way I know of is to add a new variable in the giantbehavior, and set that to 1 for your giant buddies.

 

The problem is, that you have to do it every time your giants get a new 3d representation (get into the players vicinity). Which means (I think) that you have to add an appropriate referencealias script to each of your buddies.

 

I just hoped that Zartar finds an easier solution. He has more experience than I with these basic things.

Link to comment
Share on other sites

If it's giving u an error on startup create a C:\Steamgames\Steamapps\Common\Skyrim folder and place the TESV exe in it. The tool may not be picking up on the location. I had that same issue before. When u edit a behavior, u need to open the corresponding project file, so for giant, open up giantproject.hkx instead.

Edit: That said, i'm totally lost as there's next to no documentation online on this subject. Dunno where to start.

Edited by Di0nysys
Link to comment
Share on other sites

Thanks for that piece of information.

It did not help me start the program though. I click on it and nothing happens.

Don't know if I need any redist pack or anything installed to be able to make it run, but I posted in the comment section of the link you provided so we'll see if I get an answer.

The strange thing is that the program starts up just fine on my other computer...

 

Anyway, while I'm at it: I have discovered a new problem with my custom enemies not attacking all of a sudden.

Went in to the race menu and in to attack data and upon displaying event data I noticed that everything has mysteriously gone missing in there.

 

Here's what it looks like if anybody has any ideas:

 

EDIT: Found out that this is what happens when you add a new behavior project without doing anything to the animationdata and animationsetdata.

 

Dp1YhOy.jpg

Edited by Guest
Link to comment
Share on other sites

  • Recently Browsing   0 members

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