Jump to content

Havok affects some items, not others.


antstubell

Recommended Posts

Hi all.

Got me a nice big hall and put some skulls on the wall and an arrow in the eye of a skeleton. All looks great in CK. 3 skulls on wall. I went in game a few days ago and all was fine, the objects didn't Havok settle, as I'd ticked that box in CK for the "floating" objects. Yesterday I went in game and 1 of the skulls and the arrow in the eye had fallen. 2 skulls remained on the wall it was just the 1 skull and the arrow, back to CK rechecked "Don't Havok Settle" was ticked, it was, but they won't stay in place. Any thoughts on this?

Link to comment
Share on other sites

If they are near something else and the collision box intersects then that item will cause the havok settle. If those are to be permanently in place for decor you can make them a static object. just duplicate any static clutter object then change the model filepath to a skull and another one to the arrow you are using. then ctrl+f to swap them out in the render window.
Link to comment
Share on other sites

If they are near something else and the collision box intersects then that item will cause the havok settle. If those are to be permanently in place for decor you can make them a static object. just duplicate any static clutter object then change the model filepath to a skull and another one to the arrow you are using. then ctrl+f to swap them out in the render window.

 

Ok, not sure I understand the arrow bit but for now I'm more concerned with the Troll Skull. I already have a Mammoth Skull and a Dragon Skull mounted on the wall in similar postions. The Troll Skull is a static object and there is nothing near its collision box. See attached images. What I did do was delete the 1st skull that fell put in another same method no Havok settle and it worked for 2 or 3 loads then it fell again.

 

 

 

Edited by antstubell
Link to comment
Share on other sites

static items will not havoc settle nor be able to be moved without console setpos commands or in the CK. I have no idea how you made a static that can settle. If you go to the static objects and in the clutter section, right click on anything in there and select duplicate, then edit the duplicate and change the model path to the troll skull and you will have a static troll skull that will not move. then in the render window select the non static skull and ctrl+f and replace it with the new static version.

 

You can do the same thing with the arrow and the other skull and they wont move either.

Link to comment
Share on other sites

static items will not havoc settle nor be able to be moved without console setpos commands or in the CK. I have no idea how you made a static that can settle. If you go to the static objects and in the clutter section, right click on anything in there and select duplicate, then edit the duplicate and change the model path to the troll skull and you will have a static troll skull that will not move. then in the render window select the non static skull and ctrl+f and replace it with the new static version.

 

You can do the same thing with the arrow and the other skull and they wont move either.

 

Thanks. The troll skull is MISC that's why it settled even when I ticked the box "Don't....." I took a mammothskull STATIC, duplicated and changed the .nif to a troll skull.

Link to comment
Share on other sites

Even if you add the script DefaultDisableHavokOnLoad AND set the parameter HavokOnHit to false (it defaults to true) there is still a possibility that the object will occasionally move. I go round this by creating a modified version of this for my bookshelf to 600 books by saving the original posotion & rotational angle thus (some of the stuff won't be relevant to your situation, so take what you need).

 

scriptName JSShelvedBookDisableHavokOnLoad extends ObjectReference
{This is a custom version of defaultDisableHavokOnLoad used for books placed on bookselves and activated by placing a book in a container}

bool property havokOnHit = FALSE auto
{Start Havok Sim when hit? DEFAULT: FALSE}
bool property havokOnActivate auto
{Start Havok Sim when activated? DEFAULT: FALSE}
bool property havokOnZKey auto
{Start Havok Sim when grabbed by player? DEFAULT: FALSE}
keyword property linkHavokPartner auto
{Link with this keyword and that ref will also sim with myself}
bool property beenSimmed auto hidden
{prevent an object that has been havok'd in-game from going static}
objectReference myLinkedRef
Book myBaseObject
Float MyPosX
Float MyPosY
Float MyPosZ
Float MyAngleX
Float MyAngleY
Float MyAngleZ

EVENT onCellAttach()
if (beenSimmed == FALSE && Self.Is3DLoaded())
	setMotionType(Motion_Keyframed, TRUE)
; 		;debug.trace("havok disabled on: " + self)
endif
endEVENT

EVENT onLoad()
if (beenSimmed == FALSE && Self.Is3DLoaded())
	setMotionType(Motion_Keyframed, TRUE)
; 		;debug.trace("havok disabled on: " + self)
endif
BlockActivation(true)
endEVENT

EVENT onActivate(ObjectReference triggerRef)
if havokonActivate == TRUE && beenSimmed == FALSE
	ReleaseToHavok()
endif
MyLinkedRef = GetLinkedRef()
MyBaseObject = GetBaseObject() as Book
;	debug.trace("Base Object " + MyBaseObject)
If MyLinkedRef.GetItemCount(MyBaseObject) == 0
	Self.Disable()
else
	Self.Enable()
	If (MyPosX == 0)
		MyPosX = Self.GetPositionX()
		MyPosY = Self.GetPositionY()
		MyPosZ = Self.GetPositionZ()
		MyAngleX = Self.GetAngleX()
		MyAngleY = Self.GetAngleY()
		MyAngleZ = Self.GetAngleZ()
;			debug.trace("Base Object " + MyBaseObject + " XPos=" + MyPosX + " YPos=" + MyPosY + " ZPos=" + MyPosZ + " XAngle=" + MyAngleX + " YAngle=" + MyAngleY + " ZAngle=" + MyAngleZ)
	Else
		Self.SetPosition(MyPosX, MyPosY, MyPosZ)
		Self.SetAngle(MyAngleX, MyAngleY, MyAngleZ)
	Endif
endif
endEVENT

EVENT onHit(ObjectReference var1, Form var2, Projectile var3, bool var4, bool var5, bool var6, bool var7)
if havokOnHit == TRUE && beenSimmed == FALSE 
	ReleaseToHavok()
endif
endEVENT

EVENT onGrab()
if havokOnZkey == TRUE && beenSimmed == FALSE
	ReleaseToHavok()
endif
endEVENT

FUNCTION ReleaseToHavok()
	beenSimmed = TRUE
	objectReference myLink = getLinkedRef(linkHavokPartner)
	if myLink != NONE
		defaultDisableHavokOnLoad linkScript = myLink as defaultDisableHavokOnLoad
		if (linkScript)  && (linkScript.beenSimmed == FALSE)
			linkScript.ReleaseToHavok()
		endif
	endif
	setMotionType(Motion_Dynamic, TRUE)
	Self.ApplyHavokImpulse(0, 0, 1, 5)
; 		Debug.Trace("Released Havok.")
endFUNCTION

Link to comment
Share on other sites

  • Recently Browsing   0 members

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