Jump to content

Creating a (2 state) Activator


RoNin1971

Recommended Posts

Hi there guys,

 

I recently created a 'functional' lever, for the fun of it and to help out Zorkaz, who was looking for something like a lever. I even added a 'mod' to share it as a resource.

I did a few "doors", which where way more complex, on the nif/animation side, but fairly easy to add in CK. So it was supposed to be a quick hack, but it turned around to bite me :tongue:

 

First of all, the animations didn't play while reviewing the model in CK, secondly you couldn't interact with it in-game.

 

I spend about 5 hours figuring out what was wrong, trying everything possible, but nothing worked. The handle just wouldn't budge a bit.

At a complete loss, I tried pulling the nif through Elric in a last attempt....and that actually worked.

 

Suddenly the animations did play. Did the same for a couple versions i created along the way, with the same result. Even the very first version.

But, still no interaction. From my experience with the doors i know this has to do with the collision, which is used to determine where you can 'interact' with the object.

 

I discovered it was gone. Apparently Elric deleted the existing collision (which came with the original nif, untouched by me) while repairing them.

 

I recently found there was a Nifskope 2.0 Dev 8 on the netz, so i've been using that, instead of Dev 7, which might be the cause of this 'corruption' as i can't think of anything else and never had this before. To be sure i reverted back to Dev 7.

 

I copied in a new collision from a different object (the pushbutton casing to be exact) to replace it. Now the interaction works too in-game.

 

...but not the animations. Unless you would rename the animations "Open" and "Close" and add it as a "door".

 

It would of course make a lot more sense if it is an 'activator', but that turns out to require a 'bit' more. All of it locked away inside different .hkx files (Havok behavior Graphs, including compressed animations and events)

 

I was able to convert those to xml, using HKXPack.0.1.6 and i can at least read it a bit and possibly manipulate it if needed, but it might not (be needed) as they seem pretty generic.

So i tried using the pushbuttons files, as it is one of the few without havok animations, but gamebryo (the latter being what you can see / create with nifskope) and that actually did work. (i renamed and created a few 'idle' anims, to match the button) Except that it works as a toggle / pushbutton, returning to its initial state. (Exactly like the levers in Skyrim, which i did look at, but since i have SE, the nifs are actually newer and use havok exclusively [edit: Except for the collisions. could easily create those with just nifskope ... :sick:])

 

So, on to the next step: a 2 state lever. Like the circuitbreaker.

Which was my next 'target'. Match my work with that of the circuitbreaker. However, that one does use havok animations (i'm unable to create those) which makes 'matching' impossible. From here on it will probably be trial and error for many hours again....

 

And there you have the reason for this post. As I'm surely not the first to be on this path, so any input from the experts is most welcome.

Beyond that, anybody else struggling with this stuff will probably like to know all the above and what is to come below, as i will keep you posted on my progress.

 

edit:

When i get this done, I will create more and expand on my mod. That I promise.

As i never expected more then 1 download on my 'resource', but i got 16 within 24 hours, and requests for usage and joining others on projects and what not.

so it turns out to be way more popular / wanted as anticipated. :laugh:

Edited by RoNin1971
Link to comment
Share on other sites

I got it all to work, animation and interacting both as 'door' and 'activator'. Goes perfectly with the circuitbreaker closing sound :wink: The only thing missing, as activator, are the events. For that I need to crack and understand those .hkx files. (by my knowledge i can't do that inside the nif, but please correct me if i'm wrong!) So any help or pointers on that part would be much appreciated.

 

edit:

For those interested, you can find the updated lever resource mod here:

https://www.nexusmods.com/fallout4/mods/51854

Edited by RoNin1971
Link to comment
Share on other sites

I keep hitting walls here, while creating my animations. I created a few more, one of which is a bit more complex and pretty neat, if i say so myself, but each and everyone of them makes both the CK and Elric CTD on load. So, yeah, can't even repair them with Elric.

 

I keep staring myself blind and a headache, but between version 01 (works perfectly) and the rest only the mesh and its name are different (and for nr.5 the animation more complex with multiple moving parts, thus, more meshes). I even went through the entire process step by step, running it through Elric each time, until it broke. Which is as soon as i add an NiControllerSequence (the basis for each animation ...)

When i copy the meshes to (a copy of) the first, working, nif file and make a few changes to reflect the new name, it does work fine suddenly.

 

The only difference there is between these files is their origin. Where the first is a changed original, the others where exported from Outfit Studio. (ALL the meshes where exported from OS, but the first time i copied the mesh to the original, where as I created all others using the file as exported. So it's possible OS somehow introduces something inside that nif file, which you can't see or fix using Nifskope, which interferes with the animation code.

 

At least i finally got the second one working, so I'm gonna try the more complex one next. Lets see if using original files indeed helps.

Link to comment
Share on other sites

HKX files can be created via 3ds MAX 2013 or 2015 with the HCT installed.

 

HKX files can send events to the behavior graph to let it change its state. Havok behaviors are nothing but state machines. You can edit them, but only via XML and hkxpack-cli, or the Havok Animation Toolkit.

 

In havok it's simple: There's a character definition, a behavior, a skeleton and a set of animations that the behavior referneces. The behaviors react to events sent from the game engine and send events back to the engine. That's how states are kept. The door also references the havok behavior for doors which have two states and transitions between those states.

 

You can make it work, but you need to either edit the event or you have to attach a script that sends the events down the graph on activation.

 

Look at the "OnActivate" and the "OpenClose" behavior.

Link to comment
Share on other sites

Have you had a chat with the nifscope team? This seems like something they should be made aware of.

No i haven't. Not sure about the cause of all this. But perhaps I could send them one of the files, as all work perfectly with Nifskope but Elric chokes on 'm. (& so does CK & FO4, no doubt)

It might at least help them improve.

 

But as for what's going on and whats causing it, I'm still just guessing and a bit at a loss.

 

My first attempt for the more complex 'lever' just failed. I copied as much as i could from the non working file to a copy of the first, as before, but now Elric still chokes on it.

So, my next attempt will be to rebuild the animation sequences ground up, inside the working file and see what happens then.

 

edit:

Well, looks like I finally nailed my problem. It appears I forgot to add the QUADRATIC_KEY type to the interpolation of the Y and Z axis for the transform data (which are not used/changed so that's probably why I didn't notice before)

At least, Elric will process my files as 100% ok now, instead of CTD.

Edited by RoNin1971
Link to comment
Share on other sites

Why does the gear bounce back when the lever is released?

 

Looks kinda cool. :D

That's the end of the animation, and the player [edit: nifskope] bounces back to the beginning.

At first i was planning to change the UV mapping, so you wouldn't notice, like you could keep turning it bit by bit.

But I changed my mind and turned it to a 'open' & 'close', like the others, by adding a second animation, where you turn the gear back.

 

So, in game it will remain in position, ones opened, and you return it on close. So the 'mechanism' has 2 directions, instead of just one.

 

edit:

Here's a better, in-game, video to show how it works: https://drive.google.com/file/d/15WtH7ZbKGWeQpLyJuzUaEsxVZigAaK7J/view?usp=sharing

Edited by RoNin1971
Link to comment
Share on other sites

Ok, now THAT is COOL! :D

 

For whatever reason, I can't play the video from google drive, I have to download it, and it plays perfectly fine in VLC media player....... I just get the toilet bowl swirly in the google drive page. :D

Link to comment
Share on other sites

  • Recently Browsing   0 members

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