Jump to content

[LE] I need help with an xml-file converted from Horsebehavior.hkx


Recommended Posts

It's known around the modding comunity that the idle_graze_loop animation for horses doesn't work and nobody seems to have a solution for it.

I converted the HorseBehavior.hkx and all attached sub-hkx files for horses to xml and looked inside. I have no idea of xml, but I noticed a thing that could have to do with this problem. In the HorseBehavior.hkx file is this block:

<hkparam name="eventNames" numelements="141">
                <hkcstring>moveStart</hkcstring>
                <hkcstring>moveStop</hkcstring>
                <hkcstring>cannedTurnLeft90</hkcstring>
                <hkcstring>cannedTurnRight90</hkcstring>
                ...
</hkparam>

Inside this block are all possible animation data for the horseactor, also the IdleGrazing animation that you can choose in the ck under Animation menu. Every entry has it's own block in this file, that points to it's owning hkx file, but not the IdleGrazing entry. It's simply missing.

I thought it could work to just copy and paste the block for Idle_Pawing and change the ID to a unused one and the values to the corresponding hkx data, but every of these blocks has a hex signature and I have no idea where it comes from.

I even don't know if this would work. Or if this block is missing for a reason.

Example codeblock for Idle_RearUp:

<hkobject name="#0259" class="hkbClipGenerator" signature="0x333b85b9">
			<!-- memSizeAndFlags SERIALIZE_IGNORED -->
			<!-- referenceCount SERIALIZE_IGNORED -->
			<hkparam name="variableBindingSet">null</hkparam>
			<!-- cachedBindables SERIALIZE_IGNORED -->
			<!-- areBindablesCached SERIALIZE_IGNORED -->
			<hkparam name="userData">0</hkparam>
			<hkparam name="name">Idle_RearUp</hkparam>
			<!-- id SERIALIZE_IGNORED -->
			<!-- cloneState SERIALIZE_IGNORED -->
			<!-- padNode SERIALIZE_IGNORED -->
			<hkparam name="animationName">Animations\Idle_RearUp.hkx</hkparam>
			<hkparam name="triggers">#0258</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_LOOPING</hkparam>
			<hkparam name="flags">0</hkparam>

If someone has an idea about this stuff, your help is more than appreciated. I have attached the xml file, if someone wants to take a look at it.

 

Greetings from Tasheni

Edited by Tasheni
Link to comment
Share on other sites

You could be lucky, because some of the pre-requisites for idlegraze are already included: the idle definition with condition in Gameplay -> Animations, and the animation file entry in horse.hkx.

 

What you need to add is a part in the horesbehavior.hkx, as you already have figured. But it is not as simple as copying one clipgenerator. This is a complete little structure that needs to be copied. And adapted of course to the grazing specific parameters.

 

First you should install CondenseBehavior here on Nexus, becasue it allows you to list the behaviors in a sort of pretty print. That will allow you to better understand how things play together.

 

What you need to do is to make a copy to a tree similar to IdlePawning, starting at #0440. And add it to the list in #0469.

 

And then in #0459 you have to add a fourth transition block for IdleGrazing and the new IdleGrazing tree you just created with the previous step.

 

(I just add the word FNIS here so I will find this post again).

Link to comment
Share on other sites

Hi fore, I'm very happy for your reply. So I was partly right and that's fine to know. This stuff is completely new to me. I downloaded CondenseBehavior already but it was all too much to take a look at this yesterday. I was so focussed on my stuff that I didn't noticed that this little nice piece of software is from you :smile:

Alright, I used the tool and have now a textversion without unnessesary stuff like comments in it. But the changes I need to do must happen in the original xml-file, right?

I'm pretty confused. In the #0440 block are informations that refer to other IDs. And after it's own ID #0440 it states "hkbStateMachineInfo" - the #0469 has only "hkbStateMachine". And at the end of this block it is "state 7". Do I need to care about that? It looks now like that (in the text doc for theoretical playthrough):

                                     "#0469" "hkbStateMachine"
                                     "name" NonCombatIdleBehavior 
                                     "startStateId" 1 
                                      #0468 #0460 #0458 #0440
                                     "wildcardTransitions" null
                                       "exitNotifyEvents"  #0439 
                                       "transitions"  #0438 
                                       "generator"  #0437 
                                       "name" IdleGrazing 
                                       "stateId" 7

And I guess that the ID, that is already for the IdlePawing #0440 - do I not need to change it to whatelse, because the idle is unique?

 

The tree IdlePawing refers to this generator (whatever that means):

"#0437" "hkbModifierGenerator"
                                         "name" IdlePawing_MG 
                                         "modifier"  #0436 
                                         "generator"  #0434

I guess I should do something with it, but where do I get the right values from? I looked into the hkx idle_graze_loop but the values are not matching with things in the HorseBehavior.hkx

I'm sorry to bother you with that, as I said, I'm not familiar with these things :sad: I will try so...

 

Edit: In block #0459: How do I get the right transition ID and the EventID from?

 

As I understand it now, I have to look through all the IDs for the IdlePawing and follow them and add similar entries for the IdleGrazing. The main ID, where do I get it from? Or can I use an own unique one that is unused?

Edited by Tasheni
Link to comment
Share on other sites

First off, could you please change the format of the xml presentation? It's extremely hard to read anything due to the constant alternation between dark and light lines.

 

If you want to work with a comment free xml, you can use almost the complete HorseBehavior_Template.txt (part of the FNIS Creature pack). Only a few lines with "$" close to the end of the file differ.

 

Now in the #0469 state machine you only need to add the link to a new node tree. Lets say #0600 (and don't forget to change numelements to "5", or else hkxcmd will abort)

 

The tree starting at #0600 can be a copy of the IdlePawing tree starting at #0440. In the CondenseBehavior listing this is everything between the #0440 and the #0433. Actually a few nodes could be re-used from #0440, but I don't want to confuse you too much.

 

What you should change is:

- all nodIDs (obviously)

- the names (from Pawing to Grazing, not really necessary, but otherwise you will get confused)

- the stateID 7 from the original #0440, because that needs to be different later in the additional transition block i #0459

- the animation file name in #0434 (obviously)

 

I hope all the rest can be treated the same between Pawing and Grazing. Because apparently Bethesda had something else in mind, since the Grazing animation actually consists of 3 animation (including start and stop). So the idle_loop itself might be a little abrupt.

Link to comment
Share on other sites

I apologize, I didn't know that I can change the colors of the codebox, the xml code was formatted automatically. I will find out how to do it.

 

Thank you so much for your explanations, this helps a lot and encourages me to really try that. If I can get the IdleGrazingLoop to run, than it should not be too difficult to put in the grazing start and stop animations, too. I will need some days to work on it and will report back. Thank you.

Link to comment
Share on other sites

I wish you a lot of success. But you really seem determined, and that's great. :D

 

With the start/stop I have to caustion you. That will be much harder instead, because you don't have an example in the file, and it will require much more new stuff.But I think you are on a really good way. :thumbsup:

Link to comment
Share on other sites

Thank you :) Never believed that would be easy - but what was easy since I opened the ck the first time? :devil:

Okay, I think this will keep me busy for a while and will not be included in my next mod update. But who knows - perhaps at the end of year, when the next update will take place.

I will come back if I have more questions or get desperate or throw my computer out of the window :laugh:

Happy modding.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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