Havok disabling on short distance from player?

Post » Tue Nov 20, 2012 8:43 am

Hello,

I have a floating object that seems to disable havok on a short distance of the player, maybe 50 to 100 meters. It normally bounces up and down in the water until the aforementioned distance, and then freezes. It is always at exactly the same distance, as if the engine decided havok is no longer needed. As soon as I approach it again, it recovers it's havok and refloats. Is this a hardcoded feature and can it be overriden for a specific object?

I thought at first it might be persistance, so I added a constant OnUpdate event to the object, but didn't help... I need this object to keep floating even when the player isn't near.
User avatar
Robert Jackson
 
Posts: 3385
Joined: Tue Nov 20, 2007 12:39 am

Post » Tue Nov 20, 2012 5:17 am

Have you tried attaching the default script, defaultdisablehavokonload

To the object?
User avatar
BlackaneseB
 
Posts: 3431
Joined: Sat Sep 23, 2006 1:21 am

Post » Tue Nov 20, 2012 9:36 am

Isn't that script useful for just the opposite? Can it be inverted??? My object needs to keep it's havok enabled constantly and always float, independent of distance to the player.

Adding this script freezes it. I tried beenSimmed = True, but I get erratic behaviour.
User avatar
Harry Leon
 
Posts: 3381
Joined: Tue Jun 12, 2007 3:53 am

Post » Tue Nov 20, 2012 9:02 am

If you drop a regular basket or some other similar object in the water, and then step away from it, does the same thing occur? If not, why not?
User avatar
HARDHEAD
 
Posts: 3499
Joined: Sun Aug 19, 2007 5:49 am

Post » Tue Nov 20, 2012 7:52 am

I'm going to try that. I did try dropping my basket from a mountain, and it did roll quite far. I'm going to try this in the water with another floating object, something like a vanilla broom...
User avatar
Nana Samboy
 
Posts: 3424
Joined: Thu Sep 14, 2006 4:29 pm

Post » Tue Nov 20, 2012 3:49 am

If your object is a MovableStatic or an Activator, there is a checkbox labeled "Must Update Animations". I believe that causes the object to remain in so-called "high" memory and animate even when the player can't see it. Perhaps that will keep the Havok running as well? Just a shot in the dark.
User avatar
Nuno Castro
 
Posts: 3414
Joined: Sat Oct 13, 2007 1:40 am

Post » Tue Nov 20, 2012 5:40 am

On a similar note I have a market trader that seels armour, I've put 3 cuirasses hanging from his stall. On entering the cell they are fine but leaving the cell and returning they are on the floor. Also there is a noctice board with notes "attached" (don't havok settle) they hang fine until an NPC moves past and they fall. Anyway to stop this happening?
User avatar
Emilie M
 
Posts: 3419
Joined: Fri Mar 16, 2007 9:08 am

Post » Tue Nov 20, 2012 2:45 am

Verteiron, thanks for the try, but it didn't work.

Tested with vanilla objects, and they are affected by the same issue. If anyone can think of a workaround, I'll highly appreciate it. Until then, I'll have to rewrite things to account for this...
User avatar
neil slattery
 
Posts: 3358
Joined: Wed May 16, 2007 4:57 am

Post » Mon Nov 19, 2012 7:34 pm

I found why the object looses it's havok. It seems that objects with a clutter layer inside the rigidbody are handled as unimportant by the engine and it's havok get's disabled at a certain distance of the player (2000 units). It makes sense, as it probably saves quite a lot of resources... Objects set to Anim_Static do keep their havok regardless of distance.

The problem with ANIM_STATIC is that I just can't get the object to float with this layer, while clutter layer objects float fine.

I fear that this is hard coded, as I couldn't find any function in any script that might be checking for distance and changing the objects motion type to keyframed. If anybody knows where this is being called, that be great. Also, is there a way to handle a clutter object as an anim_static? My tries with the nif files have all failed...
User avatar
Veronica Flores
 
Posts: 3308
Joined: Mon Sep 11, 2006 5:26 pm

Post » Tue Nov 20, 2012 9:15 am

Does the object have any Havok behavior at all all when set to anim_static? Or does it just behave like a keyframed object? You might try using FloatyObject.SetMotionType(FloatyObject.Motion_Dynamic) and see if it behaves better as an Anim_static that way.

