Jump to content

[LE] Havok disable scripts that actually works! here it is


Recommended Posts

So I have long fought with the havok system and after much work have found that this little script will effectively keep dynamic NIF objects in place and prevent them from moving under any circumstance. The key seems to be in the FALSE bool on the motionsystem function which basically forces the NIF to ignore all imbedded havoc simulations until it is hit or Z keyed, or whatever, but then the keyframe setting removes those interaction possibilities as well.

 

The vanilla havok script has the bool as TRUE which allows it to pass havoc events to the object if you so wish, effectively making the vanilla script useless because it doesn't truely disable havoc, it only manages it, and poorly at that. If you have a heavily loaded cell or too many managed objects, they just start falling off the walls. The FALSE bool appears to block the NIF from defaulting to it's imbended havoc behavior while the system is thinking about what to do. The vanilla script also is conditioned to require the model to be fully loaded before the script is attached, and if that fails then the motionsystem set will fail, removing this condition also seems to improve the stability of this function.

 

The reset to editor location is basically there as a failsafe encase the 3D does manage to load before the motionsystem is stabilized. The block activation is completely optional and you can remove it, I just use it because I use a few actual weapons as displays and this prevents them from being able to be taken.

Scriptname DBM_DynamicDisplayScript extends ObjectReference  


EVENT onLoad()
    BlockActivation(true)
    setMotionType(Motion_Keyframed, FALSE)
    self.MoveToMyEditorLocation()
endEVENT

EVENT onCellAttach()
    BlockActivation(true)
    self.MoveToMyEditorLocation()
endEVENT

EVENT onLoadGame()
    BlockActivation(true)
    if (Self.Is3DLoaded())
        setMotionType(Motion_Keyframed, FALSE)
    Endif
    self.MoveToMyEditorLocation()
endEVENT
Link to comment
Share on other sites

Awesome work. I haven't had to fight this fight YET, but I've heard plenty of others complain. Used a few mods where non-havok things still got knocked all over the place also. When I start building buildings and such, I'll put this to use, and give you credit for it.

 

PS: LOVE the Legacy of the Dragonborn mod too even if it is driving me nuts hunting everywhere for stuff for displays. :D How could you forget The Fork of Horripilation though?

Link to comment
Share on other sites

  • 4 years later...

And it's still awesome. The vanilla script didn't work for me at all, and I've been looking for a solution for hours now. But this script works flawlessly (I'm not using the BlockActivation, it's just for a dagger "stabbed" into a desk.) Thanks for sharing this all that time ago :laugh:

Link to comment
Share on other sites

  • 4 weeks later...

Just a warning here - this script is quite stack intensive if over used. I made the mistake of putting around a hundred refs in a cell using this script, and started getting intermittent crashes to desktop. And it was a bugger to track down I can tell you! ;-)

 

My solution was to go to the nif and change the 'motion system' to MO_SYS_INVALID.

 

Of course I may come back in a week or two and find that's not the problem...

Link to comment
Share on other sites

As far as havok Skyrim cells have an odd way of handling that. The real time havok doesn't engage until you enter the interior. Problem is things may not be settled and the havok can make a mess of things as everything is not acting correctly. This could have been avoided in the kit if havok was turned on for a moment to let things settle. Then switched back off. The ideal way this should work is when things have settled pass the 1st havok "push". Anyways the other way to get around this to enter a cell then walk right back out. When you enter again havok will act correctly.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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