Otherwise you can try cycling through all the layer selections in the hopes that maybe there's one that does what you want. Do severed heads float in water? Try OL_HEAD :P
User avatar
Shae Munro
 
Posts: 3443
Joined: Fri Feb 23, 2007 11:32 am

Post » Mon Nov 19, 2012 8:55 pm

Actually, by further testing, I fear it's the water and not the layer... Maybe a combination of both. The object behaves fine on land at any distance, but in water it freezes or gets stuck at a distance of the player. I'm going to investigate further down this line. Could be that at a certain distance, water might just be LOD.

Now to study how water works...
User avatar
Batricia Alele
 
Posts: 3360
Joined: Mon Jan 22, 2007 8:12 am

Post » Tue Nov 20, 2012 6:06 am

Antstubell, I've been fighting this exact problem with my apple trees for a few days now. You will need to add a script to your stuff to disable the Havok, otherwise it'll keep falling down. There are a couple vanilla scripts you can use that will disable the physics until the object is hit (like by an arrow or a spell) but I'm not sure if that's what you want. If not, you'd need to copy one of those scripts into a new script of your own and modify the bit that turns Havok back on when the object takes a hit.

Also, just so you know, the script will only work if the cell in question hasn't been loaded already, which can be a pain in some circumstances. It's fairly simple to tweak the script to avoid that particular snag, but that just goes back to having to create your own script rather than use a existing one. I wish I'd known how it worked BEFORE I hung a vanilla script on approximately 73 individual apples. :P
User avatar
Kelsey Anna Farley
 
Posts: 3433
Joined: Fri Jun 30, 2006 10:33 pm

Post » Tue Nov 20, 2012 4:18 am

Antstubell, I've been fighting this exact problem with my apple trees for a few days now. You will need to add a script to your stuff to disable the Havok, otherwise it'll keep falling down. There are a couple vanilla scripts you can use that will disable the physics until the object is hit (like by an arrow or a spell) but I'm not sure if that's what you want. If not, you'd need to copy one of those scripts into a new script of your own and modify the bit that turns Havok back on when the object takes a hit.

Also, just so you know, the script will only work if the cell in question hasn't been loaded already, which can be a pain in some circumstances. It's fairly simple to tweak the script to avoid that particular snag, but that just goes back to having to create your own script rather than use a existing one. I wish I'd known how it worked BEFORE I hung a vanilla script on approximately 73 individual apples. :P

Glad you got it sorted in the end mate :) what is the script you eventually ended up using?
User avatar
DeeD
 
Posts: 3439
Joined: Sat Jul 14, 2007 6:50 pm

Post » Tue Nov 20, 2012 5:27 am

Sorry to hear you hung so many apples, I'm thinking of making a Xmas tree so I can see what'll happen to the baubles. Thing is with the Town Notice Board the notes have to stay there all the time. Some will be disabled initially and enabled as Quests become available but players will be in and out of this cell a hell of a lot, its a market place. Could I make the Notes STATIC and run some kind of script on them similar to the OnRead they are using now? At the moment they are MISC hence they fall with a gust of wind. And what script were you talking about in your post?
User avatar
loste juliana
 
Posts: 3417
Joined: Sun Mar 18, 2007 7:37 pm

Post » Tue Nov 20, 2012 9:35 am

Hello antstubell,

The script he's talking about is defaultDisableHavokOnLoad. It's probably easier to just copy the nif of your object and renaming it to something of your own. Then change it's rigidbody layer to OL_STATIC, motion system to Keyframed and motion quality to fixed. You can also set mass to 0. Duplicate your note in the CK and point it to your new nif. I think this should solve it...

I think branch deleting the whole bhkCollisionObject should also do the trick.
User avatar
sarah
 
Posts: 3430
Joined: Wed Jul 05, 2006 1:53 pm

Post » Tue Nov 20, 2012 7:27 am

Glad you got it sorted in the end mate :smile: what is the script you eventually ended up using?

I had to use the beehive script's code as a base and modify it to work on savegames where the cell might already be loaded. Added an identical block using OnInit instead of OnLoad and now it works fine.
User avatar
Red Bevinz
 
Posts: 3318
Joined: Thu Sep 20, 2007 7:25 am


Return to V - Skyrim